Matchbox Car v2 (fail)

PCB and schematic:

click for pdf


Pictures of the built board:





This PCB is pretty rough around the edges, I made it a few weeks ago with the intention of etching it at home but then decided to give OSHpark a go just to see what it was like. It’s really cool. It cost 10$ delivered for three boards and they shipped to Ireland in 2 weeks from the time I ordered them. This is the first time I’ve had a silkscreen which is why the silkscreening is pretty terrible (as you can see all of the breakout pads for the motors are very helpfully labelled pad1-9) the kinks still need to be worked out. Anyways long story short the ATtiny48 uC on this board has been bricked because I didn’t know not to set the RESET DISABLE fuse with my ISP programmer. Apparently the only way to recover it is by high voltage programming and a couple other pain in the arse methods. Think this will head to the scrap bin but keep your eyes peeled for matchbox car v3 now without a matchbox (budget cuts).

Some extra info:
uC used is an ATtiny48 which has an internal 8Mhz oscillator and an ADC all for the price of 60 cent. Pretty cool.
The chips used to drive the stepper motors are LB1948MC-AH motor driver chips. These chips are nice and simple they have 4 input pins which control the 4 output pins, then there is GND and VCC. The button was going to be for disabling the motors during programming/testing.

Matchbox car v2 Google Sketchup Model

v2 includes an IR reflective sensor and stepper motors.


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.

Matchbox Car – could it work?

All the parts were lying around so with a bit of solder and hot glue this is what happened:

matchbox car overhead view



This was done to test if the motors were powerful enough to push the weight of the matchbox. The answer is yes they can but a change in battery type is needed pretty badly. The motors only run for about 10 seconds before the battery voltage drops too low for them to run. A cr2032 battery is used here and they probably aren’t made for high current uses such as this. Each motor can draw 100ma from 3V so that is 200ma draw total from the battery. A small LiPo would be a good match (lol) for the job. The next question is could you fit in a tiny pcb with a small battery, a microcontroller, transistors to drive the motors and maybe a tiny reflective sensor (IR led + phototransistor) poking out the front to detect obstacles? The two tiny DC motors were ripped from a pair of broken 9g mini servos.

made a very quick video of it doing donuts, realised afterwords that it’s at a funny angle but oh well you get the idea: