This activity will focus on another type of sensor that can be used with Arduino. Participants will learn how to apply their knowledge of basic circuitry by making it more complex through adding more complex input sensors. It also introduces participants to the many abilities of Arduino.
For each participant:
1 photo resistor
1 Red LED
1 Green LED
1 Yellow LED
10 wires
3 100 Ohm Resistors
1 breadboard
1 220 Ohm Resistor
1 Arduino Uno
In general:
1 Computer source
1 USB Arduino cord
photo resistor
LED
Circuit
Breadboard
Arduino
Resistors
Draw a map of up to 5 different places you go to often.
How do you get there? (walking, driven/driving, etc.) What connects those places? (roads, sidewalks, etc.)
While you are going to and from those places, how do you use digital technology, or what digital technology is used to get you there safely?
A photoresistor, also called photocell, is a light-controlled variable resistor. It is also referred to as LDR (light-dependent resistor). A photoresistor will read in light resistance, allowing it to be used to control output based on the amount of light in a room. The resistance of a photoresistor will decrease, the higher the light intensity becomes.
In this activity, you will be building a circuit that utilizes a photoresistor. You will then run it with the Arduino IDE, and the code will read in the resistance from the photoresistor, and modify the output accordingly. Specifically, when the code is run, the green LED will be lit if there is little resistance (lots of light), the yellow LED will be lit when there is medium resistance (it is shady), and the red LED will be lit when there is high resistance (it is very dark).
A photoresistor looks something like this:
A quick video explaining how a photoresistor works:
Here is a schematic design of the circuit you will be building:
This shematic is a helpful visual to show you where to place certain objects. It doesn't matter which row the objects are in on the breadboard, but it is crucial that the objects are in the same row as each other. For example, the green LED could be in the row above where it is located on the schematic (or even a row below), but the yellow wire that is in line with the shorter leg of the LED MUST be in the same row as the shorter leg of the LED. If you recall the breadboard lessons, this is because of the way the breadboard is created, so the placement of wires in a given row matter to successfully complete the circuit.
Walk through this diagram with the participants and get them to think about where certain things are going and why. Why do certain things need to line up? How does this create a full circuit? What would happen if a wire were placed in a row below where it is shown? Why would that happen, and how would that affect the circuit? Etc.
If participants want, have them build the circuit just based off of the schematic design. Pay careful attention to which pins of the Arduino the wires are going into. The yellow, red, and black lines represent wires. (NOTE: They are shown with corners, but this is not realistic.) The schematic simply shows them like this to make it easier to visualize everything. If participants need extra help, refer to the individual steps in "STEP 4: CREATE THE CIRCUIT" for guidance, or refer to the actual website this activity was taken from, located in the "APPENDIX" section.
Hook a wire from the 5V pin on the Arduino to positive rail on the breadboard.
Hook a wire from the ground pin of the Arduino (marked GND) to the ground rail of the breadboard.
Place the photoresistor on the breadboard.
Hook a wire from one end of the photoresistor to the positive rail of the breadboard
Hook a wire from the other end of the photoresistor to the A0 (analog) pin of the Arduino. Next to this wire, place a 220 Ohm resistor that goes to the ground rail of the breadboard.
place the 3 LEDS (a green, a red, and a yellow) on the breadboard
To the left of each LED, place a 100 Ohm resistor that goes to the ground rail of the breadboard.
Hook a wire from the right end of the red LED to pin 4 of the Arduino
Hook a wire from the right end of the yellow LED to pin 3 of the Arduino
Hook a wire from the right end of the green LED to pin 2 of the Arduino
Refer to the "Setting up Arduino" page if you haven't set up the Arduino IDE yet
Following the directions for setting up the code on the main page:
Click on the "New Sketch" button found near the top-left of the page
Type the following code onto the new sketch. Make sure the code is identical, code must be exact. Include all semi-colons, dashes, tabs, and capital letters. If the code is not exact it will not run correctly.
I named my sketch "light_sensor" but you are welcome to name it whatever you please
With the code you have on the computer click the " ✔"
Then click the "↠" circle, this will upload the code to the Arduino
Now you can try manipulating the light in the room or manipulating how much light the sensor is exposed to. You should see different LEDs light up based on the amount of light the sensor receives.
How has digital technology improved your life?
Can you think of times where digital technology has NOT improved your life? Explain.
What are some things you have seen in your daily life that could have benefited from the use of technology?
How would you describe a photo resistor to a family member?
Did you help someone during today's activities today? If so, how?
In what ways have you seen technology that includes photoresistors being used in your community? If you haven't or are not sure, imagine ways in which it would be integrated in your daily technological use. What would that look like?
This activity was taken from the project linked below: