Introduction: Arduino Automatic Night Lamp
Do you ever feel lonely and scared when you were just a little kid, about 5 or 6 years old, and you have to sleep alone? On the other hand, you are too lazy to remember to turn on the night lamb every time your room is dark. Also, considering the issue of global warming, it wouldn't be a good idea to always turning the light up. The automatic night lamp can solve the problem and consideration you are struggling with; determining the light of the environment and turn up in when you're suffering from the lonely in the dark. If it's already in the morning of tomorrow, yet you are still asleep, it will be a great function for the lamp of closing automatically to save the electricity. The blue light gives people an atmosphere of calm and relaxing mood, protecting you from the darkness while providing you a great night.
Step 1: Prepare Materials
Materials need for the Circuit
- Arduino Uno x1
- Breadboard x1
- Jumper Wires x1
- Resistors 10k Ohm x1
- Resistors 100 Ohm x1
- LED light (blue) x1
- LDR sensor x1
- Paper box as the base of your lamp
- Soldering Appliance
Step 2: Code
The code is here.
The first picture is the setting up of Serial print. Then the second picture is about the main program we have for the product.
Step 3: Start Assembling!
Follow the circuit picture above or follow the instruction below:
- Connect 5v to the positively charged line (+)
- Connect GND to the negatively charged line (-)
- Assemble the part of the LDR sensor, which doesn't matter which leg you connected them with (remember to use the resistor of 100 Ohm)
- DPin 8 as the positive side and connected with the longer leg of the LED light
- Connect the negatively charged line to the resistor of 10k Ohm
- Adding another wire to connect with the shorter leg of the LED light
Step 4: Appearance
As an official product, the appearance has to be creative and unique too. Therefore, I decided to use wax to make a ball-like lamp cover, which is hollowed inside and with a matte surface. After finishing the ball-shape cover for the light, it's time to open space, or a tunnel, for the light and LDR sensor to be placed inside the cover. By using the soldering appliance, we can successfully open a hole at the bottom of the ball.
Step 5: Congratulation!
Congratulation!!! All the work is done, you get a brand new night lamp and you can change the light with different colors by making the lamp by yourself.