Continuing education

MCU projects

Amateur radio

Broadcast radio

High voltage



Refrigerator LM35 Analog Temperature Controller

Just like my Digital Soldering Station Controller, this project happened because of the hot summer in the city. A few days ago our refrigerator just died. That's right, no more cool drinks. An autopsy revealed that only the temperature control part had died. My attempts to call the company and get a new part came to nothing as they not only wanted $80-plus for the new regulator, they also insisted on installing it and charging me for it. Well, to make the long story short, I figured it was far more cost effective to solder one together myself. This is my Refrigerator Temperature Controller story.

I have to start off by saying that the circuit below is not mine. I have no idea who the original author is. I have used it several times in the past with 100% success. This time I only employed a different temperature sensor and other modern components that I happened to have at hand. The schematic below is so simple, it speaks for itself. Clicking on it lets you see a larger version of it. Basically, a LM35 Centigrade temperature sensor 10mV/C° output voltage signal is compared against that of TL431-generated reference. A hysteresis-enabled comparator (second half of LM358 Op-Amp) then turns the relay on or off. The first half of LM358 buffers the reference output. Even though in the linear mode LM358 common-mode input voltage includes ground, in the interest of universality, it's better to give the circuit some "headroom". That's what the diodes D4, D5 do.

Choosing the relay was a bit of a nail biter. Nothing, other than the all-ubiquitous "MADE IN CHINA", was written on the old control so I have no idea what the original contacts current rating was. I couldn't find any info on the compressor motor either so I used a beefy OMRON G4W-1112P relay, just in case. Hope its contacts hold up.

For powering the circuit I used an external 12V DC wall wart. Mine outputs 300 mA max and came from a junked V-Tech wireless phone desk cradle.

Here I took some quickie pictures. The relay and the circuit board are both mounted on a piece of black plastic I happened to have. At first I planned to have the temperature sensor mounted there, too. Later it was found that the energized relay created enough heat to throw off the sensor reading. I decided to relocate the sensor further away from the circuit board.

Being that the refrigerator defrosts itself from time to time, and sometimes the draining funnel overflows, I didn't want any water to get on my circuit. I opted for placing everything in an empty plastic spice container, cut open from the bottom for easy access. Here you can see the "early development" version of the breadboard, the LM35 being mounted on the right. As it turned out, the relay generated some heat, all of which stayed in the plastic bubble and made for an offset in temperature reading. The current version (see picture above) places the sensor well away from the circuit.

Is that a ship in the bottle? But where are the sails? Wait, could it be a circuit in the bottle?

Well, that's exactly what it is, it's the finished circuit in the bottle. Or should I say, the installation in the bottle. The gadget mounts on the back wall of the refrigerator main compartment where the original controller had been. I made both the power wiring as well as the sensor exit holes in the plastic a little lower than the circuit itself. This ensures that even with water dripping on wires, it won't run inside and get on the components.

When I opened the door to snap the picture, the plastic fogged over. That is why the red LED looks a little blurred. And since it's on, the compressor must be running.


Performance check

How well does it all work? To see that, I had temporarily equipped the fridge with a logging device, a DS1820 1-wire digital sensor connected to my laptop. The sensor was programmed to take a temperature sample every 30 seconds and send the result to a MySQL database. Below is the display chart constructed from that data. The chart can be enlarged by clicking on it.

What does the chart tell us? If we look at the second half, we can see that the temperature has pretty much stabilized between the 2.31° C and 2.00° C marks. Counting the time ticks gives us approximately 360 seconds of compressor run time and 210 seconds of idle. So the compressor works for 6 minutes and then stays off for the next 3.5 minutes. Hope that is not too much switching for it. I had planned for a half a degree of temperature hysteresis but in reality it turned out to be less, about 0.31° C degrees. This can be attributed to non-ideal Op-Amp. If I had stabilized the Op-Amp's Vdd and used something better than the common LM358, say a really good one, TI's Rail-To-Rail LM7322, I'm sure the hysteresis would have been right on the money. But mine is just a very simple circuit utilizing components from my junk box. I think it actually gives a pretty good account of itself, given its simplicity. That's all, folks!


Stay cool, 73 de Brian.