Let's Make Robots!

H bridge

Hi, can someone please tell me what is wrong here. I have attached my schematic as pdf. All the line are physical connections on my pcb. The right tip127 gets hot when I allow current to flow.    

h_bridge_1.pdf17.84 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I see what you mean with the opto isolator, its just I have not changed the naming of the program I use. I use the PIC817A opto’s. They have a forward voltage of max 3V. If I make a voltage drop with resistors from a 1K and 2.2K then I get 3.33V, believe it or not but I have tried it and .33 V more was too much for the led. So now I made a double voltage drop down to 1.15V by connecting the opto to the rail between the 2.2K and the 1K that leads to ground. The PIC817A has a forward voltage of 1.4V and peak forward of 3 volt. So I am rather sure than 1.56 mA at 1.15V is sufficient to meet the collector emitter VCE(sat) that is actually just 0.2V.. And the opto does not get damaged and it open up just great, I have measured the collector emitter voltage when 1.15V is applied the led and 12V if defiantly flowing.  I will see I f I can get my hands on some bigger resistors.


OK, I understand what you are trying to do. You are making it more complicated than it needs to be. Even though the optoisolators are working, you may want to consider revisiting that part of your design. I think you are misunderstanding how to use the forward voltage drop and max forward current ratings.

This post by OddBot does a great job of explaining it. Even though it is for regular LEDs, the same thing applies for the LED inside your optoisolator. Take the time to read and understand this, and you will improve your understanding of LEDs a great deal. There is absolutely no need to form a votage divider to try to get 1.4 volts to your LED.

The PC817 photocoupler you are using has a forward voltage of 1.4. What this means is the LED portion will try to drop 1.4V, even if you put 12V across it. However, without a resitor to limit the current, this will blow up your LED. What you do is use the forward voltage rating and the current you want (staying below the maximum forward current rating) to calculate the resistor you need in series with the LED. Subtract the forward voltage of the LED from the supply voltage you are using.

Vsupply - Vforward = Vresistor

12V - 1.4V = 10.6V

Calculate the Resistor you need based on the desired forward current (Iforward). I'll show the calculation for 10mA and 20mA. If 10mA works, then that's great. If you need more current to cause the photocoupler to work, try reducing the the resistor value closer the the calculation for 20mA. Don't exceed 50mA through your LED, or you may be off to buy a new one.

Vresistor / Iforward = Rohms

10.6V / 0.01A = 1060 ohms (1000 ohms will do fine)

10.6V / 0.02A = 530 ohms (560 ohms will do fine, you won't find a 530 ohm resistor)

I hope this give you a hand.


This is exactly as my pcb schematic. Please do note that my opto isolators do not have a base. So i ignore base connection. I have 10k resistors, will make a new schematic and try it. But I need to know that it is as wright as possible before I use any materials.

I don’t have a lot and I live in a town that you can literally walk from one side to the other under 45min. so If something goes wrong I have to order new stuff. And that can take some time.

Thank you for the help.


If this is your first stab at a discrete H-bridge I might advise you to take a step back and try driving the load with a single low side NPN with motor between collector and voltage supply.  If that doesn't work then maybe your driver configuration needs attention.  If it does work add a PNP high side transistor (half the bridge) to also drive the motor a single direction.  If that works then the full bridge should also work.  I've found that troubleshooting a full cricuit can be much more difficult than testing individual sections.

Happy troubleshooting...

OK. I get that your optoisolators don't need a base connection. You've made that clear.

Let us know if the pull-up and pull-down resistors work out. If this solves your hot TIP127 problem, that'll be great. If it does not, you still need to track that down before proceeding further.

I'm still very confused about your arrangement of resistors around the LEDs and optoisolators.

  • Top-right LED's path to ground would seem to be through the internal LED of your optoisolator. Is that just an error in your drawing?
  • I really don't get your choice of resistors. I would do it like shown below.



The resistor values on the LED and optoisolator LED don't have to be those shown exactly. The datasheet for the 4n25 opto specfies 10mA for the internal LED, with a 1.5 volt maximum forward voltage drop. Your 5V microcontroller output, minus the 1.5V drop, divided by  560 ohms gives you 6.25mA, which might be enough. You could reduce the value down to 360 ohms to get the full 10mA if needed.

Adjusting the value of the resistor for the external LED will adjust its brightness. The value of 330 ohms shown above is a good place to start. It depends on the forward voltage drop of your LED.

I've shown just a portion of the h-bridge (just one transistor) to give you an idea of the pull-up resistor. The base of the PNP transistor is pulled up weakly through the 10k resisitor. When the optoisolator is turned on, the base of the PNP is pulled strongly towards ground. 10k is a common value used for pullup and pulldown resistors at 5V logic. With a 12V supply, this will actually pull about 1mA through the pullup resistor. You may want to increase the value to 47k, to reduce the current drain. It should still work with 10k, but wastes a bit of current.

I hope this is helpful. Good luck.

If your right TIP127 is still getting hot with no current applied to any transistor base, something is clearly wrong. You may have a short circuit somewhere. Is this all built on a breadboard or soldered on a protoboard or what? Maybe a clear, focused picture of your actual circuit would be helpful.

If the right TIP127 gets hot and the left one doesn't, this supports the idea that there is a short. The circuit is symetical, so why does one get hot and the other doesn't? You need to fix this before proceeding to fix the rest of your circuit. I have more notes on what else is wrong below.

I'm not sure about how you have your optoisolators connected. Maybe your schematic is just incomplete, but there seems to be a lot of unconnected pins. I see other problems with the circuit as diagrammed too. I don't know if it is a problem with your schematic or if you actually built your circuit this way.

  • Both optoisolators on the right have nothing connected to the LED cathodes.
  • The optoisolator LEDs should have a smaller current limiting resistor (You need about 10mA current, but if your micro puts out 5V on it's output you will bet getting only about 1mA with the 3200 ohms of resistance on each LED.)
  • You have separate LEDs (as indicators, I guess) on the optoisolators. The two on the right are shown upside down. The 1000 ohm resistors on these LEDs will probably have them running pretty dimly. Also check the max current output of your micro per pin. Make sure you are not exceeding what it can put out to supply both the optoisolator LED and the external LED.
  • I don't get the arrangement of resistors around your optoisolators at all.I'm not sure what the bottom 1000 ohm resistor does at all.
  • The transistor output of your optoisolators should have pull-up resistors on the PNP TIP127s. 10kohms should do nicely. You want to pull the base of the TIP127s high when their optoisolators are off. It is possible that the base of your TIP127s are being pulled low enough to turn on, even when you don't turn the optoisolator on.
  • The transistor output of your optoisolators should have pull-down resistors on the NPN TIP120s. You want to pull the base of the TIP120s low when their optoisolators are off. You may want a 1000 ohm current limiting resistor between the 12V supply and the collecctor of the optoisolator transistor output, to limit the base current.

Thanks man, here it is. Hope everything is clear to you. Only one note. The opto isolators I am using do not have a base.


Try grounding the emitters of your NPN transistors on the H-bridge.  In other words, the bottom right and bottom left transistors should swap emitter and collector terminal connections.

This basic H-bridge layout is a good description.  Have you tried using just an NPN to do single direction PWM speed control?  This is a simple circuit with the base connected to PWM output of a micro, emitter grounded, and motor between Vcc and collector.  If you have an oscilloscope you will see how much noise and kickback voltage is across the motor, thats what the capacitor and diodes will help suppress.  I use a 0.1uF 50V nonpolarized capacitor in parallel with the motor, which can be soldered across the motor leads.


The separate post is because I have changed my schematic.  The motor does not turn, even if I have no current on any base of any transistor then that tip127 still gets hot when I switch on the power supply. I will post a new topic with the entire schematic. Perhaps then you guys will have a better idea of what is going on. Or if someone can tell me how to upload the updated schematic here then I will do so.