This project, titled ‘Light Tracker’ utilizes two light sensors to determine the location of a light source. These light sensors are made from two light dependent resistors (LDRs) attached to a wooden panel, and mounted onto a servo motor. As seen from the system model in Figure 1, based on the differential intensity of light received by both sensors, the servo motor will rotate the panel to a point where equilibrium is reached.
In order to meet the requirements of the final project, this design comprises of three basic categories and two advanced components. The three basic categories met are: bus interfacing, timers and interrupts. Interfacing to the servo motor via pulse width modulation (PWM) and dual-channel ADC selection are the two difficulty components used in the ‘Light Tracker’. A block diagram of can be seen in Figure 2.
The major difficulty experienced during this system’s implementation was with respect to timing issues. Interfacing to the servo motor (operated by PWM) required careful calculations to find the mapping of servo motor rotation to pulse size. This was easily solved by web research and trial-an-error. However, the ADC0808 was more complex to interface to. The first challenge encountered was the selection between two ADC input channels. The timing issues regarding the Analog Latch Enable (ALE) signal was slightly different from that of Lab 8 and had to be altered accordingly based on the timing specifications in the ADC0808 tech specs. After this problem was resolved, a subtly hidden problem arose. When running the system, it seemed that channel selection and switching of the ADC was still not successful. However, through Single Step, it was clear that the channel selection was indeed operational. Hence the problem was isolated to timing issues regarding conversion time. The previous implementation was to attempt to grab and convert both voltages on Pulse 0. After further calculations, the current (more efficient) implementation of sampling one voltage per pulse was proposed. This solution avoided the conflicts with conversion time and had no ill effect on performance as the analog-to-digital conversion time is insignificant with respect to one duty cycle.