Arduino Light Intensity Lamp

by denisesantiago in Circuits > Arduino

163 Views, 0 Favorites, 0 Comments

Arduino Light Intensity Lamp

Screen Shot 2020-05-22 at 12.01.41 PM.png

This project is a lamp that will automatically turn on when it is dark.

Gather Materials

Screen Shot 2020-05-22 at 12.10.26 PM.png
Screen Shot 2020-05-22 at 12.09.19 PM.png
Light Bulb.jpg
Screen Shot 2020-05-22 at 12.13.48 PM.png
1k-ohm-resistor_1_3.png
Breadboard.jpg

The materials you will need to create this circuit:

- Arduino Micro Controller (1x)

- LDR /Photoresistor (1x)

- Lightbulb (1x)

- Relay (1x)

- 1k Ohm resistor (1x)

- Breadboard (1x)

- Power Source (1x)

Configure the Circuit

Screen Shot 2020-05-22 at 12.01.41 PM.png
Screen Shot 2020-05-22 at 12.33.56 PM.png

Below, the connections that need to be made are listed. You can also use the photo above for reference.

- GND pin (Arduino) to ground rail (breadboard)

- 5V pin (Arduino) to power rail (breadboard)

- pin A0 to the LDR

- ground (breadboard) to LDR

- 1k ohm resistor to LDR

- 1k ohm resistor to power (breadboard)

- To configure the relay and lightbulb, refer to the diagram above

Coding

Screen Shot 2020-05-22 at 12.40.09 PM.png

The code needed for this circuit is pretty simple and short. The code takes the read input from pin A0 and prints it to the serial monitor. Next we state the values of A0 where we want the pin connected to the relay to either be high or low, depending on the value of A0. Above, I have put an image of what the code should look like. You should now have a working light intensity lamp circuit :)