Switching Voltage Sources

Discussion in 'The Projects Forum' started by x1222, Dec 30, 2012.

Oct 22, 2011
31
0
I was hoping you guys could help me check over my circuit. I'm building a circuit to supply a fan (12 V and 1 AMP) 12 Volts when an atx power supply starts and then switches to 5 Volts when the MCU signals so. The 12V is connected to the fan through the PNP transistor and the MCU controls the NPN transistor which connects 12V to the base of PNP. The 12V and 5V are each connected with a schottky diode and then join to the same wire, so when the NPN turns on the PNP the 12V turns off and 5V takes over. MCU is +3.3V and seems to work fine with the NPN. The gain on the transistors is a minimum of 1000.

Initially, I want the PNP and NPN bases connected to ground, so I hooked up some pull-down resistors. Is there a way to calculate what resistor value to use? I've just seen the recommended values 10k+. 10k Seems to cause some leakage for me, so I used 100k which works. Thanks.

• fan-circuit.png
File size:
13.2 KB
Views:
88
Last edited: Dec 30, 2012
2. tubeguy Well-Known Member

Nov 3, 2012
1,157
198
You should move the cathode of the 5 volt supply diode to the pnp collector-motor connection.
And you don't need the other diode in the 12 volt supply.

x1222 likes this.
3. Ron H AAC Fanatic!

Apr 14, 2005
7,049
673
That won't work. The voltage on the emitter of TIP127 will always be 11.6V.
The voltage on the base of TIP127 will always be 10.2V. The voltage on the fan will be 11V. The MCU does nothing, because the TIP122 is cut off.

• fan speed switch.png
File size:
34.8 KB
Views:
63
x1222 likes this.
4. Ron H AAC Fanatic!

Apr 14, 2005
7,049
673
The fan will still get ~11V all the time.

tubeguy likes this.

Oct 22, 2011
31
0
I'm having trouble understanding how the circuit you posted works. Won't there be a short if there is no resistor in the base of the NPN? If there isn't won't the 3.3V make the NPN on always anyway? If I'm not mistaken base current controls the switch. What does the MCU signal connecting to the emitter to do? Is there specific reason why the 2N3904 or a P-mosfet is better? Also, what software is that? Thanks Ron.

6. Ron H AAC Fanatic!

Apr 14, 2005
7,049
673
You have a lot to learn about transistors.
The NPN, Q1, is a common base stage. When the MCU input is low, D5 is cut off. The emitter of Q1 will be ≈0.7V below the base voltage, or about 2.6V. The emitter current will be Ie=2.6v/620Ω=4.2mA. Since Ic≈Ie, the collector current will also be ≈4.2mA.
Vbe of the TIP127 is about 1.4V. Therefore, the current through R6 will be 1.4v/10k=140uA. The rest of Q1's collector current, just under 4mA, will flow out of the base of the TIP127. This will saturate the TIP127. Vce(sat) is about 0.6V. The voltage drop of D4 is about 0.4V, so the fan will get about 11V. This cuts off D3.

When the MCU is high, the voltage at the emitter of Q1 will be at about 3V. This cuts off Q1, so the base of the TIP127 goes to +12V, turning it off. This allows D3 to be forward biased, and the fan gets about 4.7v.

D4 is actually too small. It is rated at 1Amp. You should use a diode that is rated at a minimum of 2 Amps in this location.

Also, you mentioned that the beta of the darlingtons is 1000. This is true when the transistor has Vce=3V. When the transistor is saturated, it is spec'ed for Ic/Ib=250. This is why I am driving it with ≈4mA. See the attachment.

What type of MCU are you using? I may have to modify the input circuit slightly, depending on how much current it can source.

• TIP127 Vce(sat) specs.png
File size:
5.3 KB
Views:
30
x1222 likes this.

Oct 22, 2011
31
0
I definitely feel that way. It's probably circuits in general too. Your explanation really helped.

If the resistor starts from 12V and drops to 1.4V below it, should it not be 12 - 1.4 / 10k?

I forgot to add it in the drawing. I was going to hook 2 diodes in parallel from the 12V.

I am using a P89LPC9351 8051 microcontroller. From the datasheet is says the max sourcing/sinking is 20ma for certain pins and 100 ma max for the chip:

"High current sourcing/sinking (20 mA) on eight I/O pins (P0.3 to P0.7, P1.4, P1.6, P1.7). All other port pins have high sinking capability (20 mA). A maximum limit is specified for the entire chip."

Last edited: Dec 31, 2012
8. tubeguy Well-Known Member

Nov 3, 2012
1,157
198
With all due respect, you can remove D4 from the new circuit. It will work either way. Without D4 you will get a bit more voltage to the motor.
When the TIP127 is on (pulled high) the 5VDC will be blocked by D3, and the 12VDC will be applied to the motor.

Last edited: Jan 1, 2013
9. Ron H AAC Fanatic!

Apr 14, 2005
7,049
673
I put D4 there for the case where +5V is present, but +12V isn't. This would allow +5V to flow back through the CB junction of the TIP127, potentially breaking down the base-emitter junction, which is rated at 5V reverse breakdown.

I got concerned about the drive capability of the MCU. The attached circuit has a few more parts, but I like it better.

• fan speed switch1.png
File size:
52 KB
Views:
40
x1222 likes this.
10. tubeguy Well-Known Member

Nov 3, 2012
1,157
198
I'm embarrassed - Thank you for the explanation.

11. Ron H AAC Fanatic!

Apr 14, 2005
7,049
673
I don't think you should be embarrassed. I didn't put in D4 on the first draft of the schematic. I thought, "Aha! I can save a diode!". I'm not sure why I thought of what would happen if the +12v supply came on late, or never. Perhaps it was due to about 50 years of design engineering experience.

12. tubeguy Well-Known Member

Nov 3, 2012
1,157
198
OOPs I messed up

13. tubeguy Well-Known Member

Nov 3, 2012
1,157
198
I don't know what just happened. I did not mean to re-post the above

What I was posting was a Thank You for the kind words.
Very much appreciated !!!!