Light-seeking Microbug with added brains ...


Senior Member
The following project gave a lot of fun in our house; a light-seeking bug with a picaxe-08M brain added:

The small 08M prototyping board (AXE021) was added which contains a special 2.7V tolerant IR receiver (IRM-3638, this is needed as the bug runs on just two 1.5V AAA cells) as well as connections between the LDR-eyes and the motor-controlling transistors (the original connection between the LDR output and the transistor base is opened for this reason). The original potmeters were replaced by fixed resistors (3.3K), and 4.7K resistors are added to connect to the transistor base connections. The microbug shown here is a Velleman kit that I can recommend, but there are several types and variants available commercially and can be developed by oneself easily as well.

I have also added the necessary 100nF capacitors directly at the motor connections in order to suppress noise at the powerlines that may distrub the microcontroller otherwise
This microbug now has the following options:

  • Allows both direct IR command control as well as light-seeking (after selected IR option)
  • Directly after selection of the light-seeking option, the bug now calibrates itself w.r.t. the ambient light conditions, which makes it very flexible and user-friendly, as the original hard-to-control potmeters are not needed anymore.
  • Compensation was included for decreased LDR sensitivity with increased ambient light levels.
  • "Electronic spectacles" were added for compensation of differences in individual LDR sensitivities. (in our case a factor of nearly 1.4!)

This is a great project that I recommend to do with children interested in electronics, as the two different control options (TV Remote Control and direct light) are easy to understand. The microbug responds very quickly (and runs fast!) and actually performs its light-seeking function much better now than it originally did. Furthermore the discouraging hassle with potentiometer setting is not needed anymore.

As an introduction of porgamming to kids one can choose to start simple by direct programming of the motors, futher functionality can then be added afterwards.

Here is a link to the code (with extensive comments), but the challenge is of course to develop it yourself ...

Best Regards,


PS: Note on the photograph how the black wire connections are made: the transistor base leg is cut right at the print board level (leaving a remaining piece of leg on which the wire from the picaxe motor control output is soldered (via a resistor; don't connect a picaxe output directly to a bipolar transistor base input). The hole in the printboard is now used to wire the LDR voltage output (at this hole) directly to the PICAXE ADC inputs.
Last edited:


New Member
Very nice, Jurjen, thanks for sharing the code. I have a similar Velleman kit that has been lying around for some time that would benefit from this modification.

How did you arrive at the Offset calculations? Could you please explain this section of code a bit more?




Senior Member
Jo C,

I will return to your question soon. Right now i want to add that I have added a 100nF capacitor directly at the motor connections to suppress the motor noise on the power lines