Go Down

Topic: PNP transistors as a switch controlled by arduino (Read 11752 times) previous topic - next topic

meee418

Jul 17, 2013, 05:29 pm Last Edit: Jul 17, 2013, 05:31 pm by meee418 Reason: 1
So my basic circuit is a PNP transistor with  6V (battery) on the emitter, a digital pin on the base and then two 1k resistors between the collector and ground. It seems that when I put the pin to LOW, nothing really changes, but when I unplug it entirely the transistor works as expected. This is to check the battery's voltage without having it constantly discharging.

Some notes:
I am literally on an island and in a time crunch, so buying new parts is almost impossible (otherwise I would just use megaohm resistors and call the discharge negligible). Please let me know what I am doing wrong.

Edit: when using PIN 13, the light stays on indefinitely whenever the base is plugged in.

KeithRB

What voltage is on the base when you pull the pin LOW. Are there any other resistors in the base circuit?

alnath


So my basic circuit is a PNP transistor with  6V (battery) on the emitter, a digital pin on the base and then two 1k resistors between the collector and ground. It seems that when I put the pin to LOW, nothing really changes, but when I unplug it entirely the transistor works as expected. This is to check the battery's voltage without having it constantly discharging.




you didn't put a resistor between the base and the digital pin, and no resistor between the emitter and +6V ??
:smiley-eek:

meee418

DOH. yeah, adding another resistor between the 6V and the emitter works...  :smiley-mr-green: Thank you so much!

so now my circuit is:

+6V ----1K-----C     B      E-----1K---Analog Read---1K-----Gnd
                           |
                           1k
                           |
                      Digital Pin


since the battery voltage will be changing, is there any way to know if it's a fraction of the total voltage? or a "good guess" (+ or - .5 Volts)?

pwillard

Drawings, even bad ones,  are better than text.

Here is what I hear you saying... but I would say... there is a bit of a problem here...

To start with...  A PNP turns on when you set a digital pin "low"... but where is your base resistor to control current to the base pin?

[edit]  Ok, I see that question has been dealt with...

pwillard

#5
Jul 17, 2013, 05:57 pm Last Edit: Jul 17, 2013, 06:08 pm by pwillard Reason: 1
So, here is a an updated drawing we can discuss.

My final thought was that you had no "load" per se... but that was discussed while I was drawing.

EDIT: Updated drawing

alnath

#6
Jul 17, 2013, 06:00 pm Last Edit: Jul 17, 2013, 06:07 pm by alnath Reason: 1
what is your transistor ?

You didn't send your schematics, but if it is done as I imagine it to be, you should mesure :
0v on the collector wgen the digital pin is high (transistor Off)  
and almost 6V when the pin is low (transistor ON)

But a 1k resistor gives only 5mA base current, it is too low to get the transistor saturated, try with
lower value of Rbase . Ib values depends on the transistor characteristics .
Look at the datasheet, find VceSat at Ib=xxxmA Ic=yyymA then you'll have the Ib needed.

Edit : OK I wrote this while you were sending your schematics, sorry  ;)


pwillard

well, that we ME trying to draw for the OP... I could be way wrong here...  and a 1k (5ma) is usually just fine for a small signal transistor with 150-300 gain)  If he's using a PNP power transistor, I agree with you.

meee418

I attached a modified drawing of the circuit, you were missing a single resistor between 6V and the collector. Also good to know about PNP being LOW to be "on" I've only ever worked with NPN and bought these by accident   :smiley-red:. This resistor issue actually throws a lot of my project into question... much of it involves reading voltages across .3 ohm resistors. I am going to have lunch and then upload another question about PNP switching involving the rest of my circuit. Don't worry I'll draw it this time  ;)

pwillard

My trick to remember "what makes a transistor switch" is, the middle letter.  "ON" is: for NPN - A more Positive voltage than the Emitter,   for PNP - a more Negative voltage than the Emitter.

alnath

OK, I see....
You can get rid of the emitter resistor, make Rbase lower (look at the datasheet for Ib )
the value on the analog input will be : (Vbatt-VceSat)/2  , given the equal 1k resistors that makes the divider .
Should work...if you don't let the battery discharge too much  ;)

meee418

Here is my charging circuit for a battery, NOW I am going to lunch. Please give me critiques on whether you think it will work or not.

jack wp

Don't use pin 13 ! On most boards pin13 is attached to an  LED onboard, and will make the voltage on the base of the transistor different than you expect.  Use any other data pin

Good luck.

alnath


well, that we ME trying to draw for the OP... I could be way wrong here...  and a 1k (5ma) is usually just fine for a small signal transistor with 150-300 gain)  If he's using a PNP power transistor, I agree with you.

Look at the datasheet of 2n2907A (ok, not the best switching tr, but widely used) :

Vce(Sat)  Ic=150mA Ib=15mA   0,4V
Vce(Sat)  Ic=500mA Ib=50ma    1,6V

If I used this transistor, I would change the values of the two collector resistors to have an Ic sat value of 150mA , and I would use a Rbase to get Ib=15mA -
Then I think OP should read the datasheet and use the values to calculate the needed resistors.

alnath

#14
Jul 17, 2013, 06:29 pm Last Edit: Jul 17, 2013, 06:37 pm by alnath Reason: 1

Here is my charging circuit for a battery, NOW I am going to lunch. Please give me critiques on whether you think it will work or not.


oups, I think I'm goiing to lunch too...I'll tell you later on, if nobody has answered in the meanwhile  ;)

but you could redraw your schematics, with the transistor name, where is the emitter... etc...
and maybe tell us approximately how you want it to work. Why use all these Ax inputs ?

Go Up