ICE Alert - Thermistor circuit question - Page 1
Forum section: electronics / beginners

author: hgg
author_rank: Frequent Contributor
timestamp: November 17, 2013, 05:26:31 pm
content: Hi,I want to build a circuit that will alert you of icy roads. I am using the LM311 and a thermistoras the outside probe. I've already made the circuit and when the temperature goes below acertain level it will light up an LED. The first low temperature will be 3 degrees Celsius. Thenif the temperature falls below 0 degrees I would like to switch on another LED. I will useanother LM311 with the thermistor output connected in parallel with the first and a differentreference voltage.My question is, do you know an easy way to switch off the first LED when the second comparator(and LED) is triggered?ICE AlertThanks.

author: codeboy2k
author_rank: Super Contributor
timestamp: November 18, 2013, 01:14:08 pm
content: I haven't tested this, but something as simple as this circuit I drew might work..Basically, the comparators are as you described. When the second comparator turns on, the second led, LED2, will turn on and raise the base of Q1 up to the VFof the LED. Q1 will turn on and steal about 250uA or so from LED2 to saturate and sink up to 12-15mA of current away from the other LED. The LED1 will go off. You can fine tune the Q1 base transistor and make it lower if you find that Q1 is not saturating. If you make it too low you will have to change the LED resistor, but you should not need to make it much lower than it already is.

author: madires
author_rank: Super Contributor
timestamp: November 18, 2013, 01:48:41 pm
content: I'd suggest to put a PNP in series with the 3° LED and to add a base resistor connected to the output of the 0° comparator. When the 0° output is low the PNP will pass current for the 3° LED, if the 0° output is high it won't. If you like to reduce the current draw of the circuit with the LEDs not lit drive the LEDs via transistors (large pull-up resistor, e.g. 47k).

author: hgg
author_rank: Frequent Contributor
timestamp: November 18, 2013, 02:04:08 pm
content: codeboy2kHello,Good idea. If I understand correctly, when the second comparator is triggered, it will sink to groundthe LED anode and that will turn it off, correct? I will try it out.madires, you are right about current draw. I found out after I read more about comparators.I might rearrange the circuit in order to power on the LEDs when the outputs of the comparatorsare grounded.I will try both suggestions. Thank you for your help!

author: codeboy2k
author_rank: Super Contributor
timestamp: November 18, 2013, 02:18:27 pm
content: Quote from: madires on November 18, 2013, 01:48:41 pmMadires' suggestion is much better than mine.Looking at my schematic drawing as a guide, just make Q1 a PNP as madires says, and put it in series with the LED1, emitter up towards the 12V rail (the 3C LED).

author: hgg
author_rank: Frequent Contributor
timestamp: November 18, 2013, 03:01:16 pm
content: I will try it out!By the way, very nice schematic output. What software did you use?

author: codeboy2k
author_rank: Super Contributor
timestamp: November 18, 2013, 03:22:03 pm
content: That's done with Digikey's Scheme-It on the webhttp://www.digikey.com/schemeitIt's quirky, but fast for one-shot online schematics.

author: hgg
author_rank: Frequent Contributor
timestamp: November 18, 2013, 03:24:47 pm
content: Very nice, thanks again.

author: madires
author_rank: Super Contributor
timestamp: November 18, 2013, 05:00:41 pm
content: Quote from: hgg on November 18, 2013, 02:04:08 pmYep, most comparators got an open collector output. They aren't OPamps :-)

author: free_electron
author_rank: Super Contributor
timestamp: November 18, 2013, 06:48:03 pm
content: that is not an ice detector ....here is the problem : airflow under the car will give a cooling effect giving false positive.there may actually be warmer air under the car , but the road may still be at sub-zero and covered in ice , giving a false negative !Real ice detectors use an infrared beam and measure reflectivity combined with a pyroelectric pickup cell to measure surface temperature.

author: tszaboo
author_rank: Super Contributor
timestamp: November 18, 2013, 07:01:46 pm
content: RS flip-flop.NAND gate.

author: hgg
author_rank: Frequent Contributor
timestamp: November 18, 2013, 08:40:21 pm
content: free-electron, what you suggest is more sophisticated and more complicated but I want just a simpleindicator that there might be frost on the road surface. I've read many forum discussions on thesubject and no definite answer for an accurate measurement of temperature on a moving vehicle.Even if you measure 0 degrees on the road, that does not mean that there is ice. The best indicatoris your eyesight. If you spot black shadows, water marks that look still or very shiny patches thenthere is definitely danger ahead...I did some tests with a thermometer and a very fast fan and with an ambient temperature of 18degrees, I get around one degree difference when the fan is blowing. I will take that into accountwhen I create the voltage reference values. From what I saw, the thermistor is very accurate andextremely fast.

author: free_electron
author_rank: Super Contributor
timestamp: November 18, 2013, 10:55:31 pm
content: Quote from: hgg on November 18, 2013, 08:40:21 pmthat is why you need BOTH sensors.the pyroelectric sensor will detect road temperature. if that is 0 degree or below then the IR backscatter is measured.if backscatter is present then there is ice.BOTH sensors need to give a positive result for there to be ice.

author: Falcon69
author_rank: Super Contributor
timestamp: November 19, 2013, 12:02:33 am
content: Or you could do it the simple truck driver's way...If you can see water flaring up off the tires from the car in front of you, there's no ice.If you don't see any water, there's ice.Simple, and you don't need all this electronic stuff.

author: hgg
author_rank: Frequent Contributor
timestamp: November 19, 2013, 08:21:27 am
content: free_electronby the time ice is detected is too late...That is why I need just a warning indicator when the temperature falls in the 'dangerous' zone.It will beep some times and then the LEDs will light up to tell you approximately the temperaturerange. Having said that, your suggestion is nice and I will try it in the future to see howaccurate it can be.Falcon69exactly. A few small observations will tell you if there are icy conditions on the road.I am just making the sensor just in case of the morning that I am still sleeping in the car...Now I have to find out how to make it beep 3 times only in the first temperature drop and notany more until power off...

author: jeremy
author_rank: Super Contributor
timestamp: November 19, 2013, 09:48:18 am
content: I agree with free_electron, the only way you can *really* know there is ice is by measuring the optical properties of the road surface. But thermistor would be fine as a warning.Or you could just get a thermal camera already

author: hgg
author_rank: Frequent Contributor
timestamp: November 19, 2013, 11:54:14 am
content: The exact temperature is not so critical in my opinion....but I have another problem now...I have rearranged the circuit feeding the reference voltage to the positive input of the comparatorand the thermistor divider to the negative input now. The current consumption this time is waybetter, but...When the temperature falls below 3 degrees the comparator's output is grounded and the LEDlights up, but when the temperature is above the reference then the output is floating and theLED is off. Almost... The LED actually instead of going off completely, it remains 'slightly' on!Very annoying!Why is this happening? Is there any easy fix without using a transistor?ICE Alert 2In the datasheet of LM311 it actually shows that the output can be a collector or emitter!LM311 output

author: Zero999
author_rank: Super Contributor
timestamp: November 19, 2013, 12:59:29 pm
content: Quote from: free_electron on November 18, 2013, 10:55:31 pmThat'll only tell you if there's frost immediately under the car, 100m away the road surface could be slightly colder or warmer.

author: madires
author_rank: Super Contributor
timestamp: November 19, 2013, 04:49:41 pm
content: Quote from: hgg on November 19, 2013, 11:54:14 amCould you please try a high value resistor between the LM311's output and 12V (in parallel to R6 and the LED).

author: hgg
author_rank: Frequent Contributor
timestamp: November 19, 2013, 05:26:01 pm
content: madiresHi,I just tried a 4.7K and the LED goes off normally, but then it oscillates when its trying to switch on again.A 680K resistor makes no change at all. A 2.2K resistor worked perfectly...Why is this? Is this the proper way to do it?Now I get double the current draw when the LED is on, but its ok I guess.

author: madires
author_rank: Super Contributor
timestamp: November 19, 2013, 05:48:42 pm
content: Quote from: hgg on November 19, 2013, 05:26:01 pmIf you change the value of the feedback resistor R1 back to 10k it might work also with a larger pull-up resistor, but I'm not sure. I think the problem has to do with the open collector output and the feedback.QuoteThat's why a driver transistor is the best solution :-)

author: hgg
author_rank: Frequent Contributor
timestamp: November 19, 2013, 05:59:56 pm
content: I might use a transistor if I don't find any other solution.Strange problem. Maybe the LM311 needs balancing.

author: codeboy2k
author_rank: Super Contributor
timestamp: November 19, 2013, 09:43:09 pm
content: Quote from: hgg on November 19, 2013, 11:54:14 amIf you tie pin7 (the collector output) high through a pullup, and use pin 1 (labelled GND) as the output, you can get an emitter output from the device that can go active high, and floating when low.You can drive your LED active high this way and that should eliminate the turnoff problem. So you could put the 2.2k LED resistor directly on the output pin 7, and put the LED anode on pin 1 (GND) and put the cathode on your circuit GND. That is now your transistor output, you don't actually need an external one.Note from the datasheet: *Input polarity is reversed when using pin 1 as output.^^^^ which is fine, since you already reversed the inputs:QuoteAlso, since reading the datasheet more closely, I see that a 5ma sink from the strobe pin will TURN OFF the output. You can use this to disable the first 3C output when the second 0C output is turned on, by taking a few uA from the second output to turn on a transistor that sinks 5mA from the strobe pin of the first comparator. See below:The resistor on the strobe is 2.7k assuming that you are feeding the V+ and V- with 12V and 0V (GND). That should give a sink current of about 4-5mA. If the first LED does not turn off hard enough, then you are not sinking enough current from the strobe, so make the 2.7k into a 2.2k, and finally try 1.5 or 1k. Although I think that 2.7k is fine. You can also measure the current being sunk from the strobe pin on the first comparator using your multimeter. It should be between 2 to 5mA to turn off the output.

author: hgg
author_rank: Frequent Contributor
timestamp: November 20, 2013, 08:41:14 am
content: codeboy2kwicked way to do it, but it works wellOnly downside is that is consumes 5mA with both LEDs off and if I use large enough resistors todim the LEDs, they switch on gradually. Not a real problem though, you can call it a feature.It is stable and does not have any oscillations.Only thing that remains is an accurate calibration.Thank you very much for the help!

author: codeboy2k
author_rank: Super Contributor
timestamp: November 20, 2013, 09:53:13 am
content: Hey good that it's working for you. Don't know why it's still drawing 5ma when it's off. is that current through the resistor and diode?You're welcome!Cheers!

author: hgg
author_rank: Frequent Contributor
timestamp: November 20, 2013, 10:42:04 am
content: It looks like its from the two reference adjustment pots.When the LEDs are on, the consumption goes up just a little.