Arduino Photoresistor LED
My project is about a photo resistor lowering a LED's light depending on the outside light. I took inspiration from, Tech, A Style. “Arduino Photoresistor LED On/Off.” Instructables, Instructables, 8 Oct. 2017, www.instructables.com/Arduino-Photoresistor-LED-o... Tech, A Style turned on a led and off a led using light. I remixed mine to where it will lower depending on the light, The more the light, the brighter it is. The lower the light, the darker it is. I first researched on how a photoresistor works, how to build a simple one, and reviewed the basics of the code needed. After this I then set out on my project
Materials
The materials needed for this project are,
1 Arduino Uno, (I used a MEGA2560 R3),
1 Bread board,
1, 1k resistor,
1, 220 ohm resistor,
Jumper wires,
1 LED,
1 Photoresistor,
and the Arduino App
Photoresistor Setup
First I put a wire from positive side to the 5v on the bread board. Then I put up a photoresistor vertically on the bread board. Then I put a jumper wire from one side of the Photoresistor to A0.On the same side I put the 1k resistor to the negative side. On the other side i put it a wire to the positive on the breadboard.
LED Setup
For the led I did the same thing (almost). I put it Vertically on the bread board. On one side I put a Wire connecting it to PWM 9 (you can put it to any). On the other side I put the 220 Ohm Resistor connecting the LED to the positive side of the breadboard.
Code Setup
Lastly, the code. For the code, it explains what happened within it.