Analog Line Follower

The Analog Line Follower is a line following robot that uses an analog circuit to generate a PWM-like signal that varies depending on a voltage-based sensor input. This allows for varying motor speeds, which facilitates a smooth motion, instead of a zigzag.

This project was the final project for my Introduction to Microelectronic Circuits class at UC Berkeley and was a collaborative effort between myself and two other lab partners. We were tasked with adding a new function to our T-frame popsicle stick robot. 

After deciding to make it into a line follower, we had to design a circuit to implement this functionality. We already had photocells, so those were used as the robot's "eyes." Bright white LEDs would serve as a consistent light source for measuring reflectance. Originally, the robot used vibrating motors and spring feet to scoot around. This did not provide a consistent motion, however, so we procured geared motors and added wheels. I used CAD to design mounts and wheels for the motors and fabricated them using my Mini Kossel 3D printer

We could have just used a couple of comparators to switch the motors either on or off, depending on whether the corresponding sensor was over black or white. This would have resulted in a zigzagging motion. However, we decided it would be more interesting to implement a circuit that would emulate the behavior of varying PWM signals. By allowing for varying motor speeds, a much smoother motion could be achieved. After some researching, we found a concept that we could use to implement the line following functionality. 

By passing a triangle wave in to one comparator input and our varying sensor voltage in to the other comparator input, we could achieve a PWM-like output that would change in proportion to the sensor's reading. This output is fed into a transistor that switches the motor on and off.

The top half of our schematic is the triangle wave generator, and the bottom half is the sensors and motor control. After drawing out a schematic, we constructed our circuit on a breadboard, which ultimately ended up being adhered to the top of the robot. Using 50k Ohm potentiometers, we tuned the sensitivity of our robot's "eyes" until it was able to follow a line consistently. The result can be seen in the video at the top of this page.