Introduction
My project was to construct a simple one axis light tracker using a pair of light sensors and a servo motor along with a Atmel Mega32 microcontroller.
The intent of this project was to develop the light tracker for use as possible ECE 476 lab exercise. To construct the tracker, I placed two photo resistors on the servo motor’s arm along with a piece of cardboard to separate the sensors. The sensor input was obtained through the MCU’s ADC units and the servo control was done using a Pulse Width Modulator controlled by the MCU’s on board timer. To prevent the MCU from being damaged by the inductive spikes cause by the servo motor, I used a TLP371 opto-isolator to isolate the MCU from the motor. I also used a separate power supply for the servo to further isolate the motor from the microcontroller. Lastly, I programmed the MCU to rotate the servo motor to make the outputs from the two light sensors were identical, which would only occur if both sensors were facing directly into a light source. To make the motion of the servo motor smooth and to avoid overshooting while tracking a light source, I used a PID (Proportional Integral Derivative) control algorithm to generate the position corrections to the servo’s position.