Build your own motor driver!

by Oscar

What is L293D? 

So what’s L293D, and what does motor driver do?

Some of the links on this page are affiliate links. I receive a commission (at no extra cost to you) if you make a purchase after clicking on one of these affiliate links. This helps support the free content for the community on this website. Please read our Affiliate Link Policy for more information.

The L293D is a H bridge 16-pin chip that takes an external power supply and drive up to two 5V DC motors (suitable for most of the homemade robots). And with the motor driver each motor can be controlled by 2 input signals to run clockwise and/or counter clockwise.

L293D

Components Required:

  1.  L293D (16 pin chip – H bridge motor driver)
  2. 10uF, 0.1uF capacitors
  3. Screw terminals
  4. Strip board

Here is the schematic:

motor-driver

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 (for controlling speed), we will need to have individual input for ENABLE 1 and ENABLE 2. But I won’t be controlling speed, so just connect them to the 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.

Testing on Breadboard

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

031220111259-300x225

After confirming it’s  working! We should plan the PCB circuit 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:

motor-driver-300x225

input1/input3 input2/input4 action
LOW LOW STOP
LOW HIGH CLOCKWISE
HIGH LOW COUNTER-CLOCKWISE
HIGH HIGH STOP

Testing Motor Driver on Arduino

Now, let’s test it with some motors and wheels, see Video at the top. (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.)

081220111274-300x225

Leave a Comment

By using this form, you agree with the storage and handling of your data by this website. Note that all comments are held for moderation before appearing.

3 comments

Andy 27th January 2015 - 8:30 am

Hi there Oscar, very interesting, I was talking to Neil Kempshall (my son in law) at the weekend about my r/c m odels and he gave me this link and the one for your drone blog. Is there a way of taking this controller further? I build r/c rock crawlers and have a need for brushed motor speed controllers running on 7.2V. Forward – reverse – and speed control in both directions. I just wondered if it would be cost effective to build your own?

Regards,
Andy.

Reply
Oscar 29th January 2015 - 1:25 pm

HI Andy, Yes Neil did mention about your interest in RC hobby. For this type of motor drivers, it would be easier and cheaper to just get a module on eBay from China. I enjoy DIYing and seeing how things work, that’s why I build this motor controller myself :)
Just searched on eBay for “L298N motor driver”, most of them are under £5, accepts wide range of voltage and large current output.

Reply
smina 19th September 2014 - 3:43 pm

good circuits

Reply