Offline
Newbie
Karma: 0
Posts: 7
|
 |
« on: April 15, 2012, 09:29:30 pm » |
Arduino project. I have a breakout board and have pulled the voltage in (vin) and ground to the board. I have a transistor with emitter to ground and a PWM pin from the arduino to the base via a 10k resistor. I take my meter and go from vin to the collector.
If I am using USB as the power source, I can vary the voltage as expected. Cycling the PWM from 0 to 255 yields 0 to 4ish volts.
If I am using an external power supply (10 volts, 1000ma), I can vary the voltage, but it never goes to 0. The range is something like 2 volts to 8 volts. 8 is fine, but I need 0 on the bottom end. analogWrite(pin, 0) and digitalWrite(pin, LOW) both yield the 2 volt trickle.
The transistor I purchased at Radio Shack. It is an NPN 2222a.
Can anybody help me get 0 volts?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 3
Posts: 1713
|
 |
« Reply #1 on: April 15, 2012, 09:43:22 pm » |
I've never metered it before or tested it but since a transistor is current driven perhaps its no current flowing yet 2v from the npn junction voltage drop? maybe a mosfet would get you the 0v you need
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 6
Posts: 400
|
 |
« Reply #2 on: April 15, 2012, 09:46:09 pm » |
Do you have the ground from your 10V source tied to the ground on Arduino?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16571
Available for Design & Build services
|
 |
« Reply #3 on: April 15, 2012, 10:04:19 pm » |
You haven't described the 'load' between Vin and the collector. "I take my meter and go from vin to the collector." Take your meter and go from the collector to ground.
Use a smaller resistor to control the base, and turn the transistor on more. Vbe will be around 0.7V, so (5V - 0.7V)/20ma = 220 ohm. However, Vce across the transistor will never be much lower than ~ 1 diode voltage, ~0.7V. I think a 2n2222a needs 50mA to drive it full on with a 150mA load.
If you want lower, you need a N-channel MOSFET with a low Rds. Then the voltage will be current * Rds. If Rds is like 50mOhm, the voltage will be quite low. But never 0.
|
|
|
|
|
Logged
|
|
|
|
|
Canada
Offline
Sr. Member
Karma: 3
Posts: 391
|
 |
« Reply #4 on: April 16, 2012, 08:47:09 pm » |
For a 2N2222A at IC=150 ma the VCE should be less than .3V, typically I find they often go lower than 0.2V.
Also, at IC=150ma, gain is greater than 100, so you can easily drive it well into saturation with IBE @ 10-15 ma.
What are you trying to drive with this?
|
|
|
|
« Last Edit: April 16, 2012, 08:49:12 pm by BillO »
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 73
Posts: 6631
Arduino rocks
|
 |
« Reply #5 on: April 17, 2012, 12:35:48 pm » |
I'm not sure the OP has a load other than the voltmeter - that would explain the apparent problem.
|
|
|
|
|
Logged
|
|
|
|
|
Canada
Offline
Sr. Member
Karma: 3
Posts: 391
|
 |
« Reply #6 on: April 17, 2012, 01:59:39 pm » |
Okay, method 1.
Have a look at the attached circuit.
Select R2 for the required ILoad.
Then select R1 = 10 x R2 x (VPWM - VBE) / (V+ - VCE sat)
Given that VPWM=4.2V, V+ = 10V, VBE=0.7V, VCE sat=0.2V then:
R1 = R2 x 3.6, ...give or take...
And remember, this circuit will invert the PWM signal.
|
|
|
|
« Last Edit: April 17, 2012, 02:06:34 pm by BillO »
|
Logged
|
|
|
|
|
Canada
Offline
Sr. Member
Karma: 3
Posts: 391
|
 |
« Reply #7 on: April 17, 2012, 02:23:56 pm » |
Method 2.
Have a look at the attached circuit.
Select R1 = 10 x (VPWM - VBE) / ILoad
Given that VPWM=4.2V, VBE=0.7V, then:
R1 = 35 / ILoad, where ILoad is given in amps and is the current resulting from driving the load with (V+ - VCE), which in your case would be about 9.8V
And remember, this circuit will not invert the PWM signal. In other words, when the PWM signal is high, ILoad will flow.
|
|
|
|
|
Logged
|
|
|
|
|
|