Elia said:
I am trying to drive a 9vdc motor using a pic microcontroller. I build
the h-bridge but it is not working.
The problem is that :
The transistor is functioning more or less as a relay . So this
diagram should output 9v . Instead I get a 3 vdc .
Can you tell me why ?
+9vdc
|
collector
/
+5-----base|< [tip122]
\
emitter
|
|
|
ground
thanks .
This is a supplement to other answers. NPN transistors will,
generally, try to keep the emitter at about 0.7V below the base if
they can. The TIP122 is a darlington NPN transistor, so there are
actually two NPN transistors in there, and so the drop will be
something like 2 times 0.7 or 1.4V.
One way to overcome this would be to connect your load between the
collector and 9V. Use a 1000 ohm resistor between the PIC and the base
of the transistor. Then, when you output 5V, it will turn on the
transistor, and allow current to flow through your load. When you drop
the output to 0V, it will turn off the transistor, and cut off current
through your load.
To make an H-bridge out of these, you need complimentary PNP
transistors for the 'high side'. The complimentary PNP transistor is
the TIP127.
In order to use those NPN and PNP transistors, you have to ensure that
your base voltage is properly biased. If you just hook up the bases,
current will flow through them in a 'bad' way. That means resistors,
etc. You can do it, but its much easier with MOSFETs, which have
practically no gate current. Additionally, the voltage drop across the
devices will be less for good MOSFETs, so the heat generated by the
devices will also be less. Here is a simple circuit which you might
use as the basis of a design.
VCC
+
|
+-----+------+
| |
| | P-MOSFET
+--||-+ +-||--+
| ||-> <-|| |
| ||-+ LOAD +-|| |
|\ |\ | | .----. | |
CTL -| >O-+-| >O--+ +---| |---+ +--+
|/ | |/ | | '----' | | |
| | | | | |
| | ||-+ +-|| | |
| | ||<- ->|| | |
| +--||-+ +-||--+ |
| N-MOSFET | | |
| | | |
| +-----+------+ |
| | |
| === |
| GND |
| |
+-----------------------------------+
created by Andy´s ASCII-Circuit v1.24.140803 Beta
www.tech-chat.de
When CTL is high, the right gate voltages will be low, so the upper
right P-MOSFET will be on and the lower N-MOSFET will be off. Also,
the left gate voltages will be high, due to the inverter, so the lower
left N-MOSFET will be on, and the upper P-MOSFET will be off. Thus,
the current will flow through the load from right to left.
When CTL is low, the converse is true, that is, current flows through
the load from left to right.
Note that there are H-BRIDGE chips which do more than just gate
current. They also ensure that there is never current flowing through
both the top and bottom transistors on one side by using a delay.
Also, they usually feature enables, and other cool features, along
with a nice package to fasten to your heatsink.
One chip I've used for this is an S754410, called a 'Quadruple 1/2 H',
and features tristate outputs, and will do an amp per driver. It
protects against glitches on power up (which is a good thing), and
interlocks output channels so you don't have to worry about both sides
of your H conducting. It also allows split voltages, so you can
control it with logic levels of 5V from your PIC, while using higher
voltage power output levels.
For beefier apps, another chip is the venerable L298, which will
support up to 4A.
For low current applications, these may be a better buy. If you are
doing 20A, then I think you'll have to roll your own.
Regards,
Bob Monsen