C-code example for a temperature controlled relay for an LM74.

Thread Starter

sht11help

Joined Mar 4, 2009
1
Hi all, a destressed electronics student here;
I need some C-code examples of when the LM74 detects a temperature higher than the preset level set at e.g. 40 deg, a relay is switched on. Then when the temperature falls below the preset temperature, the relay is switched off.
Or anything similar to this would be a great help…
Iv been searching the net but can’t find anything, so would appreciate some help from you guys please.

Regards
Arthur
 

beenthere

Joined Apr 20, 2004
15,819
One reads the signal with the A to D converter. When the value exceeds some preset number, turn off the heat. An LM311 voltage comparator could do as well.
 

AlexR

Joined Jan 16, 2008
732
An LM311 voltage comparator could do as well.
Not if you're using an LM74 as your sensor it couldn't.

An LM74 has in internal a temperature sensor and A/D converter that interfaces to the outside world via a SPI bus. To get any data out of the device you need to interface it to some sort of microprocessor/microcontroller.

Once you get the digitized data into your microcontroller switching the relay for a given temperature range is a trivial problem.
 
Top