Introduction:
Ask students whether robots are aware of their environment. What do they need to recognize their surroundings? Make a comparison between robots and humans and ask what enables humans to understand about their environment. More specifically, ask what robots need to recognize areas with light or dark. Give several examples of the situations why robots need to sense light. Establish that photo sensors in machine world are analogous to eyes in biological world.
Introducing Photoresistor:
Ask students to describe the function of a resistor. Ask whether resistors have fixed values. Introduce the photresistors at this point and ask students to guess how photoresistors work using its name as a hint. Establish that the photoresistor is a light dependent resistor meaning that its resistance value depends on the brightness or illuminance of the light that shines on its light detecting surface. Draw a photoresistor and its schematic symbol on the board and ask students to find it in their kit.
Activity #1: Building and Testing Photoresistor Circuits
Draw this schematic on the board and explain how the photoresistor circuit works. As an example, using a 5 V input, resistance of 2 kΩ for photoresistor, and Kirkoff’s Laws, calculate the output (2.5 V). Have students solve the same problem with a different value for photoresistor. Establish that the output voltage is calculated using the following equation:
V_output = 5V x (2000 Ω) / (2000 Ω + R)
where R is the resistance of the photoresistor.
Have students build the equivalent circuit. This sensor circuit will be able to detect the difference between shade and no shade. Ask students to test their circuits with an input of 5V (using power supply) and read the output voltage using the multimeter. Ask students to experiment with different voltage dividers by replacing the 2 kΩ resistor with different resistors (470 Ω, 1 kΩ, 4.7 kΩ, and 10 kΩ) to determine which resistors work best under the lighting conditions. The best combination is one that is not overly sensitive, but does not require them to cup their hands over the photoresistor either.
Reading Sensor Output Values in Computer:
Ask students to find I/O (Input/Output) pins on their robots. Ask them what they think the functions of these pins are. Give a brief description of the I/O pints’ functions and have students to rebuild two photoresistor circuits, one on the right and the other on the left side, on the robot’s breadboard using their best combination of resistors found in activity #1.
Help students to code their robots to read the sensor values (for a sample code click here).
Activity #2: Roam and Avoid Shadows Like Objects
Ask students whether the information provided by the sensors is useful. How they can use the sensor readings to improve the robot performance. Guide the class towards the use of logic statements (IF…ELSE). Have students write directions for their robots to roam around a space and avoid shadows on a piece of paper. Check students’ work and guide them towards the use of IF…ELSE statements. Once the directions are complete, have the students to program their direction in the language of robots (for sample code click here). Allow students to test their robots on a white surface with dark spots. If the robots do not perform well, help the students with the debugging of their codes by asking questions such as
- what part of the surface does the robot have problem with?
- what is your current command for that part?
- if you were the robot, what directions would you need to over come this problem?
- how do you translate those directions into commands in your program?
|