doubt in using TIP122 transistors

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
Hi, I'm developing a power generator that uses different power sources (most of them from renewable resources) to provide electricity, heat, etc. Right now I'm in need in some help because I need to be able to switch from 2 power supplies but I need to do the switching by software (using a Raspberry Pi). I've been told I could use Tip122 transistors, but I'm not sure the following circuit is possible since I've seen common uses of tip122 and all of them connect the emitter to ground. Is this circuit possible/safe? (RPi boxes just mean that tip122 bases will be controlled by RPi GPIO pins) Is it possible to use tip122 to do this kind of switching or should I use other components?
 

Attachments

dl324

Joined Mar 30, 2015
12,496
Welcome to AAC!

TIP122 can be used just like any other transistor. In addition to a high beta, it'll also have a higher base-emitter and saturation voltage.
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
Welcome to AAC!

TIP122 can be used just like any other transistor. In addition to a high beta, it'll also have a higher base-emitter and saturation voltage.
thanks for the welcome dl324!
I'm new in using transistors... does your answer means the circuit on the attached image is correct?
 

Alec_t

Joined Sep 17, 2013
11,892
With the configuration shown, the maximum voltage at the emitters will be the RPi's output voltage -1.2V. Is that what you intend?
It would be advisable to include base resistors, to protect the RPi output from excessive current if either transistor failed.
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
With the configuration shown, the maximum voltage at the emitters will be the RPi's output voltage -1.2V. Is that what you intend?
It would be advisable to include base resistors, to protect the RPi output from excessive current if either transistor failed.
Hi Alec!

Oh, that's too bad. No, that's not what I intend. I would like to have +12.6V or +12V (switched "manually" through an interface on the Raspberry) at the input of the step-up circuit. Any suggestion on what kind of component could I use that can be easily available and that could be controlled by a Raspberry Pi 3? (Oh and I was considering base resistors, but didn't included them on the drawing)
 

dl324

Joined Mar 30, 2015
12,496
oes your answer means the circuit on the attached image is correct?
No. The circuit you posted is unlikely to work the way you want. To turn on the transistors, the output from RPi would need to be two diode drops above the emitter.

You'd be better off using P MOSFETs as the switches. That doesn't require the RPi output to get to around 12V, but you need to contend with how much current (from the resistor used to turn off the MOSFETs) you can force into an output without causing damage.
 

WBahn

Joined Mar 31, 2012
26,398
Hi, I'm developing a power generator that uses different power sources (most of them from renewable resources) to provide electricity, heat, etc. Right now I'm in need in some help because I need to be able to switch from 2 power supplies but I need to do the switching by software (using a Raspberry Pi). I've been told I could use Tip122 transistors, but I'm not sure the following circuit is possible since I've seen common uses of tip122 and all of them connect the emitter to ground. Is this circuit possible/safe? (RPi boxes just mean that tip122 bases will be controlled by RPi GPIO pins) Is it possible to use tip122 to do this kind of switching or should I use other components?
That circuit won't work the way you are intending it to. First, you want to use them as switches and this is going to try to use them as emitter-followers. Second, what kind of currents are your power sources going to be delivering? The TIP122 is only rated for 5 A continuous current (with adequate heat sinking) and 8 A peak current.

A simple way of doing what you would would be to use relays, either electromechanical or solid state. If you want to use transistors, then you need PNP (or PFET) transistors up against the supplies. You can use NPN transistors to control these via the RPi.
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
No. The circuit you posted is unlikely to work the way you want. To turn on the transistors, the output from RPi would need to be two diode drops above the emitter.

You'd be better off using P MOSFETs as the switches. That doesn't require the RPi output to get to around 12V, but you need to contend with how much current (from the resistor used to turn off the MOSFETs) you can force into an output without causing damage.


on a test I did I was able to turn the transistors on with my Raspberry by using a 140 ohm resistor (providing 12mA base current) and I was able to do the switching of another circuit. The thing is now I need to switch between those 2 power supplies and wasn't sure if tip122 was the correct element to use. But I'll guess I'll be considering P MOSFETS.

I'm not sure I understood you correctly, but RPi outputs provide at the most 16mA don't they?
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
That circuit won't work the way you are intending it to. First, you want to use them as switches and this is going to try to use them as emitter-followers. Second, what kind of currents are your power sources going to be delivering? The TIP122 is only rated for 5 A continuous current (with adequate heat sinking) and 8 A peak current.

A simple way of doing what you would would be to use relays, either electromechanical or solid state. If you want to use transistors, then you need PNP (or PFET) transistors up against the supplies. You can use NPN transistors to control these via the RPi.
the power sources will be delivering 2A at the most. Which ones are more energy efficient taking into account I'll be controlling them with the Raspberry, relays or NPN transistors?
 

WBahn

Joined Mar 31, 2012
26,398
the power sources will be delivering 2A at the most. Which ones are more energy efficient taking into account I'll be controlling them with the Raspberry, relays or NPN transistors?
Efficiency-wise MOSFETs are the way to go unless you get statically latching relays (relays that mechanically trap into their set state and require power just to move them from one state to the other) because then you could shut down the RPi except when deciding what to do. If you have standard relays that require current to hold them in the active position, then those will draw power continuously while they are in use (and you want the active position to be the one that connects the supply for fail-safe reasons, which also argues against using mechanically-latched relays) then even BJT transistors will be more efficient, particularly Darlingtons, as they will draw minimal base current compared to the relay -- but MOSFETs will draw virtually no current except the actual switching transients.
 

AnalogKid

Joined Aug 1, 2013
8,943
Your original circuit is close, but needs two changes. First, in your circuit a bipolar junction transistor (BJT) needs a resistor in series with the base to limit the base current to a safe value.

Second, your circuit configuration is called an emitter follower, but a better circuit would be a saturated switch. Your circuit will switch power, but a) there will be a significant voltage drop across the power transistor; b) a Rpi cannot drive the base directly because the pi can make only a 5 V output and the base needs 12 V to do anything and 14 V or more for best (but still not great) efficiency.

A better circuit is to use a TIP125, 126, or 127 PNP transistor in a saturated switch configuration.
Emitter - to the diode
Collector - to the output summing point
Base - to a 2.2 K resistor to the Rpi output

Add an additional resistor, 10K, from the base to the emitter. This "pulls up" the base to turn off the transistor when the Rpi lets go.

Note - for this to work, the Rpi output must be configured as an open collector: it goes low to connect that source to the output, and goes to a high impedance to disconnect it.

With this configuration you will drop approx. 0.8 V across the transistor when switched on.

For an even lower voltage drop you need to change to a power MOSFET. Now the voltage drop can be 0.1 V or less.

Questions - can an RPi output be set to open collector (or open drain) operation? If yes, can it withstand 12 V?

ak
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
Efficiency-wise MOSFETs are the way to go unless you get statically latching relays (relays that mechanically trap into their set state and require power just to move them from one state to the other) because then you could shut down the RPi except when deciding what to do. If you have standard relays that require current to hold them in the active position, then those will draw power continuously while they are in use (and you want the active position to be the one that connects the supply for fail-safe reasons, which also argues against using mechanically-latched relays) then even BJT transistors will be more efficient, particularly Darlingtons, as they will draw minimal base current compared to the relay -- but MOSFETs will draw virtually no current except the actual switching transients.

my original circuit had Darlingtons (npn tip122) or are you talking about different Darlingtons ?
 

be80be

Joined Jul 5, 2008
2,051
You can't use 16 mA a pin the total for the chip is 51 mA and it states to figure around 3 mA a output if using more then one pin.
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
Your original circuit is close, but needs two changes. First, in your circuit a bipolar junction transistor (BJT) needs a resistor in series with the base to limit the base current to a safe value.

Second, your circuit configuration is called an emitter follower, but a better circuit would be a saturated switch. Your circuit will switch power, but a) there will be a significant voltage drop across the power transistor; b) a Rpi cannot drive the base directly because the pi can make only a 5 V output and the base needs 12 V to do anything and 14 V or more for best (but still not great) efficiency.

A better circuit is to use a TIP125, 126, or 127 PNP transistor in a saturated switch configuration.
Emitter - to the diode
Collector - to the output summing point
Base - to a 2.2 K resistor to the Rpi output

Add an additional resistor, 10K, from the base to the emitter. This "pulls up" the base to turn off the transistor when the Rpi lets go.

Note - for this to work, the Rpi output must be configured as an open collector: it goes low to connect that source to the output, and goes to a high impedance to disconnect it.

With this configuration you will drop approx. 0.8 V across the transistor when switched on.

For an even lower voltage drop you need to change to a power MOSFET. Now the voltage drop can be 0.1 V or less.

Questions - can an RPi output be set to open collector (or open drain) operation? If yes, can it withstand 12 V?

ak
yeah, I missed the resistors on my drawing, but I've used 140 ohm resistors on those TIP122 (providing 12mA base current) and was able to do the switching of another circuit, providing 2A at Ic, isn't it?

I think I didn't understood your circuit suggestion, could you please help me out with a quick drawing of it?

for your last question I don't think RPi's outputs can do that, to my knowledge they can only be 3.3V or 0V
Your original circuit is close, but needs two changes. First, in your circuit a bipolar junction transistor (BJT) needs a resistor in series with the base to limit the base current to a safe value.

Second, your circuit configuration is called an emitter follower, but a better circuit would be a saturated switch. Your circuit will switch power, but a) there will be a significant voltage drop across the power transistor; b) a Rpi cannot drive the base directly because the pi can make only a 5 V output and the base needs 12 V to do anything and 14 V or more for best (but still not great) efficiency.

A better circuit is to use a TIP125, 126, or 127 PNP transistor in a saturated switch configuration.
Emitter - to the diode
Collector - to the output summing point
Base - to a 2.2 K resistor to the Rpi output

Add an additional resistor, 10K, from the base to the emitter. This "pulls up" the base to turn off the transistor when the Rpi lets go.

Note - for this to work, the Rpi output must be configured as an open collector: it goes low to connect that source to the output, and goes to a high impedance to disconnect it.

With this configuration you will drop approx. 0.8 V across the transistor when switched on.

For an even lower voltage drop you need to change to a power MOSFET. Now the voltage drop can be 0.1 V or less.

Questions - can an RPi output be set to open collector (or open drain) operation? If yes, can it withstand 12 V?

ak
yeah, I missed the resistors on my drawing, but I've used 140 ohm resistors on those TIP122 (providing 12mA base current) and was able to do the switching of another circuit, providing 2A at Ic, isn't it?

I think I didn't understood your circuit suggestion, could you please help me out with a quick drawing of it?

for your last question I don't think RPi's outputs can do that, to my knowledge they can only be 3.3V or 0V
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
You can't use 16 mA a pin the total for the chip is 51 mA and it states to figure around 3 mA a output if using more then one pin.
thanks for your comment. I was confident in using RPi's GPIO to run my TIP122 because according to:
https://raspberrypi.stackexchange.c...-the-maximum-current-the-gpio-pins-can-output

the max from each pin should be 16mA (I calculated the resistor at the base to provide 12mA) with a total max for all pins to be 51mA, but in case my circuit was correct (which it seems it isn't by the comments from most nice people helping me ) I would only be using 2 of them for a total of 32mA. Do you have any other link with the correct information?
 

be80be

Joined Jul 5, 2008
2,051
That's 1 pin only you will end up blowing a pin it you try that with more then one pin.
I no for fact it will blow a pin I seen where it happens.
I don't use more then 3 mA a pin it's more then a enough to to dive a npn as switch I then use that to drive the rest
The PI is easy to break

What happens is you get to thinking Oh i can drive 16mA then you add a pin it don't click that Oh i can now only drive 8 mA add some more
and you'll dig in your pocket the cash to by a new PI

Just go with the 3mA limit a pin and save your self some time
 

Thread Starter

Fabian Salinas L

Joined Jan 22, 2018
9
Your original circuit is close, but needs two changes. First, in your circuit a bipolar junction transistor (BJT) needs a resistor in series with the base to limit the base current to a safe value.

Second, your circuit configuration is called an emitter follower, but a better circuit would be a saturated switch. Your circuit will switch power, but a) there will be a significant voltage drop across the power transistor; b) a Rpi cannot drive the base directly because the pi can make only a 5 V output and the base needs 12 V to do anything and 14 V or more for best (but still not great) efficiency.

A better circuit is to use a TIP125, 126, or 127 PNP transistor in a saturated switch configuration.
Emitter - to the diode
Collector - to the output summing point
Base - to a 2.2 K resistor to the Rpi output

Add an additional resistor, 10K, from the base to the emitter. This "pulls up" the base to turn off the transistor when the Rpi lets go.

Note - for this to work, the Rpi output must be configured as an open collector: it goes low to connect that source to the output, and goes to a high impedance to disconnect it.

With this configuration you will drop approx. 0.8 V across the transistor when switched on.

For an even lower voltage drop you need to change to a power MOSFET. Now the voltage drop can be 0.1 V or less.

Questions - can an RPi output be set to open collector (or open drain) operation? If yes, can it withstand 12 V?

ak

I have a doubt about your answer and I hope it's not a dumb one. Isn't Tip122 switched on or off by a small current on the base? I thought that's why it was a good idea to use it with the raspberry. Or why did you said I couldn't drive the base with the raspberry? (i do use a resistor to limit the current to 12mA)
 

WBahn

Joined Mar 31, 2012
26,398
While the transistor only requires a small current into the base to conduct a large current from collector to emitter -- and for a Darlington this is the case even more so -- when the transistor is conducting the base-emitter voltage is roughly fixed at about 1.7 V. This has major implications for emitter-follower applications.
 

BobaMosfet

Joined Jul 1, 2009
1,403
I think, in order for anyone to provide a decent answer to your questions, some basic engineering information needs to be determined.
Questions:

  1. Need a better explanation of how you're using your power supplies. Is the solar charger providing power in lieu of the batteries, and if it stops outputting the batteries take over?
  2. How much max current is being drawn by the load? Necessary to determine components.
  3. Why are you using RPIs at all, when a few components can automatically ensure continuous power delivery from one or the other power source?
  4. Both your sources are DC, correct? Just want to be sure.
 
Top