What is the best circuit simulation for beginners/novices?

AlbertHall

Joined Jun 4, 2014
12,346
First, two MOSFETs in parallel will share current but not voltage. You need a MOSFET which can handle the full supply voltage.
Second, the gate voltage needs to be 4.5V above the voltage on the source to turn on. This is fine if the source is grounded but won't work if there is an LED between the source and ground.
 

Thread Starter

danwbangor91

Joined Feb 8, 2017
22
First, two MOSFETs in parallel will share current but not voltage. You need a MOSFET which can handle the full supply voltage.
Second, the gate voltage needs to be 4.5V above the voltage on the source to turn on. This is fine if the source is grounded but won't work if there is an LED between the source and ground.
OK, understood. So if I could find an LED driver with less output current, would the attached schematic work with the following MOSFET?
HTML:
http://uk.farnell.com/nxp/nx7002bkmb/mosfet-n-ch-60v-0-35a-sot883b/dp/2498575
It says it can handle 350mA and 60V. Could you please inform me whether or not this will work- or if I'd need anything else like resistors etc? Thank you SO much
 

Attachments

AlbertHall

Joined Jun 4, 2014
12,346
It says it can handle 350mA and 60V. Could you please inform me whether or not this will work- or if I'd need anything else like resistors etc? Thank you SO much
They will handle the voltage but the problem with the gate voltage remains and indeed is even worse. These MOSFETs require the gate to be 10V positive of the source so even the ones with the source grounded will not be turned on by the 5V from the uC.

It is (almost) impossible to make this circuit work. The MOSFETs need to be able turn on with with gate 5V (from the picaxe) minus the LED voltage, perhaps 2.5V?, which would leave just 2.5V for the gate/source. For the MOSFETs supplying LEDs in series it is impossible as there would no voltage left at all for the MOSFET.
 

dl324

Joined Mar 30, 2015
16,910
Could you please inform me whether or not this will work- or if I'd need anything else like resistors etc?
Could you summarize again what you want this circuit to do?

You didn't give the transistors any component designators... The top two transistors are should be P MOSFETs; assuming you want to use MOSFETs and not JFETs.

I didn't catch what the current specs were for the LEDs you want to use, but you can't connect them in parallel without ballast resistors to prevent current hogging. In any case, the LEDs need current limiting resistors because your circuit is capable of providing up to 450mA.

N channel JFETs, as you've drawn, are "always on" and require a negative Vgs to turn them off.

The NX70002 MOSFET you referenced has a low enough Vgs that they "could" be used in your circuit.

BTW, this thread has digressed from the original topic; but it's your thread...

The "best" circuit simulator won't help someone who doesn't know circuits to do circuit design. Simulators rarely smoke parts that are being abused.
 

Thread Starter

danwbangor91

Joined Feb 8, 2017
22
What happened to the string of LEDs switched with transistors?
OK I understand more now thanks. The other guy mentioned the MOSFETs so I just went along with it. Wasn't really sure how to choose the right BJT as I got confused with current gain and collector emitter voltage.

Would I be right in thinking I could technically use any as long as collector-emitter V is at least 30-35V and 'DC collector current' at least 300mA? Like this one: http://uk.farnell.com/multicomp/bc817-40/transistor-npn-0-5a-45v-sot23/dp/1798081

Also, to calculate the base resistor, is it the voltage from the microcontroller output pin divided by the current from the output pin (I can't find out the current, it just says max 20mA)?
 

dl324

Joined Mar 30, 2015
16,910
Wasn't really sure how to choose the right BJT as I got confused with current gain and collector emitter voltage.
When you're using transistors as switches (saturated), you assume a low beta (like 10) to calculate base current/resistance required.

The top two transistors should still be P-type because they're being used for "high side" switching. The bottom two should be N-type because they're doing "low side" switching.

Do you really want to operate the LEDs at 150-450mA?

Using MOSFETs can simplify interface to a circuit that can't source/sink the desired current. For example, to switch 300mA, a conservative design would provide 30mA of base current. Few microcontrollers can sink that much current and even fewer can source that much.

A problem with MOSFETs is that Vth isn't tightly controlled and "on" resistance depends on how hard the gate is driven.
 

Thread Starter

danwbangor91

Joined Feb 8, 2017
22
When you're using transistors as switches (saturated), you assume a low beta (like 10) to calculate base current/resistance required.

The top two transistors should still be P-type because they're being used for "high side" switching. The bottom two should be N-type because they're doing "low side" switching.

Do you really want to operate the LEDs at 150-450mA?

Using MOSFETs can simplify interface to a circuit that can't source/sink the desired current. For example, to switch 300mA, a conservative design would provide 30mA of base current. Few microcontrollers can sink that much current and even fewer can source that much.

A problem with MOSFETs is that Vth isn't tightly controlled and "on" resistance depends on how hard the gate is driven.
The LEDs I'm powering are Cree XQAs- 150mA typical current. This circuit is supposed to be for a vehicle daytime running light. I've read that LEDs like these are supposed to be properly driven with drivers rather than resistors- so I've chosen a Luxdrive FlexBlock which supplies 300mA constant current. The array of LEDs are to be turned on sequentially when powering up, and I'm thinking of using the same circuit for LED indicators with the same sequential properties.

I suppose the PWM capabilities of the Picaxe means I won't need two separate drivers (i.e. 450mA total potential output) to dim the LEDs, so 300mA will be the maximum supply current. I assumed using two parallel strings of LEDs would enable them to ALMOST equally share the total current, because I wouldn't know how to ensure they share equally.

Regarding the transistors, a web page I've visited for info states that the base should be grounded on a PNP transistor, and that it should receive a negative base current. So how would I go about using one of these in my schematic? Would the base still be tied to the output pin of the micro?
 

AlbertHall

Joined Jun 4, 2014
12,346
OK I understand more now thanks. The other guy mentioned the MOSFETs so I just went along with it. Wasn't really sure how to choose the right BJT as I got confused with current gain and collector emitter voltage.

Would I be right in thinking I could technically use any as long as collector-emitter V is at least 30-35V and 'DC collector current' at least 300mA? Like this one: http://uk.farnell.com/multicomp/bc817-40/transistor-npn-0-5a-45v-sot23/dp/1798081

Also, to calculate the base resistor, is it the voltage from the microcontroller output pin divided by the current from the output pin (I can't find out the current, it just says max 20mA)?
Yes any transistor which can handle the voltage and current will do the job. The one you have chosen fits the bill. When using transistors as switches assume they have hfe = 10 to ensure they switch fully on and dissipate the lowest power, so 20mA for this circuit is good.
 

dl324

Joined Mar 30, 2015
16,910
Regarding the transistors, a web page I've visited for info states that the base should be grounded on a PNP transistor, and that it should receive a negative base current. So how would I go about using one of these in my schematic? Would the base still be tied to the output pin of the micro?
To turn on a PNP transistor, the base-emitter junction needs to be forward biased. For conventional current, the base current will be coming "out" of the base.

The LEDs you mentioned have a maximum forward current rating of 300mA. When you have LEDs connected in parallel with no ballast resistors, one will draw more current than the others. That LED could fail and cause a cascading failure.

EDIT: corrected maximum LED current; had 450ma.
 
Last edited:

Thread Starter

danwbangor91

Joined Feb 8, 2017
22
Yes any transistor which can handle the voltage and current will do the job. The one you have chosen fits the bill. When using transistors as switches assume they have hfe = 10 to ensure they switch fully on and dissipate the lowest power, so 20mA for this circuit is good.
THANK YOU
So 220ohms base resistors and we should be good? Thanks :)

Is there any chance someone could clarify why a PNP should be used at the top of the circuit ie. Before the LEDs? Is it because the V going into the transistor is not 0 like it would be after the LEDs? And is that why the base needs a negative V? As in, lower than the V going into collector/emitter? Would it not always be lower though, when there is no power applied to the base?
 

dl324

Joined Mar 30, 2015
16,910
Is there any chance someone could clarify why a PNP should be used at the top of the circuit ie. Before the LEDs?
If you use an NPN transistor, turn on voltage depends on the load on the emitter. When you can be driving a different number of LEDs, you have to overdrive for the case where you're only driving one. And the base driver needs to be able to provide sufficient voltage to turn on the transistor...
 

Thread Starter

danwbangor91

Joined Feb 8, 2017
22
If you use an NPN transistor, turn on voltage depends on the load on the emitter. When you can be driving a different number of LEDs, you have to overdrive for the case where you're only driving one.
OK. Thanks guys for all your help. I've decided to throw this project out of the window and try to forget about it. There's just too much I don't know about and don't understand and I've spent too many hours (months) on it. I greatly appreciate all of your help and I'll be sure to stick around on the site :)
 

AlbertHall

Joined Jun 4, 2014
12,346
THANK YOU
So 220ohms base resistors and we should be good? Thanks :)

Is there any chance someone could clarify why a PNP should be used at the top of the circuit ie. Before the LEDs? Is it because the V going into the transistor is not 0 like it would be after the LEDs? And is that why the base needs a negative V? As in, lower than the V going into collector/emitter? Would it not always be lower though, when there is no power applied to the base?
Yes you are good to go with NPN transistors and the two strings of LEDs (providing they share the current equally).

The PNP transistors are suggested for the second version of the circuit where you're not using the LED strings. You don't need that for the two strings and NPNs version.
 
Top