Fridge thermostat


This circuit is based around the PIC 16C84 (or PIC 16F84) microcontroller. This chip is actually a small computer contained in a single chip, including RAM memory, EEPROM, I/O ports, CPU and so on. When you buy this chip, it comes empty with no program on it. You have to compile the source code and download the resulting machine code into it, using a PC and a small programmer attached to the parallel port of the PC and the chip. To get yourself familiar with this stuff, I suggest you first read this link: Getting started with microcontrollers.

The circuit is a fridge thermostat with one-button operation.
The thermostat is specially designed to be an electronic replacement for a defective mechanical fridge thermostat, though it might also be used for other purposes.
A 7-segment LED display shows the current temperature setting of the thermostat in degrees celcius. Pressing the button shortly increments this setting with one degree. Setting range is from 0 to 9 degrees. There is a special setting, 'F', which is the defrosting mode (fridge is put off). Pressing and holding the button for 3 seconds puts the thermostat in hysteresis setting mode. This mode has four settings, d (disabled, no hysteresis), L (low), n (normal) and H (high). These settings will be scrolled through by pressing the button shortly. It controls the hysteresis of the thermostat. Pressing and holding the button for 3 seconds again will put the device back to temperature setting mode.
Every four seconds, the units of the currently measured temperature are breafly showed. For example, if the temperature measured is 12 degrees celsius, a '2' will be flashing every four seconds.
The circuit uses a DS1820 as a digital temperature sensor. More information about this chip is available at Dallas semi conductors.
Furthermore, to save the compressor of the fridge, the minimum time period (being on or off) is always 5 minutes so the compressor will not be put on too close after being put off or vice versa.
To help the automatic defrosting process, the thermostat will put the fridge off for 5 minutes if it is already on for half an hour.
The software includes the use of the pic's watchdog should the software or hardware fail for any reason. In this case, the device will be automatically reset.
With thanks to Steve Marchant for the interfacing-to-the-DS1820 part of the software.

Schematic diagram

List of components

Circuit explanation:

The 7-segment LED display is connected to ports RB0..RB6 which are configured as outputs. The Dallas DS1820 digital temperature sensor is connected to port RA3, which is sometimes input, sometimes output (2 way data stream) controlled by the software.
The relay is controlled by port RA0 (configured as output).

Source code for this project

Some pictures:

Device mounted in fridge.

  Home         Back to Electronic Projects