Introduction: TfCD Night Lamp by D. Park and L. Strauss
Are you tired of switching on your lights manually over and over again? Here`s a step by step instructable on how you can make your very own customized automated lighting switch. In all seriousness, this prototype was built in the scope of the course TfCD at the TU Delft.
For a light controlled night lamp you will need the following components and a computer/laptop: 10K Ohm Resistor, 330 Ohm Resistor, LDR (Photoresistor Sensor), LED (red), Arduino microchip controller, 6 Wires, Breadboard, USB Power Cord
Step 1: Power Breadboard
Use the 5V pin as power source. Make sure that it is connected to a positive input of the breadboard.
Step 2: Connect the LDR
Then assemble the LDR and connect it to the positive power rail of the breadboard. Note: Plug the new wire (green) into the same breadboard row as one of the LDR`s pins.
Step 3: Add the Resistor
In this step you have to add the 10K Ohm resistor, sharing the same row with the LDR´s second pin. The resistor should then be connected to the ground (blue rail).
Step 4: Complete First Circuit
Take the fourth wire (orange) and plug it into "A0", an analog input pin of your Arduino. Make sure to connect the LDR with this wire, using the same row as the resistor.
Step 5: Adding the LED
Add the LED to the breadboard and connect its "longer/positive" pin to your Arduino. Make sure it is connected to a digital pin (in our case 9).
Step 6: Pin 2nd Resistor
Put the 330 Ohm resistor in series with the LED and finish the circuit by pinning it to the ground.
Step 7: Power Up!
Check if everything is correct and connect your Arduino to your computer.
Step 8: Define the Initial LDR Value
Step 9: Determine the Pin of the LED Output
Step 10: Start Off the Code
Step 11: Determine the Mode of the Pin
Step 12: Define the Main Loop
Step 13: Read Out LDR Status
Determine if it is dark!
Step 14: Export the LDR Value
Step 15: Define LED´s Function
LED will switch on when the LDR sensors darkness