7 Dec 2011

DIY: build your own motor driver!

What does it do:

it will take an external power supply and drive up to two 5V DC motors (suitable for most of the homemade robots). Each motor can be controlled by 2 input signals to run clockwise and/or counter clockwise.


What components involved:

1. L293D (16 pin chip - H bridge motor driver)
2. 10uF, 0.1uF capacitors
3. screw terminals
4. strip board

So, I first came up with the schematic:

for simplicity, I connected Vcc1 (motor power supply), Vcc2 (chip power supply), Enable 1 and Enable 2 all to 5V DC. 

Vcc1 should be connected to whatever the motor requires upto 36V, but in this project or in the near future, i will be just using 3V motors anyway, so that would be good enough. 

To enable PWM ( controlling speed), we will need to have individual input for ENABLE 1 and ENABLE 2. But I won't be controlling speed, so just merge them with power supply.

The capacitors are optional, the circuit works without them. But to protect the chip, it is considered good practice to connect them to the power supply.

I then build it on a vero board and test the result:

Seems working! so i designed and tried to solder it on the stripboard. It was very difficult because the board is so small and there are so many components i need to fit in. Also I haven't been doing any soldering since second year in Uni... ah... what a pain.

This is what I got:

:`(    it's very messy, no wonder it won't work!!

I was trying so hard, to place all the cables on the back, but it doesn't seem to be working!! morning wasted!! I later realized it's the connection problem with the solderings.. so I spent the whole afternoon redesigned it and did another one. But this time I leave all the cables on the front instead to make sure the best connection although it looks messier.

Finally it works! both Channel are working properly!


Now, let's test it with some motors and wheels (notice I use the 5V supply from Arduino, this is actually not a good practice as it could harm your arduino board. it's better to use external power supply. But as my AA batteries are still on delivery, i will just use it for testing today.)