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.

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.

thanks for the good explanation!!!
power sources still confuses me a bit, but you have just make it more clear!!!  :)

i used this 9V batteries just for testing the circuit.. in the future i´m planning to use a 7.2V 2000mAh with a 5V voltage regulator to power arduino, servo and motor..            i still have a 9.6V 2000mAh 


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

I see!! I also see that this is becoming a bit advanced for my basic electronic understanding!

Here is a layout of this circuit, maybe you can tell where should I place the components?!
Full Version Here

Otherwise I see another possible solution, connect arduino to one battery, and the motor driver to another battery.  I will perform this test as soon as I can.

... it would be nice to use only one battery, but to make this so far has been a great step for me!

If we could make this more stable we could add a Tip/Walkthrough to build a custom motor driver  :)

The simple thing might be to move the voltage regulator so it only powers the micrcontroller, and the battery is directly connected to the L293D motor power Vs. You would still have to connect the Vss of the L293D to the 5 volts from the regulator.

What I'd mentioned earlier is shown below, adding a diode and a resistor. I'd tried to  show both the schematic addition, as well as what the typical components would look like.



nice!!  thanks!! 
I´ve been testing with 2 power sources and everything works normally!!

I will do some breadboarding following your instructions, add the capacitor and diode, and post feedback!