Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Thermistor and Comparator Circuit

Status
Not open for further replies.

vne147

Member
I’m sure this topic has been covered before but I didn’t really find an answer to my specific question when I searched, maybe because I didn’t know the correct key words to search for. Anyway, I’m hoping someone can help me. Here’s what I’m doing.

I am building a temperature sensing circuit that will switch on a heater when it gets below a certain temperature. Yes, I know I can buy something to do this for very little money but I’m building it anyway.

I have an NTC type thermistor that has a resistance of 100k at 25 C but I want to maintain the temp between -5 C and -1 C. At those temps the thermistor has a resistance of 463K - 372K respectively. I’m placing the thermistor in series with another fixed 415k resistor to form a voltage divider that I am then feeding into a comparator which I’m using as a Schmitt trigger to generate a logic signal. The problem is that with my supply voltage of only 5 V and the range of temperature being as small as it is, the input into the comparator only changes by about 300 mV between -5 C and -1 C. I’m uncertain if it’s a good idea to have such a small range between on and off. It seems that the circuit might be more susceptible to noise that way.

Should amplify the voltage from the thermistor before feeding it into the comparator?

If I need to amplify it, what’s the best way? Op amp? Single transistor? Darlington pair?

I have tried to use a circuit like the one shown here as a “Voltage Converter” to amplify the input signal but that didn’t work so well.

Should I use a thermistor with a narrower range?

Should I use a higher supply voltage?

Should I quit electronics and take up knitting?

Here’s the schematic. I haven’t actually tested this circuit yet so if there are any blatant errors, please point them out to me. I hope I supplied all necessary information for a recommendation. Thanks.

Schmitt1.PNG
 
i think that you are being too complicated, there are small 5V relays that you can pick up at just about anny radio shack (or radio crap as some would prefer.) just have your op-amp drive the relay, and if you put avoltage devider and a transistor in there, then you can esily increase the voltage supply to your op-amp. if you keep 5V going into the contacts on the relay to maintain your high/low logic system. if i'm allowed to add my 2 sense in, you need to add a pot to your current circuit (use it to replace your 2 10k resistors), then you'll have some way of adjusting the trigger level, and you can bring your resistances down to a more "sensitive" level.
 
Last edited:
just have your op-amp drive the relay, and if you put avoltage devider and a transistor in there, then you can esily increase the voltage supply to your op-amp.

I don't understand. Where should I put a voltage divider and transistor? Are you saying I should increase the supply voltage to my opamp or the signal voltage?

if i'm allowed to add my 2 sense in, you need to add a pot to your current circuit (use it to replace your 2 10k resistors), then you'll have some way of adjusting the trigger level, and you can bring your resistances down to a more "sensitive" level.

I agree if I would replace the 2 10 kΩ resistors with a pot I would have an adjustable voltage divider at the non-inverting input. However, I want the voltage there to be half of the supply voltage becasue the voltage at the inverting input from the thermnistor/resistor voltage divider will have the greatest "swing" when it is half of the supply voltage. For the circuit I have shown here the farther I take the inverting input away from ½Vs by changing the voltage divider, the less affect the changing resistance of the thermistor will have on voltage between my target temperatures. At least I think that's correct.
 
300mV is alot of voltage to a comparator, so you shouldn't have any issues, assuming you've calculated the 300mV accurately, which I'm not double checking. Just keep in mind that the comparator is high impeadance and so measures to mitigate niose on the input shoud be taken. One possible solution to this issue would be to use an inverting op-amp to read the current thru the themeristor, in front of the comparator. Also, if you use the comparator directly, make sure that input currents don't throw off your calculated values of your input signal.
 
Last edited:
300mV is alot of voltage to a comparator, so you shouldn't have any issues, assuming you've calculated the 300mV accurately, which I'm not double checking. Just keep in mind that the comparator is high impeadance and so measures to mitigate niose on the input shoud be taken. Also, make sure that input currents don't throw off your calculated values of your input signal.

OK, that's good to know. I was uncertain because I have never made this type of circuit before. I'm pretty sure I calculated the 300 mV correctly. It's a simple voltage divider but I wouldn't put it past me to make an error. I'm just hoping I interpreted the datasheet for the **broken link removed** correctly. Page 28 is my part. I used the table from the data sheet to make an excel spreadsheet. It helped me this being the first time of doing this to see it visually.

For mitigating noise on the input signal can I just add a cap between the inverting input and ground like this:

Schmitt2.PNG

Also, how do I make sure the input currents don't throw off my calculated value? Input into what, the thermistor or the comparator? Are you referring to the self heating affect of the thermistor throwing off the temperature calcultion?

Edit: Just out of curiosity, do you work at MSFC?
 
Last edited:
The capacitor might help to mitigate noise. Best to keep the leads from your thermistor short, or if it is to be deployed remotly, use shielded cable to connect it. It would be best to use 2 wire shielded cable and tie the shield to your ground pin. The comparator has non-zero input current, and those are given in the datasheet. Just quicky check that the current through your voltage divider is 5-10 times the input currents and you'll be OK. Take all normal percuations when laying out the circuit/bypassing the supplies, etc.

I don't work at MSFC. Don't even know what that is.
 
Last edited:
The capacitor might help to mitigate noise. Best to keep the leads from your thermistor short, or if it is to be deployed remotly, use shielded cable to connect it. It would be best to use 2 wire shielded cable and tie the shield to your ground pin. The comparator has non-zero input current, and those are given in the datasheet. Just quicky check that the current through your voltage divider is 5-10 times the input currents and you'll be OK. Take all normal percuations when laying out the circuit/bypassing the supplies, etc.

I don't work at MSFC. Don't even know what that is.

MSFC = Marshall Space Flight Center. I saw you were in Hunstville. I thought I'd take a shot in the dark.

I will be deploying the thermistor remotely so thank you for the advice about using shielded cable and tieing the sheild to ground.

I'm not sure to which parameter you are referring to in the datasheet. The only current rating I saw were the maximum output current, the input bias current and the input offset current. I'm not sure if those apply to your statement. Could I just add a resistor between the inverting input and the resistor/thermistor voltage divider if it's too high? Like this:

Schmitt3.PNG

If the inputs are super high impedence, the affect on the voltage divider should be negligible, right?

Edit: I'm using the LM293P, sorry forgot to specify.
 
Last edited:
Maintaining a 4 degree window is going to be difficult considering power supply drift, vref drift over temp along with other tolerances drifting over temp. For your vref pin you be better off using a precision reference voltage IC, take a look here for some idea. Linear Technology - Voltage References
One other thing, your hysteresis feedback resistor seems a magnitude too small, and you also need a pullup on the comparator output. See the data sheet. https://www.electro-tech-online.com/custompdfs/2010/01/LM193.pdf
.
 
Last edited:
Maintaining a 4 degree window is going to be difficult considering power supply drift, vref drift over temp along with other tolerances drifting over temp. For your vref pin you be better off using a precision reference voltage IC, take a look here for some idea. Linear Technology - Voltage References
One other thing, your hysteresis feedback resistor seems a magnitude too small, and you also need a pullup on the comparator output. See the data sheet. https://www.electro-tech-online.com/custompdfs/2010/01/LM193-1.pdf
.

Mike,

You're correct my feedback resistor was a magnitude too small. It was a typo and should have been 950K.

Before your comments I was just planning on using a 7805. I'll check out the voltage references at your link though. Would a 6 - 8 degree window be more realistic. I was also planning on using .1% resistors for the voltage dividers and feedback resistor at the comparator. I'm about to start a whole other thread asking questions about how I plan to power this circuit. Maybe you can check that out too.

Thanks for the input.
 
Maintaining a 4 degree window is going to be difficult considering power supply drift, vref drift over temp along with other tolerances drifting over temp. For your vref pin you be better off using a precision reference voltage IC, take a look here for some idea. Linear Technology - Voltage References
One other thing, your hysteresis feedback resistor seems a magnitude too small, and you also need a pullup on the comparator output. See the data sheet. https://www.electro-tech-online.com/custompdfs/2010/01/LM193-2.pdf
.


Hi Mike,


I hate to disagree but the working of this circuit with reference to the supply voltage tolerance is
ratiometric. That means as long as the thermistor circuit and the voltage divider are both connected
to the same supply the thermistor voltage will track the voltage divider voltage so the circuit should
be ok without too much concern for ultra power supply regulation.
I dont know what kind of overtemp/undertemp setting he is looking for so i cant yet comment about
the hysteresis, although it does look like about 5 percent roughly.

vne:
What temperature do you want to turn on at and what temperature do you want to turn off
at? Did you figure out what voltage those two points come out to yet?
Also, if you intend you drive an output like a transistor you'll most likely need a pullup
resistor too.
 
Last edited:
Hi Mike,


I hate to disagree but the working of this circuit with reference to the supply voltage tolerance is
ratiometric. That means as long as the thermistor circuit and the voltage divider are both connected
to the same supply the thermistor voltage will track the voltage divider voltage so the circuit should
be ok without too much concern for ultra power supply regulation.
I dont know what kind of overtemp/undertemp setting he is looking for so i cant yet comment about
the hysteresis, although it does look like about 5 percent roughly.

vne:
What temperature do you want to turn on at and what temperature do you want to turn off
at? Did you figure out what voltage those two points come out to yet?
Also, if you intend you drive an output like a transistor you'll most likely need a pullup
resistor too.

Al,

I want to maintian the temperature as close to -3 C as possible. I have figured out the voltages at -5 C and -1 C. They are 2.37 V and 2.65 V respectively. I sized the feedback resistor so that the hysteresis band (if that's even the right term) would be from 2.37 to 2.63 volts. So, if I'm right the heater should turn on just below -5 and turn off just above -1.

I understand what you're saying about the voltages being ratiometric. That makes sense.

The output of the comparator will be input into a NOR gate who's output will in turn drive an opto-coupler and triac arranegement. Do I still require pull up resistors?

Thanks.
 
The comparator you are using is open collector, so you need a pull up, look at data sheet.
 
MSFC = Marshall Space Flight Center. I saw you were in Hunstville. I thought I'd take a shot in the dark.


I'm not sure to which parameter you are referring to in the datasheet. The only current rating I saw were the maximum output current, the input bias current and the input offset current. I'm not sure if those apply to your statement. Could I just add a resistor between the inverting input and the resistor/thermistor voltage divider if it's too high? Like this:


If the inputs are super high impedence, the affect on the voltage divider should be negligible, right?

Edit: I'm using the LM293P, sorry forgot to specify.

Generally speaking, if the inputs are high-Z, then the effect on the divider is negligible. But it's always worth the few seconds it takes to check. The current through your divider is about 6mA, and the input bias currents are 25nA, so they are negligable. But don't always assume that's the case. It all depends on the inpeadance of your network and your device. So, you're good to go.

We have Marshall Space Flight Center and Redstone Arsenal here. I don't work at either place. The last job I had here got offshored, so I'm trying to find work as a consultant. Tried of doing the corporate prison thing. I was close to closing a contract a few weeks ago, but I didn't have a current security clearance. Bummer.
 
Last edited:
Generally speaking, if the inputs are high-Z, then the effect on the divider is negligible. But it's always worth the few seconds it takes to check. The current through your divider is about 6mA, and the input bias currents are 25nA, so they are negligable. But don't always assume that's the case. It all depends on the inpeadance of your network and your device. So, you're good to go.

We have Marshall Space Flight Center and Redstone Arsenal here. I don't work at either place. The last job I had here got offshored, so I'm trying to find work as a consultant. Tried of doing the corporate prison thing. I was close to closing a contract a few weeks ago, but I didn't have a current security clearance. Bummer.

OK, so I won't worry about input current effect on my voltage divider as it seems there's about a 6 order of magnitude difference there. It's a good thing to consider though and I'll make sure in the future that I'm good from that stand point.

That sucks about the security clearance. It seems there's a lot of jobs out there that require one but you can't get one until you have a job that requires one. It's a real chicken and the egg situation. I've had one for several years now and it's more a pain in the butt than anything else. I have to renew it every 2 years an do all this BS paperwork and I still know nothing about Roswell.;)
 
I was close to closing a contract a few weeks ago, but I didn't have a current security clearance. Bummer.

You can have a security check performed by a private firm. A TS will cost you big bucks.
 
You can have a security check performed by a private firm. A TS will cost you big bucks.

Didn't know that. All my clearances have come thorugh the military and now my current employer. Luckily I haven't had to shell out a dime for it. Just spend hours on tedious paperwork. It is kind of amusing though when you get a phone call from an old friend that you haven't spoken to in 10 years and they tell you someone called them asking about you.
 
You know of course that likely means that there is a government employee that monitors your posts here from time to time.
<waves to the snoops>
And I don't mean snoops in a bad way =)
 
Yes I'm aware. Whenever I log into the network at work, there is a big splash screen that pops up and says "WARNING! All activity on this computer is subject to government monitoring. Not expectation of privacy should be assumed or is implied, blah, blah, blah. From time to time I will check the site when I get a free moment at work so I figure that some IT weenie somewhere knows of it. It's a good thing designing bad comparitor circuits isn't a threat to national security.;)
 
Last edited:
While I'm a big supporter (in my heart at least) of privacy of an individual as a right, I also believe an innocent person has nothing to hide, so I wouldn't mind that kind of personal inspection, if it were required for clearance for a job or what not. Personal curiosity wishes I knew why you had the clearance though =)
 
While I'm a big supporter (in my heart at least) of privacy of an individual as a right, I also believe an innocent person has nothing to hide, so I wouldn't mind that kind of personal inspection, if it were required for clearance for a job or what not. Personal curiosity wishes I knew why you had the clearance though =)

Many US Government contracting jobs require a clearance, such as confidential, secret, and top secret. I had a secret clearance in the Navy and it helped me get my first civilian job at Allied Bendix, we were building equipment for military use. I could give you more details but then I would have to kill ya :)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top