Arduino + L293D problems

Hi there

I seem to be having a problem getting my L293D working with my arduino...

I am designing a circuit that will eventually allow me to power central locking motors in my car, and I am currently using a L293D in the circuit.

I tested the basic system on a breadboard, with the L293D hooked up to the arduino and a basic motor I found for testing. Everything worked fine.

I've now soldered the whole thing down to a PCB, but for some reason it no longer works =/

The strange thing is... is that the Arduino is sending out the correct voltages (Enable 1 is HIGH, and the two control pins are alternating between HIGH,LOW and LOW,HIGH). Only one motor is connected.

On the motor output of the L293D, I have the correct voltages coming out also, +12v, then -12v. As soon as I connect a motor however, the only thing that happens is the motor performs a feeble jerk, and the arduino resets itself. It is almost as though the power supply (an external variable voltage/amp box thingy - I cant remember the name), is not putting out enough power, yet according to all my meter readings it is.

The arduino is being powered through VIN through a voltage regulator connected to the external supply. I have also tried USB, but nothing different happens. All grounds are connected together; all four ground pins of the L293D are wired to the arduino and external ground.

I have used my multimeter to make sure that no pins are shorting together and that nothing is touching where it shouldn't be. I should also note that when connected directly to the power supply the motor works fine.

I have no idea whatsoever why this fails to work... so if anyone could help it would be much appreciated!

...Oh and happy new year everyone! insert party emoticon here

As soon as I connect a motor however, the only thing that happens is the motor performs a feeble jerk, and the arduino resets itself. It is almost as though the power supply (an external variable voltage/amp box thingy - I cant remember the name), is not putting out enough power, yet according to all my meter readings it is.

Sounds like the voltage is fine, but the current required by the motor is exceeding the current capabilities of the power supply.

How have you measured the current output? Or, are you only measuring the voltage?

the power supply I am using allows you to vary the voltage and ampage, I have changed the amps around between 0 and about 500mA, but still nothing.

The L293D I am using has a rating of 1.5a, and the motor I am testing with is tiny, I don't believe it would need very much at all.

I should point out though, that when the motor is directly linked to the power supply (at about 100mA) it spins normally, and quite fast in either direction... so if the same power supply is running the L293D, it shouldn't be a problem. I am certain that the power supply is connected to the right pin, and that it is not trying to run from 5v.

I agree though that it does sound like it isn't getting the current... but I can't figure out why that might be.

Post a picture of the setup, and the code your running. Might be something that someone spots right off.

the power supply I am using allows you to vary the voltage and ampage

I assume by varying the current you actually mean the current limit. You can only control the current by controlling the voltage.

The current limit is the amount of current you can take from the power supply before it shuts down. It sounds like it is shutting down. Maybe the initial start up surge is tripping your power supply. Try some extra decoupling:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Ok, I've found the problem

Thanks for helping out everyone, it turns out that the Arduino was not putting out 5v on the digital pins, but between 2v and 3v. I increased the voltage going to the VIN to 12v and it now works fine.

One question though, this is going to run for days perhaps weeks at a time, so would it be safer to put some kind of cooling on the onboard voltage regulator on the Arduino, or maybe step down the voltage a little? Or would it be ok as it is.

Thanks :-)

I increased the voltage going to the VIN to 12v and it now works fine.

Increased it from what?

so would it be safer to put some kind of cooling on the onboard voltage regulator on the Arduino,

Depends on what else you are driving with the power going through the regulator. It is fine if it is just a few LEDs and the L293.

The VIN was at 5v, coming from another voltage regulator with 12v into that, but the digital outputs wouldn't give more than 3v or so at that, but after putting it up to 12v at the VIN it works fine.

About the regulator, yes that should be fine then, all that is running on the Arduino's regulator is the Arduino itself, anything else that needs power is getting it through either the 12v supply or a 5v regulator connected to it. That one has a thermal cut-out on it and I'll be using a heatsink on it anyway so I'm not too worried.

By the way, thanks for the link on de-coupling, I'm fairly new to electronics (the Arduino being my first real start with them), so I hadn't thought about it. I'll add some capacitors onto the circuit once I figure out the right size to use :).

I'm doing computer architecture in college which involves lots of in-depth work into how microcontrollers and processors etc work, so the Arduino is a brilliant practical way of learning these things.

As soon as this project is finished I'll be posting all the info, code and circuit diagrams on what I've done. It'll probably need a bit of tweaking; as I said I'm new to the subject... but hopefully it'll be good.

The VIN was at 5v,

The Vin goes through a 5V regulator so this needs a volt or two above 5V to allow it to work. 7v should be enough but 12V is fine. What was happening was the regulator was only giving out 3V so that is why the output was so low. If you are new then have a look at some of my other pages:-

http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

and http://www.thebox.myzen.co.uk/Tutorial/LEDs.html there are many pages off these.

Best of luck with your studies.