Introduction: Arduino Light Intensity Lamp
This circuit can be used as a actual lamp, school project, and a fun challenge. This circuit is easy to use and easy to make but if you have't used tinker cad before you may want to try it out first.
- photo resistor
- Arduino micro controller
- Light bulb
- Relay (since the light bulb takes 120 V and the Arduino only provides 5 V)
- resistor (1 kilo ohm)
- power source
- Breadboard (optional)
Step 1: Making the Circuit
To make the circuit use the image above as a guide. The first thing you need are all the components, then connect a black and red wire onto the bread bored (red on the positive to positive and black to negative to negative). Thirdly put in the appropriate component in their appropriate place. Make sure that the power supply has 5 volts and 5 current. Connect all the wires (terminal 5 of the relay is connected to pin 4 of the Arduino, and terminal 1 of the resistor is connected to in A0 of the Arduino). If you need any further help use the image above.
Step 2: Writing the Code
The blocks that you will be needing are the print serial monitor block, the if else block, the read analog block, the number greater then number block, and 2 of the set pin to blocks. If you need any further help please watch the video, or click the file.
Step 3: Test
Finally when you have successfully made the circuit and wrote the code you now can test it. To test it simply clink "run simulation" and then click the photo resistor and higher and lower the current.