Matchbox Car v1





This build consists of a tiny DC motors ripped from a pair of 9g servos, a h-bridge motor controller, an el-cheapo 8 bit pic and a 100mAh 3.7V LiPo battery.

Circuit :

(click schematic for pdf)




//wattnotions 7th August 2015
//compiled with xc8 compiler 
//program to provide pwm signals to motor driver 

#include <xc.h>
#include <pic16f690.h>

 void delay_ms(unsigned int n);
int main(void)
    TRISB = 0b00000000;
	PORTB = 0b00000000;
    TRISC = 0b00000000;
	PORTC = 0b00000000;
		PORTBbits.RB4 = 1;
		PORTCbits.RC2 = 1;
		PORTBbits.RB4 = 0;
		PORTCbits.RC2 = 0;

void delay_ms(unsigned int n) // with fosc = 4ms this should give around 1ms.....probably
    while(n--) {

What’s coming next

The problem with using these dc motors is that they have a very high rpm. Without a gearing system to reduce this the car is pretty hard to control with any accuracy. This version was intended as a prototype to test the idea of making a really small robot. I’ve ordered a boat load of tiny stepper motors from aliexpress, they should be here in a few weeks. Matchbox Car v2 will use these stepper motors to allow for more accurate movement (eg turn 90 degrees right, go forward 30cm etc). The next version will also include a small reflective sensor consisting of an infrared diode and receiver pair. This will allow the robot to detect obstacles a few cm in front of it and avoid them. The robot is currently using the front of the matchbox as the front wheel, this is not a great solution so some investigation into other options is probably a good idea. I was thinking maybe a small ball bearing or something like that…..


Google Drive folder with board artwork and code etc.

4 thoughts on “Matchbox Car v1

  1. Nice ! Which stepper motors did you order from Aliexpress ? Also were u able to find a gear system to small enough to fit in there ? I’m also looking for these components

Leave a Reply

%d bloggers like this: