Robots often need to detect light so they can follow a lamp, avoid shadows, measure room brightness, or respond to a signal. A photoresistor, also called an LDR, changes its resistance when light intensity changes, while a phototransistor changes its current. These sensors turn an environmental condition into an electrical signal that a robot can measure.
Understanding them helps students connect circuits, programming, and real robot behavior.
Key Facts
- Photoresistor behavior: resistance decreases as light intensity increases.
- Phototransistor behavior: collector current increases as light intensity increases.
- Voltage divider output with an LDR: Vout = Vin Rfixed / (Rfixed + RLDR) when the fixed resistor is connected to ground.
- Ohm's law connects sensor current, voltage, and resistance: V = IR.
- A threshold decision can be written as: if Vsensor > Vthreshold, then light detected.
- For a light-seeking robot with two sensors, turn toward the side with the larger light signal.
Vocabulary
- Photoresistor
- A photoresistor is a light-dependent resistor whose resistance becomes lower when more light hits it.
- Phototransistor
- A phototransistor is a light-sensitive transistor that allows more current to flow when more light reaches its base region.
- Voltage divider
- A voltage divider is a two-resistor circuit that produces an output voltage that depends on the ratio of the two resistances.
- Threshold
- A threshold is a chosen cutoff value used to decide whether a sensor reading counts as one state or another.
- Ambient light
- Ambient light is the background light already present in an environment before a robot adds or detects a specific light source.
Common Mistakes to Avoid
- Treating a photoresistor as if it produces voltage by itself. It only changes resistance, so it must be placed in a circuit such as a voltage divider to create a measurable voltage.
- Reversing the voltage divider formula without checking the resistor positions. The output voltage depends on whether the LDR is connected to Vin or to ground.
- Using one fixed threshold in every room. Ambient light changes from place to place, so the robot may need calibration or adaptive thresholds.
- Assuming a phototransistor and an LDR respond in exactly the same way. A phototransistor usually responds faster and outputs current, while an LDR is slower and changes resistance.
Practice Questions
- 1 An LDR has resistance 20 kΩ in dim light and is connected in series with a 10 kΩ fixed resistor to ground. If Vin = 5.0 V and Vout is measured across the fixed resistor, what is Vout?
- 2 A robot has left and right light sensors. The left sensor output is 3.8 V and the right sensor output is 2.1 V. If the robot turns toward the larger signal, which way should it turn, and what is the voltage difference?
- 3 A robot works well near a desk lamp but fails outdoors in sunlight because both sensor readings stay very high. Explain why this happens and describe one circuit or programming change that could improve the robot.