Dual Y-Bridge (was One and a Half H-Bridge)

I had an idea tonight that is either inspired... or stupid. Please help me determine which. ; j

I was thinking about using one of my new Picaxe-08 processors for a project. They only have 5 I/O ports, three of which can be either an input or an output. However, for my project, I wanted to be able to control two motors and two sensors. Since traditional dual H-Bridge designs would require four processor outputs to control two motors with forward and reverse, that would leave only one I/O port left. Boo hoo.

I began to wonder if there was a way to control two motors in forward and reverse with only three outputs. I first thought of a simple Y-shaped circuit, which would have the motors sharing a common connector. After monkeying with the idea and reviewing some H-Bridge designs, here is what I came up with:


I did not bother with flyback diodes for the back EMF for now. I just want to see if the circuit would work conceptually. If so, I'll look at practical matters like that.

The logic table for this circuit is below. Note that the output at the top-right of the diagram is an inverted copy of Output 3.


If I haven't overlooked something, this circuit would allow a robot with two motors to drive forward, reverse, spin left, spin right, or reverse to one side. The bottom two logic input settings would result in a condition where two or more transistors in the same leg of the circuit would short out power to ground, and should be avoided.

OK, folks. Fire away! What did I miss?


Based on Telefox's modification, I have updated the circuit diagram. I have also added base bias resistors and protection diodes.


Here's the logic table for the circuit.


I decided to call this circuit a "dual Y-Bridge". One "Y" is turned on when you enable the "Reverse" line. The other "Y" is turned on when you turn on "Forward_1" and "Forward_2".

In practical application, I'd like to add some logic to make sure the dangerous states are never applied and make this a "smoke-proof" bridge. I'd also have some noise supression capacitors on the motors.


After testing my own and Telefox's "smoke-proof" circuits, we came to the conclusion that they were not working. The good news is that the 2n2222A transistors seemed capable of surviving the short condition I was trying to protect against. Therefore I will just leave the protection circuit out.

Here are some current results for the circuit, using 4xAAA batteries as the supply.

  • One motor forward: ~130mA
  • Two motors forward: ~240mA
  • Two motors reverse: ~220mA
  • Reverse + one motor forward: ~610mA (transistor short condition)
  • Reverse + two motors forward: ~850mA (transistor short condition)

The 2n2222A transistors I used are the high current version of the 2n2222. They seem to withstand the abuse of being shorted.




Here's the Y-Bridge implemented on a Picaxe-08 Protoboard.



  • Six (6) pn2222A npn transistors
  • Six (6) 1n4454 diodes
  • Two (2) 1n4006diodes
  • Six (6) 1k ohm 1/8 watt resistors
  • Assembled Picaxe-08 Protoboard
  • Assorted wires, header pins, etc.

Although the initial layout went very well, I ended up having to get creative to provide all the contacts I needed for the motor output pins. I used cut off pieces of component lead to fit into the same contact hole as the Q1 and Q5 emitter leads. This was a pretty ugly hack, but it worked.

You can see the Y-Bridge implemented on Blind Lemon.



Hey ignoble, just one thing
Hey ignoble, just one thing you seem to have missed:
The condition where inputs 1 and 3 are both active will only rotate M1; M2 will lock up, not rotate forward as indicated by the table. Q1, Q4 and Q6 are all enabled, but current will not flow from Q1 to Q6 because Q4 gets there first and brings the voltage down to its level before it reaches the motor. Effectively Q4 and Q6 cause the motor to have the same voltage on both leads, so no current flows. It’s the reverse of the “2 & !3 = 1” condition.

Well, because I liked your

Well, because I liked your idea so much, and also because I like the minimalist approach, I did a little work on your circuit and came up with this:


First I designed a circuit using complementary NPN and PNP transistors, but I decided to make one more similar to your original NPN only circuit. As you can see I've omitted protection diodes, smoothing caps, bias resistors etc.
Once again you've got 3 inputs, 6 NPNs and 2 motors, but I think you'll find the control options a bit more convenient in this case.
• Activating "Forward" will make both motors run forward.
• Activating "Reverse_M1" makes only M1 run in reverse.
• Activating "Reverse_M2" makes only M2 run in reverse.
• Activating "Reverse_M1" and "Reverse_M2" makes both motors run in reverse.
The dangerous conditions are when "Forward" is activated at the same time as either/both of the "Reverse" inputs. Make sure to add the two diodes going to the base of Q5, otherwise either "Reverse" inputs will make both motors reverse, even when only one is active. Q2 and Q5 must be rated to take the current from both motors, but the other 4 NPNs only have to take one motors worth of current.

Thanks for taking an
Thanks for taking an interest and improving my idea! I will definitely try this out and let you know how it goes.

Yeah, I noticed that first
Yeah, I noticed that first thing this morning as I was explaining the circuit to my wife (also and electrical engineer).

This is brilliant, Telefox.

This is brilliant, Telefox. I love it.

If we swap the sense of “Forward” and “Reverse” we now have a robot that can drive in either forward or reverse, and can turn left or right. Same exact circuit, just different behavior and installation on the robot.

I’m going to do some experimenting.

Happy to be of service

Happy to be of service ignoble, glad you liked my revisions =)

You’re quite right, having 3 flavours of forward will be more useful to many bots than 3 flavours of reverse. That way you could even hold one of the forward inputs high, and PWM the other input at a low duty cycle to make the bot turn in a wide arc.

I built and tested the

I built and tested the Y-Bridge motor controller using 2n2222A NPN transistors. I was successfully able to drive a pair of the DAGU 3V gear motors (item #13 on the DAGU LMR Parts List).

The motors were pretty slow with the circuit powered by 3xAAA batteries. Driving a single motor forward, I get about 2.5V across the motor leads. When I add the second motor going forward, the voltage drops to just under 2V. In reverse (both motors), I get only about 1.75V across each motor.

Testing with 4xAAA batteries that were running a bit low (just under 6V) was a bit better. Driving a single motor forward, I get over 3.5V across the motor leads. When I add the second motor going forward, the voltage drops to about 3V. In reverse (both motors), I get 2.6V across each motor.

I guess I’m ready to move this circuit from breadboard to protoboard. Hoo hoo!

Thanks again for the guidance, Telefox.

No problem ignoble =)BTW, I
No problem ignoble =)
BTW, I have a few options regarding making the 2Y-Bridge smokeproof - let me know if you are interested. I have a project coming up that this little circuit may actually be perfect for, will keep you posted!

Yes, I’m interested! Please

Yes, I’m interested! Please feel free to suggest some smoke-proofing ideas!

I had one idea using digital logic, but that’s a lot of chips to add when the whole idea was to create a small, simple motor driver.

Smoke Proofing

My idea for smoke proofing the Y-Bridge is as follows:

I’ll build a single transistor NOT gate to invert the Reverse signal. The output is called Not_Reverse.

Build two diode-resistor logic AND gates. Each will have as its input one of the two Forward signals and the Not_Reverse signal. These logic-modified signals will be used to drive the Y-Bridge.

The Foward_1 and Forward_2 outputs from the uProcessor will be modified with some simple logic to prevent the various danger conditions. I’ll call the modified forward signals Fwd_1 and Fwd_2. Basically, I’m looking for:

Fwd_1 = Forward_1 AND Not_Reverse

Fwd_2 = Forward_2 AND Not_Reverse


The behavior driven by this modification is that if the Reverse signal goes high, the logic above will ensure that Fwd_1 and Fwd_2 are low, even if Forward_1 or Forward_2 (from the uProcessor) are high. Therefore, if I accidently or on purpose set Reverse high, the robot will back up. If it had been going forward or turning at the time, it will stop doing that and instead back up until the Reverse signal goes low again.

While it is a good idea to take it easy on the drive train by not going suddenly from forward to reverse with no stop in between, this circuit is about preventing the motor drive from smoking. I won't program for the sudden reverses on purpose.

I had a similar idea at

I had a similar idea at first, using an extra transistor or two as inverters, but then I realised there’s already 2 transistors that are essentially inverting the Reverse signal: Q4 and Q6.


When Reverse is pulled high, Q4 and Q6 pull the two Forward signals low via the extra diodes D1 and D2. R1 and R2 are just there to limit current flow and ensure the Forward signals are easily defeated.

OK. I get that when Reverse

OK. I get that when Reverse goes high, it turns on Q4 and Q6, effectively giving you a Not_Reverse signal.

Diodes D1 and D2 are meant to bring that Not_Reverse signal and override the Forward_M1 and Forward_M2 signals. However, I think D1 and D2 need to be turned around with the anodes facing the other way. The way they are installed, I don’t think it will work. I’m breadboarding now.

Oops, that’s what I get for

Oops, that’s what I get for being hasty =)
I’ve flipped the diodes over in the above diagram.

I must be missing something,

I must be missing something, because the circuit doesn’t work with the diodes reversed. The circuit seems to work the way you designed it, I just don’t quite understand how.

There is one minor weirdness. When I have M1 going forward, and then raise Reverse high, M1 stops (expected), but M2 turns on in reverse very slowly. The same is true if I am running M2 forward and apply Reverse high. If both motors are running in forward and Reverse is raised, both motors stop immediately.

This may be acceptable, since the purpose of the circuit is just to avoide smoking the transistors, and should not be applied under normal circumstance.

I’ll study your circuit a bit more, but I’d appreciate any enlightenment you can shed on why it works.

Here’ the actual circuit as

Here’ the actual circuit as built. It is working, though we don’t know why.


It turns out this circuit
It turns out this circuit does nothing to protect the transistors from a short condition. However the 2n2222A transitors seem capable of withstanding the short, so I’m not going to bother “smoke proofing”.

I have successfully moved

I have successfully moved from breadboard to a Picaxe-08 Protoboard. I was just barely able to fit the 6 transistors, 8 diodes and 6 resistors onto the board and make all the neccessary connections. I actually ran out of contacts and had to do some ugly hacks, but it all fits. I’ll probably take some pics and post a blog on it later.

I can go to bed happy. Time for sleep.

Another approach

I might be building a 08-bot in near (or far :slight_smile: future so this is an interesting topic. I thought I’ll give a try for a different approach. I’m not so sure if it’s a good one because it’s kinda “crippling” a L293D H-Bridge.

The idea is to build a logic to between 08 Picaxe and L293D. I created one logic with 6 NAND gates and another with 2 XOR gates and 4 NAND gates. Here’s what I ended up with (08 outputs/logic inputs on the left and L293D/logic outputs on the right side. Click for non-scaled image):


And here’s the logic table:


If I try to build this I'll probably try to build the logic using two 4011 quad 2 input NAND gates (DIP14 case). Of course it may get difficult to fit in two DIP14 chips if you are really running out of free space :-) But I think I have enough space anyway.

Here's a nice video of my logic simulation in KTechLab: http://www.youtube.com/watch?v=bM8HI0YTF-A


The digital logic circuits

The digital logic circuits are sound.

For my current bot, size is limited, so I wouldn’t do this, but I could be a good approach on a different bot.

Instead of crippling a nice L293D, why not just build the Y-Bridge. (OK, that’s a shameless plug to use my circult.)

Good luck!