I use this for motor driver:
![]()
I use this for motor driver:
![]()
Thanks you..
Hi,
Regarding your first schematic, generally you need to put the transistor on the low side. Otherwise you need a higher voltage on the base than you've got on the collector. Put the relay "on top", then on to the motor and finally the transistor at the bottom, emitter to ground. Yes, the motor is biderectional but the current thru the transistor is always the same so put the diode back across is, cathode facing "up" of course.
/Henrik.
Quick questions guys, I've been developing the hardware further and need to swap the 2930 transistor for something more powerful for driving the 540 type motor. I have a TIP126 PNP darlington, which works, but with reverse logic on the base. IE instead of turning on when the base is high it's high when the pic pin is low. I could change the code so that the output is constantly high and goes low when the conditions are met, but was wondering if there was a simple way of making the transistor fire with a positive voltage on its base ?
If you don't want to change your code, what if you add a small NPN transistor to the base of the PNP?
Connect the NPN to GND instead of VDD (all sounds plausible in my head).
Robert
Yeah, there's no way to change the actual transistor (obviously) so what you need to do is invert the signal which you can do by adding a NPN transistor "in front" of the PNP like Robert says.
Previously I said to put the transistor on the low side but that was when you used a NPN transistor. Now, with a PNP "serviced" by a NPN you'll be better of putting on the high side. It will work with the PNP on the low side as well but only as long the voltage feeding the motor isn't higher than the voltage used to drive the transistors (ie the voltage feeding the PIC) + around 1V for a Darlington. Also, remember that the voltage drop across a Darlington transistor is higher than across a "normal" BJT.
You need to remember that ordinary transistors (BJTs or Bipolar Junction Transistor) are operating on current. Ie, for a NPN transistor we push a certain current into the base which gets "amplified" by the gain of the transistor and "pulled down into" the collector. The base basically behaves as diode connected to the emitter so there will be a voltage drop across it of ~0.6V (for a silicon device) as with any diode. So, IF you put a NPN transistor on the high side of the load with the collector connected to, say 12V, you basically need a voltage of 12.6V in order to be able to "push" current into the base. If you try to push current into the base using 5V the transistor will only partly open (ie it'll operate in its linear region) and it'll disipate a lot of heat. This is what's done in linear amplifiers etc but not what you want when using the transistor as a switch.
OK, so what if we put that NPN on the low side of the load (motor). Now, the emitter is connected to ground so there's plenty of headroom in using 5V to push current into the base and it'll work just fine provided you use a sensible value for the base resistor.
Then you decide to change to a PNP transistor.....
The PNP transistor is "operated" by "pulling" a current out thru the base (as oposed to driving current into the base for a NPN). So, if you put the PNP on the low side of the load its emitter (which is now connected to the load) will "see" the full supply voltage when the transistor is OFF. So, in order to keep the transistor OFF no current can be allowed to flow down thru its emitter and out of the base, right? In order to prevent that from happening the voltage at the base needs to be atleast the same as the voltage feeding the load less one diode drop (or two for a Darlington). If the powersupply voltage is 12V and you're driving that low side PNP with 5V from a PIC it will never turn off completely.
Putting your Darlington PNP on the high side of the load with a small NPN to "pull" current thru the Darlingtons base to ground (thru a resistor of course) is the right way to do it given those particular circumstances.
/Henrik.
Henrik,
Thanks for the explanation. And yes I did find the motor would not actually stop running, it would shut off, then slowly start up again, gradually increasing in speed.
If I've followed your post correctly, and followed the schematic provided by Pedja, would the attached work (using say a 2n3904 and a 1K base resistor) - Note that the motor supply is using 6v with the PIC running at 5v (and I've noticed I've omitted the diode across the relay -Doh !)
Rob,
I'll opt for changing the code... it's only a matter of changing half a dozen lines from how to high
But thanks for the input
Bookmarks