PIC and Transistor

Guest
Basically what I want to do is use the output pins of my PIC to
activate some transistors. If i understand correctly, activating a PIC
pin essentially grounds it, so an NPN won't work. I am assuming then I
need to use a PNP, so when it is grounded, it activates the "switch".

Now, does it matter what is going through the collector and emitter? I
would like to have a Positive voltage sitting on one side of the
transistor, and the other side of the transistor would go to an ECU in
a vehicle. Under most circumstances, the transistor will be ungrounded,
which should mean that there is no flow through the transistor, and no
signal to the ECU (that is what I want). When instructed, the PIC will
ground the base, allowing current to flow through the transistor and
sending the positive signal from the other side of the transistor to
travel to the ECU. Basically it is -
http://wotid.com/tls/images/ssatre/transistor_tre.jpg - but the
transistor would be activated by a PIC.
Maybe I am missing something, but I cannot get this work no matter
which I use PNP, or NPN.
Is anyone able to shed some light on this for me?
 
b.clarke@persona.ca wrote:
Basically what I want to do is use the output pins of my PIC to
activate some transistors. If i understand correctly, activating a PIC
pin essentially grounds it, so an NPN won't work. I am assuming then I
need to use a PNP, so when it is grounded, it activates the "switch".
Which PIC are you using? In most cases making a PIC pin an output pin by
clearing a corresponding bit in TRIS register and then setting that pin
to 1 makes voltage appear on the that pin. On some PICs though, like the
very common 16F84 and I am guessing other 16 series chips, pin RA4 is
more like you understand it, an open drain output so if you make it an
output by clearing TRISA:4 then set RA4 to zero, it will ground whatever
is connected to it.

Now, does it matter what is going through the collector and emitter? I
It does. Collector goes to the positive side of the circuit.

would like to have a Positive voltage sitting on one side of the
transistor, and the other side of the transistor would go to an ECU in
a vehicle. Under most circumstances, the transistor will be ungrounded,
which should mean that there is no flow through the transistor, and no
signal to the ECU (that is what I want). When instructed, the PIC will
ground the base, allowing current to flow through the transistor and
sending the positive signal from the other side of the transistor to
travel to the ECU. Basically it is -
http://wotid.com/tls/images/ssatre/transistor_tre.jpg - but the
transistor would be activated by a PIC.
Maybe I am missing something, but I cannot get this work no matter
which I use PNP, or NPN.
Is anyone able to shed some light on this for me?
Notice that in the diagram you have given the link to, the transistor
sits between the ECU and the ground, not between the positive rail and
the ECU like you are saying which is quite different. You should
probably stick to that arrangement rather than having the transistor
between the positive rail and the ECU because if ECU is a high impedance
load, the emitter of the transistor will be close to the positive rail
voltage and that might create some unwanted side effects because a
transistor needs voltage difference of 0.6V between base and emitter to
switch. If you switch the transistor on with 5V on a PIC pin and the
emitter is sitting on 4.9V because voltage drop across the ECU is 4.9V,
then the voltage across base and emitter is around 0.1, maybe the
transistor will switch right off again?

Eugene.
 
On 28 Feb 2006 05:22:47 -0800, b.clarke@persona.ca wrote:

Basically what I want to do is use the output pins of my PIC to
activate some transistors. If i understand correctly, activating a PIC
pin essentially grounds it, so an NPN won't work. I am assuming then I
need to use a PNP, so when it is grounded, it activates the "switch".

Now, does it matter what is going through the collector and emitter? I
would like to have a Positive voltage sitting on one side of the
transistor, and the other side of the transistor would go to an ECU in
a vehicle. Under most circumstances, the transistor will be ungrounded,
which should mean that there is no flow through the transistor, and no
signal to the ECU (that is what I want). When instructed, the PIC will
ground the base, allowing current to flow through the transistor and
sending the positive signal from the other side of the transistor to
travel to the ECU. Basically it is -
http://wotid.com/tls/images/ssatre/transistor_tre.jpg - but the
transistor would be activated by a PIC.
Maybe I am missing something, but I cannot get this work no matter
which I use PNP, or NPN.
Is anyone able to shed some light on this for me?
Put a resistor (10k) between the transistor base and the PIC output.
Then put another resistor (22k) between the PIC output and the 12v
rail. For added safety put a 5.1v zener diode between the PIC output
and ground.

Use a NPN transistor. Ground the emitter. Collector to ECU.

HTH

Alan

--
Sell your surplus electronic components at
http://ozcomponents.com
Search or browse for that IC, capacitor,
crystal or other component you need.
 
look up "tristate"
maybe you dont need a transistor, what is the load?

<b.clarke@persona.ca> wrote in message
news:1141132967.091449.239070@i40g2000cwc.googlegroups.com...
: Basically what I want to do is use the output pins of my PIC to
: activate some transistors. If i understand correctly, activating a PIC
: pin essentially grounds it, so an NPN won't work. I am assuming then I
: need to use a PNP, so when it is grounded, it activates the "switch".
:
: Now, does it matter what is going through the collector and emitter? I
: would like to have a Positive voltage sitting on one side of the
: transistor, and the other side of the transistor would go to an ECU in
: a vehicle. Under most circumstances, the transistor will be
ungrounded,
: which should mean that there is no flow through the transistor, and no
: signal to the ECU (that is what I want). When instructed, the PIC will
: ground the base, allowing current to flow through the transistor and
: sending the positive signal from the other side of the transistor to
: travel to the ECU. Basically it is -
: http://wotid.com/tls/images/ssatre/transistor_tre.jpg - but the
: transistor would be activated by a PIC.
: Maybe I am missing something, but I cannot get this work no matter
: which I use PNP, or NPN.
: Is anyone able to shed some light on this for me?
:
 

Welcome to EDABoard.com

Sponsor

Back
Top