| 1 | |
| 2 | == Materials Needed\\ |
| 3 | |
| 4 | a. You will need: A photoresistor, an arduino, an LED, and wires.\\ |
| 5 | |
| 6 | b. For this project, you can only use TinkerCAD, as the Arduino kits do not have any photoresistors.\\ |
| 7 | |
| 8 | |
| 9 | == Steps\\ |
| 10 | |
| 11 | a. As the name suggests, a photoresistor is a resistor of some kind, except that it can change resistance. A photoresistor is called a variable resistor, because it’s resistance changes, and in this case, changes depending on the amount of light around.\\ |
| 12 | |
| 13 | [[Image()]] |
| 14 | |
| 15 | b. A photoresistor can be used just like a normal resistor. So, we can connect the LED in series with a resistor.\\ |
| 16 | |
| 17 | c. To do this, we can connect the cathode of the LED to the photoresistor.\\ |
| 18 | |
| 19 | d. Then, the photoresistor connects to the GND of the Arduino so that the cathode side of the LED connects to the GND indirectly.\\ |
| 20 | |
| 21 | e. The anode side of the LED connects to the 5v so that it can receive power.\\ |
| 22 | |
| 23 | f. And that's it, no code required! Just click on the photoresistor and slide the circle around and see what happens.\\ |
| 24 | |
| 25 | |
| 26 | == Explanation of how it works\\ |
| 27 | |
| 28 | a. When there is a lot of light hitting the photoresistor, the resistance drops, and so, the current increases throughout the circuit.\\ |
| 29 | |
| 30 | b. This makes the LED brighter, as more current is passing through it, doing more work.\\ |
| 31 | |
| 32 | c. When there is less light hitting the photoresistor, there is more resistance, and so current decreases, creating a dimmer LED due to less current passing through it.\\ |
| 33 | |
| 34 | d. This can be used for things like light detectors for example. Photoresistors can be connected to an analog pin, and so, if there is a lot of voltage, the reading from the analog pin will be higher, indicating more light.\\ |
| 35 | |
| 36 | e. Programming can be used to detect daytime or night time by setting a range of values that indicate daytime when the value is high enough, or nighttime when the value is low enough. |