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..

 

130925163_57652b137d.png

2818514406_e6ed69ac5a.jpg

2817665905_ce0901b622.jpg

Yes, changing motor or driver

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

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

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

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 :smiley:

if anyone see something not correctly i apreciate advice!

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

130925163_57652b137d.png

 

9 volt batteries

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

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

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

ok! here it is the new one! :slight_smile:

2824842353_6b53791e17.jpg



2824870505_4fc20b6078.jpg




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!!!

Back to an earlier theory, h-bridge protection

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.

I see!! I also see that this

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

130925163_57652b137d.png



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 :slight_smile:

2 power helps

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.

L293D_mod.gif

power-add.gif

nice!! thanks!! I´ve

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!

 

 

Your diagram looks like you
Your diagram looks like you are poweing the motor driver and the microchip from the 5volt regulator. Wouldn’t the positive connecting from the regulator and motor driver be seperate from the microchip power? Same ground, but different sets of batteries?

yes!! with two batteries one

yes!!

with two batteries one powering the Arduino and the other powering the motor driver, both sharing the same ground everything works ok, and this problem could be solved this way.

I would like to have only one battery just for aesthetic pleasure i guess… :slight_smile:

i will try to see how things work by following robologist suggestion.

One battery could be a
One battery could be a problem. You would need 2 regulators one going to the microchip and one going to the motor driver. Otherwise when you powered the motors the 5volts would drop enough to either not power the motors or reset your chip.

With the size of the motor

With the size of the motor and the fact that the driver only pulls a little over half an amp (600mah per channel and 1.2 at peak), I don’t think he’d have to worry about it.

From what it looks like, he’s also running a 7.2v RC battery which minmally would be around 1200mah(back in the day at least) most now I think are up around 1500- 2200mah… plenty of current for one motor and some electronics. This is how a lot of the RC car stuff is done…and actually, one of the leads would be directly connected to the motor.

Just need to make sure you have some ceramic caps on the motor to smooth out any spiking.

 

thnx voodoobot! I never
thnx voodoobot! I never understood what was the function of ceramic caps on motors!

I´m using that motor only for test purposes, in the future I plan to use any kind of motor…

robologist, should i place
robologist, should i place the voltage regulator after or before the cap and diode?

What I would do is:Use two

What I would do is:

Use two voltage regulators. One for the motors and one for the electronics. If the motors are rated for 3V, you can use a 3V regulator to make sure that they are not overpowered.

If you look at the datasheets for the voltage regulators, you can see that they recommend (require?) capacitors before and after the regulator. I would build two “regulator blocks” with regulator and capacitors. Feed the input with the battery and the output from one to the motors and the other to the electronics. If you look at the datasheet for the L293D, you can see that there are two power supply pins + a common ground. One for the logic and one for the motors/output.

I’m at work now, so I don’t have the datasheets here. Google for “L293D datasheet” and “7805 datasheet” (or whatever voltage regulator you are using) to find them.

Also, put capacitors (10-100 nF) on the power supply pins to each chip. Place it near the chip. This helps remove electrical noise and provide a clean power supply.

hi jka! I apreciate a lot

hi jka! I apreciate your suggestion, but I would like to keep this simple, just because I am giving my first steps on electronics stuff…

I find robologist suggestion a lot simplier…

Circuitry choices

It should be just as shown in the modified picture if you are not changing the power circuit, just before the micro.

If you are moving the regulator to power only the Arduino and motor driver logic supply, with the battery on the motor supply directly, then you don’t need the cap and diode.

As jka stated, regulator datasheets usually suggest using a cap on the input and output.