Let's Make Robots!

L293D question

I´m trying to make my own motor driver, and this is what i could do until now by following some tutorials.

Happens that i can drive the motor in both ways with no problem!

If i connect the servo, and the motor, they both run for a couple of seconds and then stops... i think i should use a power supply for the motor but i´m lost in here..





Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
My custom motor driver is finally working, i´ve made some changes in the Arduino code.
i´m still using Servotimer1, wich is a nice lybrary for servo control, but has the limitation of only pins 9 and 10 can be used.
Using PWM for the motors is also great because their speed can be changed.


I must give a BIG THANKS to all of you guys!!!!  your help was precious! and without you i couldn´t make this go through! I learned a lot with this and I feel a bit more confortable to build more sophisticated robots!!

For now I will improve the code and make "farrusco" more reliable and intelligent, and also work on "big br0" ..   this was the place where I stoped! And now that holidays ended, time is short for robotics projects..

I will post new videos soon  :)
Awesone, great to hear about it going! Now maybe a video of it?

here it is  :)


I also started the walkthrough and will post it first here.. as soon as it is finished I will post it in LMR.

It sounds like the device is going into therml shutdown, as the motor is near, or beyond the current handling capabilites of the L293D. So you could :

1. get a different motor, one with less current requirements

2. get an h-bridge that handles more current like the 754410 or the L298

3. add a heat sink, and hope that when the motor gets a little load, the device makes it through the extra current needed

 3 isn't realy an option since the driver is shutting down, just with the motor in free run. You did say you were swithcing it back and forth, and that contributes current spikes (going to stall one way to the other), but it sounds like the device is operating on it's edge.

hi robologist! thank you for helping me!
i´m a bit confused here!

if i have the motor alone it runs ok without stoping..    if i connect the servo and the motor, they run a couple of seconds and stop...

i feel that the motor needs more power..  i just don´t know how to make it... where should i connect the second power supply... 

its working for a couple os minutes non stop, non burning... smoothly!!!   :D       i´m very happy :D

i´m using another 9V battery with a 5V voltage regulator for powering the motor, and both arduino and L293D are sharing the same GND .. the other 9V powers the arduino, and the arduino powers the servo..   in theory i still can connect one more motor :D

 if anyone see something not correctly i apreciate advice!

i know it´s a mess, i´ll make this look better i promess  :)



Well, that changes the picture a bit. Little 9 volt (actually 7.2 volt) batteries don't have a lot of current they can deliver. It looks like these batteries are rated at 150 mAh (milli Amp hour).  Here is a Hitec HS-311 servo spec that shows an idle current of 7.4 mA, and 160 mA at max torque. The motor you have appears to be similar to those Mabuchi FA-130 used in the Tamiya gearboxes, which draw a considerable amount of current as well, call it a guess of 150 mA in free run (with a 3 volt supply), which is much higher at 7.2 volts. The Arduino seems to be rated at 40 mA. Combined, they all could drain those little batteries pretty quickly. Using 4 AA NiMh batteries could get you to 2000 mAh or more, giving a lot more runtime.

 The 5 volt regualtor at least keeps the motor current down,  but the device itself wastes the extra volts in the form of heat.

ok! here it is the new one!   :)   



works good but stops sometimes if the motor runs in both ways... after two seconds restarts again..  
if i use only the servo works nice
if the motor runs only in one way it works ok

do you know if I should use a capacitor or diode to prevent current spikes?  and where should it be placed?

thank you for helping me on this!!!!

Voltage spikes could conceivably be resetting the Arduino. Adding 50 uF +  cap across the power connections on the micro might help, as well as a forward biased diode between the h-bridge board positive, and the MCU positive power. This diode prevents the cap from discharging back into the motor circuit, if a low voltage happens there. I don't think this is the problem though.

It might be the voltage regulator cutting out trying to deliver more current than it's capable of.

The reversing would put the motor at stall current ratings each change in direction, which might be over-currenting/over-heating the h-bridge. You could make an estimate by placing your finger on the h-bridge as you run the motor. If it gets hot, so that it is difficult to hold your finger on, that is probably what is happening. Same with the voltage reg, on the metal tab.

You could also place a low ohm (0.1 ohm) power resistor in series with the power to the motor driver, to measure the voltage drop and then calculate the current used. I have one like the gold one in this picture that I've used. With the calculated value, you can copare it to the specs for the L293D, to see if you need an h-bridgecapable of higher current.

power resistors