Maker Pro
Maker Pro

Transistor Help

Derek Filliams

Nov 30, 2017
4
Joined
Nov 30, 2017
Messages
4
Hi,

I've been going around in circles trying to control 12V and up to 0.5A with my arduino Mega but can't get any transistor to work correctly. The correct amount of current never passes from collector to emitter (I've been using NPN transistors). I think I maybe have my bjt concepts mixed up. If I am looking to pass 0.5A @12V DC using a 0.04A @ 5v signal, what spec transistor am I looking for?

Thanks,

Derek
 

Bluejets

Oct 5, 2014
6,926
Joined
Oct 5, 2014
Messages
6,926
Can you supply a bit more information like your circuit diagram with values of components, type numbers etc.
and just what loading you are trying to control.? Pencil drawn sketch is quite ok.
 

Audioguru

Sep 24, 2016
3,656
Joined
Sep 24, 2016
Messages
3,656
If the transistor does not need to turn on completely and can have a voltage of about 1V between collector and emitter then the hFE of the transistor is used in the calculation for the base current. If you want the transistor to turn on very well then its saturation voltage loss is used where it is the base current should be 1/10th the collector current for most small transistors.

But maybe the Arduino produces 40mA into a dead short but much less into the base of a transistor?
Usually the emitter is grounded and the collector goes close to ground when the base gets 1/10th of the collector current into its 0.7V base. Maybe your transistor is an emitter-follower that is much different. Please post your schematic for us to see.
 

AnalogKid

Jun 10, 2015
2,893
Joined
Jun 10, 2015
Messages
2,893
If the transistor collector is connected to the 12 V, this will not work.
If ...
If ...
If ...

Please post your schematic.

ak
 

Derek Filliams

Nov 30, 2017
4
Joined
Nov 30, 2017
Messages
4
Yes sorry, should have just posted the schematic from the beginning. Please bear with me as I'm probably missing something pretty basic here. I thought this was a really simple job, I connected the base to a digital out pin (spec'd to supply 40mA @ 5V) through a resistor, and I did check that the pin was working. I did connect the collector straight to 12V, and then emitter is going to a solenoid, the load. The transistor I'm using right now is S8050 Bipolar (BJT) Transistor NPN 25V 0.5A 100MHz (all the info that's listed.) but I'm not married to it.

My issue is that it seems not enough current is coming through the transistor so I'm thinking maybe I have the wrong one.

Thanks guys
 

Attachments

  • IMG_3694.JPG
    IMG_3694.JPG
    153.1 KB · Views: 113

davenn

Moderator
Sep 5, 2009
14,262
Joined
Sep 5, 2009
Messages
14,262
Please bear with me as I'm probably missing something pretty basic here. I thought this was a really simple job,

OK
offhand I have no idea what a S8050 transistor is or what it's ratings are ?
please [post a link to it's PDF datasheet

the emitter of the transistor should go to the - (negative ) PSU rail which should be the same common negative (0V) rail of the 12V
and the supply to the controller board ( that is ... those 0V rails should be tied together)

Next ... move the solenoid to between the 12V supply and the collector of the transistor


Dave
 

davenn

Moderator
Sep 5, 2009
14,262
Joined
Sep 5, 2009
Messages
14,262
Ohhhh you also neglected to state...
1) the coil resistance of the solenoid
2) the resistor value between the controller output and the transistor base .... around 1kΩ at the most


Dave
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
Well,
Like Dave said above it is clear why it should not work.
Here is the correct circuit.
Don't forget to add the diode so that the Tr. will not blow !!!

IMG_3694.JPG
 
Last edited by a moderator:

Ratch

Mar 10, 2013
1,099
Joined
Mar 10, 2013
Messages
1,099
Hi,

I've been going around in circles trying to control 12V and up to 0.5A with my arduino Mega but can't get any transistor to work correctly. The correct amount of current never passes from collector to emitter (I've been using NPN transistors). I think I maybe have my bjt concepts mixed up. If I am looking to pass 0.5A @12V DC using a 0.04A @ 5v signal, what spec transistor am I looking for?

Thanks,

Derek

You really need to know the voltage to trigger the solenoid and the resistance of the coil. In other words, you need to know the parameters of the load. If the trigger voltaqe is 5 volts or less, then I would put the coil in the emitter circuit in a common collector configuration. Hopefully the current needed is less than 0.5 amps, which is the capacity of the transistor.

Ratch
 

Audioguru

Sep 24, 2016
3,656
Joined
Sep 24, 2016
Messages
3,656
You used the NPN transistor as an "emitter-follower" instead of as a switch. Then when the Arduino output went to +5V the base went to about +4.8V. But the emitter is about 0.7V less than the base so the solenoid got only about 4.1V instead of 12V. I mentioned this problem in my post #4.
 

Derek Filliams

Nov 30, 2017
4
Joined
Nov 30, 2017
Messages
4
Thanks for all the help guys, I changed my setup to look like what you suggested, dorke, and at least the transistor works now. I'm left with two problems that I need to get to the bottom of.

1. The circuit only works when the base is connected to the arduino's 5v supply pin, still nothing happens when I connect to a digital out set to high. I'm seeing that I can't get 40mA to come out of the digital pin for some reason, instead I get a pretty steady 0.14 mA.

2. The solenoid starts out getting the ~.4 or so amps that it's rated to draw, but over a shortish time, drops to a final 0.288A which is undesirable. I'm thinking mayyybe there's some heat issues as the transistor is getting pretty hot.

I'm currently using 122 ohms for the resister drawing current to base, which I thought would get me roughly 40mA @5V. I've attached the data sheet for the solenoid I have and the amazon page for the bucket of transistors, which I couldn't find a specific data sheet for. (I realize buying a bunch of crappy transistors from amazon might also be my issue)

Solenoid: https://www.alliedelec.com/guardian...NrALNxFf1kzMP8d7VWH-QDXbAdghja3kaAl6nEALw_wcB

Transistors: https://www.amazon.com/gp/product/B06XCXX69F/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,723
Joined
Nov 17, 2011
Messages
13,723
The S8050 has a DC current gain of min. 40 for 500 mA of collector current.
Your coil has a resistance of 28.3 Ω. Used on 12 V and neglecting the transistor's collector-emitter voltage gives a current of Ic=12 V/28.3 Ω = 420 mA. Divided by the min. current gain of 40 results in a base current of Ib = 420 mA / 40 = 10.5 mA.
A 5 V output may have as little as 4 V when loaded by a (comparatively) high current. Taking into accoun the 0.6 V base-emitter voltage the remaining voltage across the base resistor is approx. 3.4 V. Divided by 11 mA (just to have some margin) gives Rb = 3.4 V / 11 mA = 310 Ω.

Do not overload the output of the arduino as the output voltage will fall and the processor may even be damaged. I doubt that drawing 40 mA from an arduino is a good idea. 40 mA is the maximum current, recommended is using not more than 20 mA. In addition you have to observe the max. total output current (adding up all I/O pins) which is another limit (100 mA per port) and the total max. Vcc current for the whole chip which includes the current consumption by the chip itself plus any I/O currents.
still nothing happens when I connect to a digital out set to high
Verify the output voltage of the arduino when you set the pin high using a voltmeter. Is it actually high? Is the setup in software correct (pin configured for output)?
 

Audioguru

Sep 24, 2016
3,656
Joined
Sep 24, 2016
Messages
3,656
The datasheet of almost every transistor shows that they conduct very well when the base current is 1/10th the collector current. But I guess your Arduino cannot provide 5V at 40mA, it provides much less then the transistor is starved of enough base current and does not fully turn on producing heat.
Use a logic-level Mosfet or add an emitter-follower transistor to drive 40mA into the base of the transistor you have.
 

Audioguru

Sep 24, 2016
3,656
Joined
Sep 24, 2016
Messages
3,656
This seems to conflict with Audioguru suggestion to use a gain of 1:10 for base to collector. Am I missing something?
Yes you are missing information shown on the datasheet of almost every transistor:
1) hFE (current gain) is used when there is plenty of collector to emitter voltage so that the transistor is a linear amplifier, not a switch.
2) The base current should be 1/10th the collector current when the transistor is a saturated switch with a collector to emitter voltage that is very low.
 

dorke

Jun 20, 2015
2,342
Joined
Jun 20, 2015
Messages
2,342
Well Amigos,
Obviously the correct switching element for this case isn't a BJT.
Either use a Darlington or a Mosfet.

A logic level Power Mosfet( N-ch. enhancement mode)being the best solution
(a bit hard sticking to to-92 package,like the S8050).
e.g. VN0106N3-G
I would look for another part,
since it's RDSon is relatively high about 3 ohm, dissipating about 0.75W at 500mA.

For other packages,it is easy to find devices with very low RDSon
like the Si1450DH
 
Last edited:

Audioguru

Sep 24, 2016
3,656
Joined
Sep 24, 2016
Messages
3,656
If the transistor has the minimum current gain of 40 and you feed its base 1/40th the collector current then the maximum saturation voltage (collector to emitter) is 1V so at 500mA some S8050 transistors will heat with 0.5W and will smoke and burn since its maximum allowed dissipation is 0.3W.
The datasheet says its max saturation voltage is only 0.5V when its base current is 1/10th its collector current then its will heat with 0.25W max and all will survive.
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
I'd go for a logic level N Mosfet such as the IRL530.
 
Top