Introduction to Line Follower Competition
One of the traditional challenges in robotics is the Line Follower Competition, where robots navigate along a pre-drawn black line, usually made of duct tape, on a white surface, commonly paper, cardboard, or plastic. This competition necessitates specialized sensors to detect and follow the line accurately. Reflective optosensors, like CNY70 and LTH-209, are typically employed in this context. These sensors consist of a phototransistor and an infrared LED, enabling the robot to showcase its speed and agility on the designated path.
Working Principle of Reflective Optosensors
In this setup, the infrared LED emits infrared light onto the surface, and the phototransistor acts as a receiver, detecting the reflected light. The black line reflects significantly less light than the white surface beneath it. The intensity of light detected affects the current flowing through the phototransistor. Consequently, when the sensor hovers above a white surface, more current passes through the transistor due to the higher light intensity. This mechanism allows the sensor not only to follow the line but also to serve as an effective surface detector.
Determining the Minimum Number of Sensors
At its core, a line-following robot requires a minimum of two sensors—one on the left and one on the right side of the robot. However, it’s often recommended to use at least three sensors—placing one on the left, one on the right, and one in the middle. This additional sensor acts as a failsafe measure, preventing the robot from accidentally falling off the edge of a table or track.
Sensor Voltage Comparison and Course Adjustment
Within the circuit, the voltage across the phototransistor is compared to a reference level set by the variable resistor P1. When the phototransistor is exposed to light, its voltage decreases. The comparator IC1A then compares this voltage against the set reference. If the reference voltage surpasses the phototransistor voltage (indicating the presence of a black line under the sensor), the comparator’s output drops almost to zero. This output signal is typically connected to a microprocessor or control logic, allowing the robot’s course to be adjusted in response.
Calibrating the Circuit for Accuracy
Calibrating the circuit is crucial for its accuracy. To calibrate, the P1 preset should initially be set to the center of its range. Position the sensor above a white surface, ensuring the sensor’s height above the surface is consistent. If the comparator output responds as expected (pin 2 High) when the sensor is over the white surface and then changes appropriately (pin 2 Low) when moved above a black line, the circuit is correctly calibrated.
If not, the calibration process must be repeated, adjusting P1 until the desired calibration is achieved. The schematic illustrates one channel, and multiple channels can be created with a single LM339 IC. Additionally, a pull-up resistor is added at comparator pin 2 due to the open-collector outputs of the LM339. The choice of comparators and opto-sensors can vary, so referencing their specific datasheets is essential due to different pinouts.