Transistor Switch Circuit Problem

Thread Starter

julchak

Joined Dec 18, 2014
26
The effect of temperature on both switching points. Green is -40C, 100C is dark Blue. Steps are 20C each.
Hmm...I'm not entirely sure how that affects the set points from looking at the different current draws throughout the temperature range. Is it drastic?

As long as the ones you are using do not have an internal resistor, like most panel mount LEDs have. To work as simulated, the Vf for the Red and Green LED should be between 1.8V and 2.2V.
I think it might be fine....not sure about internal resistors on them, but I looked up at the RED led has a Vf of 2.0 V (2.5 max?) and the GREEN has a Vf of 2.2 V (2.6 max?). Will these still work?
 

MikeML

Joined Oct 2, 2009
5,444
Hmm...I'm not entirely sure how that affects the set points from looking at the different current draws throughout the temperature range. Is it drastic?
I see less than a 50mV change in either trip point as the temperature changes from -40C to 100C.
I think it might be fine....not sure about internal resistors on them, but I looked up at the RED led has a Vf of 2.0 V (2.5 max?) and the GREEN has a Vf of 2.2 V (2.6 max?). Will these still work?
Will work.
 

Thread Starter

julchak

Joined Dec 18, 2014
26
Mike, need to thank you again for all your help and patience with this! Don't know what I would've done without your help and everyone else's help on this forum.

So I am just getting a bill of materials ready to purchase these components necessary in the circuit you put together for me, and want to make sure a few of the components I spec'd out are correct:
  1. TL431 - I found a bunch with some slight different specs with output voltage (close to 2.5 V for all), tolerance, and cathode current. Would this one work? TL431AILPR?
  2. FDC638P - I found this one which I believe matches.
Other than that, the other items I need are:
  1. The push buttons marked on your layout which I believe are just the ones I have (it seems more complicated in the diagram you sent, but I'm pretty sure the boxed in area for the NO and NC push buttons with all the small elements inside the boxes are just the push button I have and nothing extra, right?)
  2. The two LEDS D1 and D2 are the ones I have
  3. All the resistors
  4. Capacitor C1
Am I missing any obvious extra elements here?
 

MikeML

Joined Oct 2, 2009
5,444
...components I spec'd out are correct:
  1. TL431 - I found a bunch with some slight different specs with output voltage (close to 2.5 V for all), tolerance, and cathode current. Would this one work? TL431AILPR?
  2. FDC638P - I found this one which I believe matches.
Other than that, the other items I need are:
  1. The push buttons marked on your layout which I believe are just the ones I have (it seems more complicated in the diagram you sent, but I'm pretty sure the boxed in area for the NO and NC push buttons with all the small elements inside the boxes are just the push button I have and nothing extra, right?)
  2. The two LEDS D1 and D2 are the ones I have
  3. All the resistors
  4. Capacitor C1
Am I missing any obvious extra elements here?
Look at the data sheet for the TL431. Since you seem to want good temperature stability, you might want to get the more expensive B version of this.

Your links to Digikey don't work, but on the PFET, buy one you can mount easily. You need one that is a "logic-level-gate". Otherwise not critical.

The push buttons are modeled as a voltage-controlled switch in LTSpice, so just ignore everything inside the dashed box... The ones you have are fine.

The Leds you have are fine.
 

Thread Starter

julchak

Joined Dec 18, 2014
26
Look at the data sheet for the TL431. Since you seem to want good temperature stability, you might want to get the more expensive B version of this.

Your links to Digikey don't work, but on the PFET, buy one you can mount easily. You need one that is a "logic-level-gate". Otherwise not critical.

The push buttons are modeled as a voltage-controlled switch in LTSpice, so just ignore everything inside the dashed box... The ones you have are fine.

The Leds you have are fine.
Hmm weird with the links. But okay so I am changing the TL431 to - TL431BQLPR. That link should work.

Unfortunately the only FDC638P which I could find was a surface mount, but I watched a video on how to solder those and think I can manage.

As for the capacitor...not going to lie, I've never really had to deal with purchasing a capacitor with my limited circuit work, but spec'd one out and believe it should fall in line with the circuit and the temperature/accuracy requirements. SR215C104JAR.

Think I'm good to go on trying out this circuit next week when the components come in.



I may need some guidance on the arrangement of the TL431's and the FDC638P, but I'll refer to their datasheets first before I come back with any questions.

Thanks again!
 

Thread Starter

julchak

Joined Dec 18, 2014
26
So the only thing I can't quite figure out is how to wire the FDC638P (datasheet linked). Any help on that? Which pin goes where in relation to your diagram?
 

MikeML

Joined Oct 2, 2009
5,444
So the only thing I can't quite figure out is how to wire the FDC638P (datasheet linked). Any help on that? Which pin goes where in relation to your diagram?
It is all on the data sheet. Just look at the pretty pictures there, then look at my pretty picture. See the little diode symbol; that is the key. There will be a quiz (or smoke):D
 

Thread Starter

julchak

Joined Dec 18, 2014
26
Hey Mike,
I've got one quick question as I am working here with all the components and designing the new PCB....in the circuit layout you made in LTSpice there is one area were two lines cross each other but do not have a square intersection point (see below)

Do these two wires not connect at this point?
 

MikeML

Joined Oct 2, 2009
5,444
No connection. LTSpice's schematic editor places a dot there if there is actually a connection. Same is true at a T connection.

Check this: The left-most pin on the schematic of the PFET is its Source, the right-most pin is the Drain, and the bottom pin is the Gate.
 
Last edited:

Thread Starter

julchak

Joined Dec 18, 2014
26
Mike,
So I've gone ahead with a breadboard of the circuit and am having a slight problem. The system powers up when I hit the NO PB, however both the green and red LEDs come on and stay on - they then both fade at the same time as I lower the input voltage. What is supposed to happen is that the green LED would come on by itself (not with the RED LED) at any voltage above 7.3V, and at 7.3V the RED would come on.

As I turn the voltage down both fade out and eventually turn off at 6.3V.

Additionally if I bring the voltage down to i.e.8V after I've turned on the system, then I hit the NC off PB and try to hit the NO on PB, the lights will let up but turn off after I release the button. I have to turn up my filtered DC power supply up until ~9V before the system will "hold" an on state. Now, I'm not sure if this can be attributed to the fact that this DC power supply is old as hell and whenever you power up whatever is attached to it, the draw pulls the output voltage down quite a bit (i.e. if it is at 13V before I hit the on button, it will probably drop and settle around 9V when I turn the system on in this case....).

Now the way I have the LEDs wired would make it seem like they would be on/off together...I followed the diagram but basically have the Gate of the PFET going to the Cathode (-) leg of the red LED; the Anode (+) pin of the RED then goes to the Cathode of the Green LED; the Anode of the green then goes to the 1K resistor which goes to the Drain on the PFET....think I did that right based on your diagram?

Also, with the TL431's and the LED's in the diagram their diodes all seem to point toward the NO PB for their ground, however I also have them being grounded directly to the input voltage's negative pin (on the diagram where it says "com" this shows a connection this way as well)....is this correct? It seems as though both the anode and cathode of these diodes go to ground in one way or another? I'm probably misreading this.

If you could please let me know what you think of these issues it would be really greatly appreciated - I'll go back and check through the breadboard to make sure I don't have any mistakes on there in the meantime.

Thanks again!
 
Last edited:

MikeML

Joined Oct 2, 2009
5,444
You should always download and look at the Data Sheet of any part you plan to use.
It shows the names of the pins and how they relate to the symbol and its named pins (which might have nothing to do with the physical location of the pins). Here is the symbol, and pin names. I purposely oriented the symbol the same way I did in the schematic, except that it is mirrored about the y-axis.

431s.gif
Here is a top view of the outline of a TL431 in a TO92 package which shows the physical pin placement, also from the above data sheet: The TL431 is available in lots of different physical packages, so you will have to match up to the one you actually bought if it wasn't a TO92,

431p.gif



Note that in my schematic, the Anodes of both TL431 connect to the node labeled COM.
The Cathode of the Green LED D2 is connected to the Anode of U1 and the Anode of the Red LED D1.
The Cathode of U2, the Cathode of D1, the Gate of M1, R5 are all connected to the node labeled latch.

This staff ain't hard, you just have to pay attention.
 

Alec_t

Joined Sep 17, 2013
14,330
As I turn the voltage down both fade out and eventually turn off at 6.3V.
Mike, I get exactly that result when I run a sim of your circuit above. The FET isn't turning off when it should. It can be fixed by reducing the gate pull-up (R5) from 10k to 1k.
I also played with your circuit to separate the bias for the two TL431's (to make their adjustment independent) and the two LED functions.
The attached shows a 'before and after' comparison.
Vmon-comparison.gif
 

Thread Starter

julchak

Joined Dec 18, 2014
26
Note that in my schematic, the Anodes of both TL431 connect to the node labeled COM.
The Cathode of the Green LED D2 is connected to the Anode of U1 and the Anode of the Red LED D1.
The Cathode of U2, the Cathode of D1, the Gate of M1, R5 are all connected to the node labeled latch.
Yep I have the TL431's wired correctly, and their anodes both going to COM (which in turn goes to the ground as well).
Hmm...the diagram looks like the Cathode of D2 connects to the Anode of D1 and the Cathode of U1, not the Anode of U1 (based on the orientation of that TL431 symbol), right?
Think I have the connections to Latch also correct.


Mike, I get exactly that result when I run a sim of your circuit above. The FET isn't turning off when it should. It can be fixed by reducing the gate pull-up (R5) from 10k to 1k.
I also played with your circuit to separate the bias for the two TL431's (to make their adjustment independent) and the two LED functions.
Alec, I'll give this one a shot and see if it works any different. Would I put the NO PB from the cathode of U3 to ground like in Mike's circuit? And the NC PB from V2 to R6?

EDIT: Also, Alec, What is D5? Some extra diode or something? I'm trying it without that for now I guess.
 
Last edited:

Thread Starter

julchak

Joined Dec 18, 2014
26
Mike, I get exactly that result when I run a sim of your circuit above. The FET isn't turning off when it should. It can be fixed by reducing the gate pull-up (R5) from 10k to 1k.
I also played with your circuit to separate the bias for the two TL431's (to make their adjustment independent) and the two LED functions.
The attached shows a 'before and after' comparison.
View attachment 78333
So I tested the circuit (without whatever D5 was indicating since I don't have that/wasn't sure what type of diode that was?), and with the NC PB between V2+ and R6, and the NO PB jumping from the cathode of U3 to V2-. My PB placement was probably wrong and I may need that diode I'd guess, because once on both leds are lit (maybe because of the lack of a diode on the red LED circuit? What would I put in there?), when I push the NC PB to turn it off it just momentarily goes off while holding the button and does not stay off. When I lower the input voltage both LEDS stay on until 6.3V when both shut off.

I then tested it without the Pushbuttons, just exactly as you have it, and the same thing with the LEDS both going on and staying on until it gets to 6.3V.

Guessing it is misplacement of the pushbuttons and a lack of the diode you have in there? Right? What diode do I need/is that a diode?
 
Last edited:

MikeML

Joined Oct 2, 2009
5,444
Mike, I get exactly that result when I run a sim of your circuit above. The FET isn't turning off when it should. It can be fixed by reducing the gate pull-up (R5) from 10k to 1k.
When I changed the TL431 Spice model I used previously to a TL431A Spice model instead, I get the same results as you. R5 in the circuit for Julchak should be changed from 10K to 1K.

I bread-boarded the following circuit using some genuine TI TL431AI TO92 parts I had bought from DigiKey. Here is a comparison between the simulation using the TL431A spice model and the real bread-boarded circuit:

TL431swp.gif

For the simulation with a 1K pull-up at R3: A 10mV reduction in V(bat) from 5.834V to 5.824V causes V(k) to go from 2.31V to 5.03V .

For the bread-boarded circuit: A 10mV reduction in V(bat) from 5.80V to 5.79V causes V(k) to go from 2.127V to 4.5V .

This shows the gain of the TL431 when used a an amplifier/comparator. However, it also shows that when the Kathode of the TL431 pulls low, it doesn't pull as low as you would like if you are going to shunt the TL431's Kathode to Anode with a LED to be used as an indicator. The TL431's low voltage (2.31Vsim 2.13Vactual) is not quite low enough to prevent the LED from staying on, especially if the Vf of the LED is about 1.9V which is typical for a Red LED.

Alec's use of D2 (1N914 ) is problematic because its forward drop, even when added to the 1.9Vf of the LED is still not quite enough for the TL431 to shunt the current away from the LED completely. Here is a simulation showing the problem. Note that when V(k) is low, I(D1) is still about 0.3mA, causing the LED to glow dimly. I confirmed this in the bread board.

TL431si.gif

The solution is one I proposed earlier. Put two Red LEDs in series. Only one is used as a visible indicator. The other is used as a low-voltage Zener (Vz=Vf) to prevent any current from flowing through the LEDs when V(k) is low, and can be mounted so that it is not visible. I confirmed that the LEDs turn off cleanly both by simulation and on the breadboard.

TL431ld.gif

Finally, here is a circuit that turns the LED on when V(bat) > 5.83V. R4 is chosen to bypass the residual TL431 current around D1 when V(k) is high:

TL431h.gif

In all of these circuits, the exact trip point of the voltage that the LEDs turn on/off is controlled by the R1-R2 voltage divider. The TL431 switches as the voltage at the R1-R2 tap crosses 2.495V. By adjusting the R1-R2 ratio, the trip point can be moved from 2.5V to ~20V. See the TL431 data sheet.
 

Alec_t

Joined Sep 17, 2013
14,330
with the NC PB between V2+ and R6, and the NO PB jumping from the cathode of U3 to V2-
That's correct.
I may need that diode
Indeed you do need D5 in series with the red LED in my mod of Mike's circuit. Mike's tests show that in reality a normal diode (e.g. 1N914 or 1N4148) doesn't drop quite enough voltage to turn off the red LED completely, so D5 could be another red LED as Mike suggested, or even a series pair of normal diodes.
As for both LEDs being on and the FET not staying off when the button is pressed, component tolerances could account for those effects.
 

Alec_t

Joined Sep 17, 2013
14,330
For the bread-boarded circuit: A 10mV reduction in V(bat) from 5.80V to 5.79V causes V(k) to go from 2.127V to 4.5V
So with the TL431 notionally 'off' there's still a Vgs of ~1.3V. That's enough to keep the FET conducting.
Here's a revised mod, with R13 added to provide a voltage-divider for the gate voltage and hopefully assist turn-off. The second red LED and the push-buttons are also shown.
Vmon-comparison2.gif
 

Thread Starter

julchak

Joined Dec 18, 2014
26
So with the TL431 notionally 'off' there's still a Vgs of ~1.3V. That's enough to keep the FET conducting.
Here's a revised mod, with R13 added to provide a voltage-divider for the gate voltage and hopefully assist turn-off. The second red LED and the push-buttons are also shown.
View attachment 78381
I tested this without R13 about an hour ago (after reading both your input and Mike's regarding the two red LEDs in series) and it seems to work at ambient temperature (with the red LEDs coming on at approximately 7.2V and the system turning off at approximately 6.3V like I want). I am currently testing the system at 15°F to see how it behaves in the cold, as I need it to work at -40°F as well (like we talked about way back when).

Now where I didn't have R13 in the system when I tested/testing now....do I definitely need this? What would it do differently if the system seems to be acting correctly now?

Also is there a temperature concern? Shouldn't be - I think Mike had tested the system at different temperatures in Spice, but I'm testing the breadboard just to make sure.
 

Alec_t

Joined Sep 17, 2013
14,330
Now where I didn't have R13 in the system when I tested/testing now....do I definitely need this? What would it do differently if the system seems to be acting correctly now?
My thinking is that R13 will assist FET turn-off. But hey, if it works without R13 then fine :).
Also is there a temperature concern?
There's ~80mV rise in the switching thresholds going from -40C to +40C according to the sim. See below:-
VmonThresholds-v-Temp.gif
However, there's a snag. You said "I need it to work at -40°F". Unfortunately the rated operating temperature of the usual TL431A (which I guess you have?) only goes down to 25C = -13F. How it would behave at -40F is not known. There is an "I" version of the IC available (TL431AI ?) which is rated down to -40C (= -40F).
 
Last edited:

Thread Starter

julchak

Joined Dec 18, 2014
26
My thinking is that R13 will assist FET turn-off. But hey, if it works without R13 then fine :).
There's ~80mV rise in the switching thresholds going from -40C to +40C according to the sim.
Right, I think Mike had answered that similarly earlier in the thread. So technically it should be fine then.
However, there's a snag. You said "I need it to work at -40°F". Unfortunately the rated operating temperature of the usual TL431A (which I guess you have?) only goes down to 25C = -13F. How it would behave at -40F is not known. There is an "I" version of the IC available (TL431AI ?) which is rated down to -40C (= -40F).
Wow, I lucked out - just checked and it looks like I purchased the TL431BQLPR; can't remember if I looked at the temp rating and that was what made my mind or if it was pure luck...works out though.

I'm running the test off the battery and literally in the freezer since I have no real other way to test this....yep, a breadboard with the device's plastic enclosure/pushbuttons and battery and what not all sitting in the freezer here and me checking on it every once and awhile to see what the voltage is at (have some of the load components attached as well to help drain the battery, but not all of them). Down to 7.45V, just the green LED is on which is good. Hopefully I'll confirm this by the end of the day.

I had to use a 33.25k resistor for R7 in the diagram since I only had a combination of a few others, that seems to work out. I did put two others in series for the 41k (R9), but can't find a single 41k resistor online; closest is a 41.2k....I'll test a 41.2k on the board and see how this acts before going ahead with that.

If need be I'll add in that R13, but as of now like you said Alec, it is looking good.

Thanks again for all your help with this guys! Been a struggle of a project and wouldn't have been able to get it working right without all your help.


-Jeff
 
Top