Electronics > Beginners
Temperature indicator circuit with LEDs
dazz:
I'm trying to build a circuit to monitor the temperature of an IC, it's a TPA3118D2 in a guitar amp. I know I can do this with an Arduino but thought I might try something of my own and see if I can learn something. The sensor is a TMP36 which outputs a voltage between 100mV and 2V, 750 mV at 25°C and each degree Cº increments the output by 10mV.
I attached the schematic of the circuit I came up with. It consists of a voltage amplifying opamp feeding a voltage follower transistor as a current source for the three LEDs, each with different cutoff voltages to have them lit up at different temperatures.
The LTSpice simulation looks ok to me, the green LED reaches 0.5mA and gets lit at about 1V in the input (50ºC), the yellow LED reaches 0.5mA at 1.2V or 70ºC, and the red one at 1.4V / 90ºC
So far I have breadboarded the opamp section, and it's not working at all. I put 0 to 2V in the input through a voltage divider made with a 1M resistor to a 9V battery and a 250K pot to ground. With the pot at 250K I get 1.8V as should be, but as soon as I connect the opamp input to it, the voltage drops to zero and of course nothing at the opamp output either. Aren't opamps supposed to have high impedance inputs? I'm at a loss
Any suggestions please? Thanks.
EDIT: added the LTSpice asc file in case it helps
Zero999:
I couldn't simulate the circuit, because it uses non-standard models and you forgot to include them, which can be done by copying and pasting them into the schematic. Open the model in a text editor, select it all and copy it to the clipboard. Open the schematic in LTSpice, click the ".op" button on the tool bar, paste the model in the text box (model than one model can be pasted, one after the other), click OK and place on a clean part of the schematic.
What op-amp are you using? I notice you're using an idealised op-amp model. Real op-amps don't work like that. Their outputs and inputs don't normally work over the entire supply range.
One possibility is the op-amp's common mode range is being exceeded, which will mean its inputs no longer have a high impedance.
In any case, it's bad design practise to rely on LED forward voltages for thresholds like this, because they vary from one LED to another and the temperature. The correct way is to use a comparator such as the LM339, and a voltage reference (a zener diode will do) to derive the threshold voltages, at which the LEDs turn on.
See the links below, for information on comparators:
https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html
https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html
dazz:
--- Quote from: Hero999 on August 19, 2018, 08:38:08 pm ---I couldn't simulate the circuit, because it uses non-standard models and you forgot to include them, which can be done by copying and pasting them into the schematic. Open the model in a text editor, select it all and copy it to the clipboard. Open the schematic in LTSpice, click the ".op" button on the tool bar, paste the model in the text box (model than one model can be pasted, one after the other), click OK and place on a clean part of the schematic.
What op-amp are you using? I notice you're using an idealised op-amp model. Real op-amps don't work like that. Their outputs and inputs don't normally work over the entire supply range.
--- End quote ---
Yeah, I'm using non standard parts (LEDs & MPSA13 transistor) in standard.dio & standard.bjt, sorry about that.
The non standard models are:
--- Code: ---.MODEL LED_RGYA D (IS=93.1P RS=42M N=4.61 BV=4 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U)
.MODEL MPSA13 NPN (IS=360F NF=1 BF=337 VAF=98.6 IKF=.5 ISE=637F NE=2 BR=4 NR=1 VAR=40 IKR=.75 RE=3.5 RB=14 RC=1.4 XTB=1.5 CJE=133P VJE=.74 MJE=.45 CJC=14.1P VJC=1.1 MJC=.24 TF=1.27323N TR=17.4N)
.model 1N4007 D(IS=7.02767n RS=0.0341512 N=1.80803 EG=1.05743 XTI=5 BV=1000 IBV=5e-08 CJO=1e-11 VJ=0.7 M=0.5 FC=0.5 TT=1e-07 mfg=OnSemi type=silicon)
.MODEL 1N34A D(IS=2.6u RS=6.5 N=1.6 CJO=0.8p EG=0.67 BV=25 IBV=0.003 Type=GePunctualContact)
--- End code ---
The opamp is the UniversalOpamp2 and it's standard.
--- Quote from: Hero999 on August 19, 2018, 08:38:08 pm ---One possibility is the op-amp's common mode range is being exceeded, which will mean its inputs no longer have a high impedance.
--- End quote ---
Thanks, I'll see if I can figure out if that's what's going on here. First lesson learned :-+
--- Quote from: Hero999 on August 19, 2018, 08:38:08 pm ---In any case, it's bad design practise to rely on LED forward voltages for thresholds like this, because they vary from one LED to another and the temperature.
--- End quote ---
...and second lesson learned.
--- Quote from: Hero999 on August 19, 2018, 08:38:08 pm ---The correct way is to use a comparator such as the LM339, and a voltage reference (a zener diode will do) to derive the threshold voltages, at which the LEDs turn on.
See the links below, for information on comparators:
https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html
https://www.electronics-tutorials.ws/opamp/op-amp-comparator.html
--- End quote ---
Great stuff, I'll check that out, thank you
james_s:
You can get LED bargraph driver ICs like the LM3914 that are meant to do exactly what you want. Internally they have a series of comparators and a voltage reference and can be configured to display in either bar or dot mode.
dazz:
How about this design? I'm using 3 NPN transistors to drive the LEDs now, the first one driving the green LED starts conducting at 0.7V (25ºC). The second & third ones take a progressively lower input through the voltage dividers so that they start conducting at a higher input voltage.
I'll breadboard it latter today, but if you guys have any comments that's much appreciated.
I'll be ordering some LM339 to experiment with those, but in the meantime I'd like to try something with what I already have, also I sort of like the idea of LEDs lighting up progressively
Navigation
[0] Message Index
[#] Next page
Go to full version