Kolobot with 08M2 and H-bridge

Hello everybody,
I would like to share simple robot with 08M2 and ultra simple H-bridge. Credit for H-bridge goes to Mr. Andrew H.:
Only two pins control directions of two motors. Each motor has its own H-bridge. Log 1 - motor forward, Log 0 - motor backward, Input - motor stops. I use "yellow motors" that starting running at 3V and take about 190mA. For such a h-bridge to function it is important to use low voltage and low current motors. Do not forget to put ceramic capacitor directly across motor terminals. I use 4 x AA NiMh 1,2V batteries to eliminate voltage drops. The robot runs very well. There is one more pin left that can be used for IR control. Attached you can find KiCAD files for inspiration. The base of robot is made of plywood. To make it cheap I used what I found at home. The front and rear supports are made of solid Cu wire with cross-section 2,5mm and wooden beads.

EDIT: the links are dead, because there is a new forum. But there is this post at least:

EDIT 2: I changed schematic. I added IR sensor that is connected to the pin c.5 (see this discussion http://www.picaxeforum.co.uk/showthread.php?30033-08M2-No-reset-pin/page3) and changed the value of "programming resistors" accordingly. There is also a PWM circuit in the schematic (credit goes to Andrew form brightsparks forum). The pcb has pin headers for easy change of connections between various parts of the whole circuit. In the zip file there is schematic and PWM circuit with H-bridge. This is the reason for a jumper at GND branch of the H-bridge. There are also two leds and a buzzer for various experiments with the Kolobot.

View attachment KiCAD.zip

Last edited:
Thank you for comments. Here is a simple code for inspiration.
rem c.0 - HC-SR04 Trig
rem c.1 - left motor
rem c.2 - right motor
rem c.3 - HC-SR04 Echo
rem c.4 - N/A (free pin for IR or other)

setfreq m4

symbol both_motors_disabled = %00001
symbol both_motors_enabled = %00111
symbol both_motors_fw = %00111
symbol both_motors_rew = %00001
symbol turn_left = %00101
symbol turn_right = %00011 ;not used here

dirs = both_motors_disabled
pins = both_motors_disabled
pause 3000

pulsout c.0,2
pulsin c.3,1,w1
pause 10
w1 = w1*10/58
rem sertxd ("w1 = ",#w1," Cm ",cr,lf)
pause 20

if w1<60 then
gosub left
gosub fwd


dirs = both_motors_enabled
pins = both_motors_fw

dirs = both_motors_enabled
pins = both_motors_rew

dirs = both_motors_enabled
pins = both_motors_disabled
pause 400
gosub stop_before_revers
dirs = both_motors_enabled
pins = turn_left
pause 200

dirs = both_motors_disabled
pins = both_motors_disabled
pause 100