H-Bridge ULN2003?

marcos.placona

Senior Member
Hi guys, I know it's been discussed here several times, and even I started a topic some months ago to discuss about this kind of approach.

I've been trying to drive some 3v motors (toy), but got stuck in a point. I know it must be pretty simple, but what I'm trying to do is run this motor forwards and reverse.

I'm attaching here the mock up schematics I've been working on for this driver, and I know the main flaw on it, it that it's being powered up by the picaxe, which can just provide something like 20mA, and this motor can drain 300mA.

I know this is the flaw, and that's why the motor is not running. But I don't really know how to go about wiring this motor to an external power source.

I've seen the schematics on the pdf3 page 6, where it shows how to wire the motor to an external source, but in this case I suppose you can only run the motor in one direction, which wouldn't be of much help.

Can anyone give me a hint about what would be a better solution, but still using the ULN2003 for my h-bridge?

Thanks in advance,

Marcos Placona
 

Attachments

BeanieBots

Moderator
Bottom line, you can't use a ULN2003 as an H-Bridge.
To drive a motor in both directions requires current to flow in both directions. The ULN2003 can only sink current. You could be VERY power wasteful and fit low R pull up resistors:eek:

If you want to stick with the ULN2003, then use it to drive a reversing relay and control the motor current with a second output. Simple.
 

marcos.placona

Senior Member
Bottom line, you can't use a ULN2003 as an H-Bridge.
To drive a motor in both directions requires current to flow in both directions. The ULN2003 can only sink current. You could be VERY power wasteful and fit low R pull up resistors:eek:

If you want to stick with the ULN2003, then use it to drive a reversing relay and control the motor current with a second output. Simple.
Right, I think you've pretty much made your point, and I appreciate that :)

In your experience, what would you recommend?

Cheers
 

BeanieBots

Moderator
I'd recommend what I said. That's why I said it.
Seriously, relay to reverse connections and transistor (ULN2003) to drive motor. It's that or buy/build a proper H-Bridge.

Another option which I personally use a lot is to use Electronic Speed Controllers (ESC) from the RC world. You can then use the servo command to drive the module.
There are thousands of varieties available. Many are no bigger than your thumb nail and can drive 25A bi-directionally and for a few extra bucks (quite a few more) can drive brushless motors.
 
Last edited:

Rickharris

Senior Member
BB means the darlington driver switches the negative side of the circuit so what you are connecting needs to be between the positive supply and the darlington.

This means you can only directly drive a motor one way - i.e. your circuit won't work as you have found out.

Either use an L293 H bridge - which works well.

Or use your darlington driver to control a relay version of the h bridge as in the diagram attached.
 

Attachments

Wrenow

Senior Member
I am with BB on the ESC. They come in tons of flavors (forwards only, forwards and reverse with a nice brake delay between, forwards and reverse with no delay, programmable ramp-up soft start, etc.). Or, if the current draw is low enough an old servo's electronic guts might work for you, depending on exactly what you are wanting to do.

Basically the heavy lifting on motor controllers has been done and is available in many forms off-the-shelf. The Robotics guys and RC car, plane and boat guys have done it. Look at Pololu.com for some examples, as well as DimendionEngineering, and you local hobby store, TowerHobbies.com, hobbypeople.net, etc. You might also want to read ESC's Lessons Learned on the North Texas Battle Group (RC Model Warship Combat) site knowledgebase https://www.ntxbg.org

Cheers,

Wreno
 

marcos.placona

Senior Member
Thank you very much for the tips guys.

Looking over at the internet, I found another example that seems to be reliable and has been extensively used as far as I could see.

I'm attaching the schematics I came up with.

Can you guys tell me if there a possibility of any problem with the use of this circuit?

Thanks
 

Attachments

Rickharris

Senior Member
Unless totally strapped for cash - or in some place where getting parts is like finding gold - I would go for the L293 every time rather than build my own.

On the other hand the circuit should work.
 

tarzan

Senior Member
Will it work?

Have you checked the path that the current will take when energizing output 1 or 2?
 

BeanieBots

Moderator
I don't know which is correct but those transistors can't be both PNP & NPN:confused:

Also, if the supply to bridge is not identical to the PICAXE supply, there WILL be smoke:eek:
By far the simplest method is the relay / single tranny.
Second to that, use a custom chip eg L293D or ESC.

As a last resort and only if you have plenty of time and components to hand, and a good understanding of transistor theory, build your own.
 

Rickharris

Senior Member
Your answer suggests you don't understand how the circuit works. If so waiting for a L293 will be safer.

IF you switch on both transistors on either side you create a direct short between supply and ground - Good by transistors.

The L293 is protected against such an event - your circuit isn't - although it will work as long as only one input is on at a time.
 

jodicalhon

New Member
Hi Marcos,

The h-bridge circuit you posted has an error. Both the right-hand-side transistors are drawn upside down. They are in the right place, but upside down. The right-hand-side should be exactly the same as the left-hand-side.

This simple circuit is ok for driving small motors, BUT:

1.The supply voltage for the h-bridge and the picaxe must be the same - as BB said.

2.If the inputs are left floating, as will happen when you are programming the picaxe, all transistors will turn on, and disaster will ensue. A way around this is to remove power to the h-bridge while programming, but it's easy to forget!

The L293D is a much safer bet, as is the relay technique suggested by Rick Harris. The L293D is much less mucking around, too, being a single chip.

Rick even has a technique for full control of the L293D using just 3 pins of the 08M, which leaves 2 pins for input.

I'll see if I can find the link.

Here 'tis:
http://www.picaxeforum.co.uk/showthread.php?t=8425

If you do decide to 'roll your own', you will need gruntier transistors to run your 300mA+ motor. BC337 and BC327 spring to mind.
 
Last edited:
Top