# Light chaser

Follows the light

I have been asked recently to design a beambot for a customer. According to Wikipedia this is a true beam bot because only analog components are used. This model has two main features. The motor speeds are controlled by PWM to maintain good torque at low RPM and it does not care about ambiant light levels. I made a similar robot about 10 years ago but it's speed would depend on the ambiant light level and stop if it got too dark.

You can see in the photo that I had to make a small gearbox so the motors would have enough torque to push the robot along. The tyres are actually small rubber grommets and the shafts for the wheels are from a miniature servo that had stripped a gear.

The watch batteries being used had trouble putting out enough current to drive the motors so I had to put a supercap across the batteries. This charged up and gave the motors the extra current they needed to run for about 30 seconds. The final product will use smaller motors, better batteries and better gearboxes plus the components will be surface mount devices.

I have tried to explain how this works as I find the PWM output method better for driving small motors with a limited power source and hope others will find this method useful. Click on the schematic for higher resolution:

Brief explanation of how it works:
Amplifier (a) is configured as an oscillator with a frequency of about 200Hz. the voltage across C1 is a triangular waveform that is then buffered by amplifier (d). The triangular wave vairies between 1V and 2V.

Resistors R5, R6 and R7 were chosen to give a voltage of just under 1V between R6 and R7 and a voltage of just over 2V between R5 and R6. The two LDRs then form a voltage divider across R6 so that the voltage between the LDRs will stay between 1V and 2V while changing as different amounts of light hit the two LDRs.

Amplifiers (b) and (c) compare the voltage between the LDRs with the triangular waveform from amplifier (d) to produce square waveforms with a dutycycle that varies with the voltage from the LDRs. Note that the LDR voltage goes to the "+" input of amplifier (b) and the negative input of amplifier (c). This means that the duty cycle output of one amplifier will increase while the other will decrease as the voltage between the LDRs change.

In the diagram above I have labelled the voltage produced by the 2 LDRs as"A" and the buffered output from the oscillator as "B". The output of amplifier (b) is shown as "A>B" while the out put of amplifier (c) is shown as "B>A". When both LDRs get the same amount of light then both motors are driven at 50%. The outputs of amplifiers (b) and (c) actually swing between 0.2V and 4V.

I used the LM324 because it was cheap and is one of the few op-amps that can work at such low voltages (as low as 3V). It's output when opperating at 4.5V with a light load cannot go above about 4V or below about 0.2V. The output can sink more current than it can source. As a result I had to experiment with the value of R1 to obtain a 50% duty cycle from my oscillator and this also set the 1V and 2V limits used.

After testing with a single CR2032 3V battery I have now changed to 2x CR2032 batteries which give me 6V and better current output for the motors eliminating the need for the supercap. I rechecked the waveform voltages and although they were higher as expected the overall performance remained the same indicating that this design works well between 3V-6V without any component values being changed.

## Comment viewing options

it's very small and very cute

i really like it

and the best thing in it ,is that it can be easily made

really can't wait to make a robot

but i will have to wait till next summer vacation

i have too much study

next year I'll go to collage ,maybe i'' have more plenty of free time

neat
This node is not getting enough press. What was I thinking, redrawing your diagrams....

My jaw dropped when I first saw this bot levitating thru space.  Imagine my disappointment when I realized you had it on a glass table.

stevek