Shop OBEX P1 Docs P2 Docs Learn Events
PNP switching transistor — Parallax Forums

PNP switching transistor

charlieknoxcharlieknox Posts: 27
edited 2008-12-17 14:31 in BASIC Stamp
I'm using 4 outputs from a Basic Stamp to control 14 outputs (turning on/off 24 volt pneumatic valve ports)through a 74LS154 demultiplexer chip.· The chip has a low output signal for the active output.· I am trying to use a 2N3906 PNP transistor to switch the 24 volt pneumatic valve solenoid on and off.· I have a common ground for the Stamp, demultiplexer, and pneumatic valve.· I have a 1Kohm resistor (tried a 10K, too) from the demultiplexer output pin to the base of the 2N3906.· I have the emitter of the transistor hooked to +24v.· I have the pneumatic valve + hooked to the transistor collector, and the pneumatic valve - hooked to the common ground.· The poneumatic valve comes on under all output conditions, high or low.· I used an LED & resistor in place of the pneumatic valve, with the same results.· Any ideas?· I suppose I could use inverters between the demultiplexer and 2N3904 (or 2N222A) NPN transistors, but I had hoped this arrangement could work.

Thanks much in advance for any advice you can offer.

Regards,

Charlie

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-12-16 00:21
    As NPN is "on" when its base is more positive than its emitter, PNP is "on" when its base is more negative than its emitter.· Either way, 0V and 5V are both far more negative than emitter potential and·that's why it's always on.·

    So, PNP is·not going to turn off till its base gets somewhere near emitter potential.
  • willy1067willy1067 Posts: 107
    edited 2008-12-16 00:22
    I did one of this projects before... see if it helps

    http://forums.parallax.com/showthread.php?p=641605









    http://Pinellas-sign-manufacturer.com



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fernando Gomez


    Never compare yourself with anyone else, there will always be someone bigger·or·smaller·than you.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-16 01:04
    It's easy to see why it doesn't work, if you describe it correctly. Consider:

    The emitter is at +24v, always.

    The base is at +0 or +5 volts, approximately, through a resistor from the chip output, always. Neither of these will turn the transistor off.

    I'd use a couple of ULN2803A arrays to drive the relays, if the relay current is within its capability (quite likely). You'll also need inverters between the multiplexer and the ULN2803As unless you can find a multiplexer that drives the selected output high (instead of driving it low).

    Alternatively, you could use two 8-bit serial-in, parallel-out shift registers, 74164 for example. Shift two bytes in and your new pattern can have one high and the others low, or vice versa, or any other pattern you want. You'll still need the ULN2803A, but you won't need inverters, and you can have more than one valve actuated at a time if you like. Also you can do it with fewer than four outputs from the microprocessor. You probably won't need to latch the data, because you can shift 16 bits into a pair of cascaded 74164s in less than a microsecond. If your valves move too fast for that, you'll have to use latching buffers between the 74164s and the ULN2803As -- but a valve that would move in a microsecond would be a mighty fast valve.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-16 04:15
    In lieu of latching buffers, you could also use a latching shift register, like the 74HC595, which Parallax sells. Better still, would be the TI TPIC6595, which includes the latching shift register and high-current/high-voltage drivers.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 12/16/2008 4:21:59 AM GMT
  • charlieknoxcharlieknox Posts: 27
    edited 2008-12-16 04:17
    Thanks for the input, folks.· Any reason using 3 hex inverters with NPN transistors would not work?· I always seem to get in trouble using PNP transistors.· Apparently they are not as versatile as NPN.· Would P-type Mosfets work, in place of the PNP bipolars?

    Regards,

    Charlie
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-16 04:22
    PMOS FETs will suffer the same fate as bipolars in your circuit. The inverter+NPN idea will work, but it's not the simplest approach, as was pointed out above.

    -Phil
  • charlieknoxcharlieknox Posts: 27
    edited 2008-12-16 04:42
    Phil - I'm not familiar with the 74HC595, or the TI chip referred to.· Am I correct in assuming that they would replace the 74LS154 AND the switching transistors (and inverters, if used)?· That would definitely be simpler.· If not, I would think using a hex and an octal inverter chips, and switching to the 2N3904 or 2N2222 NPN transistors would do the job relatively simply (still using the 74LS154), too.· If so, the good news is that I've·GOT all those, but would need to order the 595 or TI chip.· The pneumatic valves are only on one at a time, and for a very short duration.· I do, however, appreciate the insight.

    Can you describe a bit, what would be needed, beyond the Stamp output (serial, apparently, so only 1 pin ??), and how it would work, if I DID use the 595 or TI chip.· I'm switching 14 outputs, so apparently would need two of either of those chips.· I'm not up to speed on the shift register chips, and how they work, but it sounds like I should check them out !!

    Thanks again.

    Charlie
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-16 09:05
    The 74HC595 would replace the 74LS154 and inverters, but not the transistors. The TI chip replaces the transistors, too, assuming it can handle the valve currents. (Check the datasheet.) It's like a 74HC595 with high-current drivers. Also, since your valves are inductive loads, you will need a protection diode across the leads to each one.

    In either case, you would need a shift clock, a data line, and a latch clock (3-pins). The two '595s or TI chips can be daisy-chained to form a 16-bit shift register.

    -Phil
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-12-16 12:08
    charlieknox said...
    ...·using PNP transistors.· Apparently they are not as versatile as NPN.
    PNPs are·no less "versatile" than·NPNs, but sometimes·a person's willingness to think about them·is not.
    ·
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-16 17:50
    PJ Allen said...
    PNPs are no less "versatile" than NPNs, ...
    That's not entirely true. For one thing, PNP's carriers (holes) have less mobility than NPN's (electrons), which has an effect on speed and current capability. Secondly, NPNs, by themselves, can drive loads whose voltage requirements extend above Vdd. This would only be possible with PNPs in positive-ground systems. On the whole, high-side switching is more complicated than low-side switching, making the latter a better choice when it's an acceptable option.

    -Phil
  • metron9metron9 Posts: 1,100
    edited 2008-12-16 18:41
    You can also source or sink up to 200mA with a 555 timer by using the reset pin as the on/off switch no need to use the timing part of the chip.

    Oops, only 16V though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!

    Post Edited (metron9) : 12/16/2008 9:15:57 PM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-12-16 20:06
    charlieknox said...

    Thanks for the input, folks.· Any reason using 3 hex inverters with NPN transistors would not work?· I always seem to get in trouble using PNP transistors.· Apparently they are not as versatile as NPN.· Would P-type Mosfets work, in place of the PNP bipolars?

    Regards,

    Charlie

    Three hex inverters and NPNs should work.· PNP transistors are as versatile as NPNs, but in equivalent devices the base region usually would be thinner in a PNP because of the slightly lesser mobility of the minority carriers in the base region, which in a PNP are holes instead of electrons as they are in an NPN.· That's of interest to the designer of the transistor, I guess, but not to me as an engineer who uses them.

    The reason your original design didn't work was that both collector and emitter of the switching device (the PNP) were at voltages (about·-24v)·far outside the range in which the control signal varied (0-5v).· The same would be true of FETs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-12-16 23:17
    gimmeabreak.jpg
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-16 23:36
    You can certainly add an NPN mediator to get the PNP to switch properly, as the above schematic shows. What I meant by using PNPs "by themselves" was "without the help of an auxilliary transistor", which is only possible with a PNP in a positive ground system:

    attachment.php?attachmentid=57383

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 12/16/2008 11:43:43 PM GMT
    273 x 240 - 2K
  • GeekgirlGeekgirl Posts: 50
    edited 2008-12-16 23:36
    With the insurgence of microprocessor control of automotive functions, there·is a nice range of High Side Drivers with logic level control that can do 24V perfectly. Most feature protected outputs allowing them to directly drive inductive loads.

    Take a look at this one, it should do just what you want about as simple and reliably as it can·be done:

    http://www.st.com/stonline/products/literature/ds/1093.pdf



    Darlene·
  • Beau SchwabeBeau Schwabe Posts: 6,563
    edited 2008-12-17 01:10
    A million and one ways to skin a cat....·
    ·
    What I haven’t seen mentioned·is the potential substrate diode damage that can occur when using only a PNP transistor with a voltage higher than the microprocessors voltage.
    ·
    PJ’s method will work just fine, but I prefer that the NPN is configured as an Emitter follower.· This eliminates a double stage inversion, but is only a preference, either way will work fine.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    903 x 859 - 252K
  • metron9metron9 Posts: 1,100
    edited 2008-12-17 14:31
    Adding to Geekgirls option, A similar High Side SS power relay with 4 inputs and 4 outputs.



    http://www.datasheetcatalog.org/datasheet/SGSThomsonMicroelectronics/mXywwyx.pdf


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
Sign In or Register to comment.