Go Down

Topic: arduino step motor example, wiring: L293 vs. L298 (Read 3674 times) previous topic - next topic


Aug 06, 2009, 11:48 pm Last Edit: Aug 07, 2009, 12:18 am by edinfoel Reason: 1
I have a question about the wiring example "Circuit for Bipolar Stepper Motor" - http://arduino.cc/en/Reference/StepperBipolarCircuit

How can an L298 L293 drive a bipolar motor? I ask because to my understanding, it cannot reverse currents, so it can only do unipolar control - which is not useful for a 4-wired stepper. You need an L293 L298 (or similar) for bipolar output. Which sucks, because the 293 298 is clumsy, expensive, and needs external diodes.

What am I missing here?


The L293 is quite capable of reversing currents and therefore driving a bipolar stepper motor. For example, if the 1IN input is high in the wiring example you reference, then 1OUT is high. Since 1IN is high it turns on the transistor on the left side of the circuit which makes 2IN low, so 2OUT will be low.

1IN high + 2OUT low ==> current flows in one direction

Similarly, if 1IN is low, 2IN will be high:

1IN low + 2OUT high ==> current flows in the other direction


Thank you, it works like a charm. Even better, if you control EN1,2 and EN3,4 (Pins 1 and 9) you can do halfstepping with four control wires (three if you build extra logic which I didn't).

Funky Diver

Apologies for dragging this thread out of hte grave, however seemed the most pertinent thread out of the ones I've found.

In terms of wiring the 5v supplies can the 4 be wired to the same 5volt source?

I'm waiting on a couple of components, and the stepper I have is 5volt, so I assume that they can all come off the 5 Volt source on the board?

Also, in terms of running steppers, how many feasibly can be run off one Arduino before processing becomes too much.  the inputs share common earth, so each one has one input

Cheers, and apologies for the newbie question, it's my first foray into stepper motors :D


Sep 05, 2010, 01:41 pm Last Edit: Sep 05, 2010, 01:42 pm by mpeuser Reason: 1
The 5 volts are needed for control lines, they draw no current worth talking about (the 1k base resistors should be replaced by slightly higher values BTW). The both NPN transistors work as inverters, this can also be accomplished differently. The enable inputs are just enable inputs...

The number of (stepper) motors you can control from an Arduino depends on your skill of organizing the program....

Funky Diver

Sep 05, 2010, 04:33 pm Last Edit: Sep 05, 2010, 04:34 pm by Funky_Diver Reason: 1
Cool, so connect those four together on the same source.  That's one sorted.

When you say increase the value of the base, by how much and what does that do?  I'm guessing it makes it less sensitive and jittery?

And so far as "skill of the programme" I'm still starting out with Arduino after a long stint off doing not so techie things... kids, life, wife (although not in that order)


Sep 05, 2010, 05:13 pm Last Edit: Sep 05, 2010, 05:14 pm by mpeuser Reason: 1
..increase the value of the base [ resistor ]

This is not really important. With 1k there will be a waste of 4mA with each transistor. As there is no load at the collector 1/10th should be enough. So I should recommend something between 4k7 and 10k.

Thos resistors form a lowpass in connection with the base-emmitter capacitance, reducing the steepness of the switch signal. The steeper the signal, the less current is wasted in the transistor during the switch.

But I expect the H-bridge to have Schmitt trigger inputs anyway...

So ... this is not really important, and just said to increase the overall awareness for electrical matters in this forum :-)

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.

Thank you for subscribing!

via Egeo 16
Torino, 10131