Introduction
The geek inside me has always wanted a fridge that shows the inside temperature for both the freezer and the fridge compartments. However, when we recently replaced our very old fridge we ended up getting a new one without the built in thermometer. So I decided that one of my next projects would have to rectify this problem.
The geek inside me has always wanted a fridge that shows the inside temperature for both the freezer and the fridge compartments. However, when we recently replaced our very old fridge we ended up getting a new one without the built in thermometer. So I decided that one of my next projects would have to rectify this problem.
Hardware
Since all I wanted was to show two different temperatures,
the circuit is very simple. It contains the temperature sensors, the display
modules and a microcontroller to manage some simple tasks.
The microcontroller of choice was a PIC16F886 because I had
used it for some experiments and wanted to build it into something. It has all
the functions I needed, e.g. an internal oscillator to cut down on external
parts needed, a timer for refreshing the display, enough digital I/O lines for
connecting to two display modules without extra hardware.
The display modules are some common cathode 4 digit 7
segment ones. The advantage of these common cathode (or anode) modules is that
they use less microcontroller I/O lines then ordinary 7 segment modules. The
drawback is that the software is a little more complex since the displayed
values must constantly be refreshed. At any given time there is only one digit
displayed, all the others are off. Displaying 8 digits for 1ms each means that
refreshing rate is about 8ms, or 125Hz. This is fast enough for the human eye
to not see separate digits flashing but a constant set of characters.
The temperature sensing part I used for this project is a high-precision
1-Wire digital thermometer chip from Dallas Semiconductors. There are a number
of similar ones available; I used the DS1820 because I have a few of them left
over from previous projects. This one uses the 1-Wire protocol to communicate
with the PIC, doesn’t need any external components and it’s easy to be placed
inside a fridge.
The 1-Wire protocol allows many 1-Wire devices to use the same data line but
the software overhead is so high (at least in assembly) that I decided to use
two separate lines for the two thermometers. This is not the most elegant thing
to do but I didn’t find any assembly code on the internet I could steal
borrow. Having two 1-Wire lines made my code a lot longer than it could be but
this time I had plenty of program memory in the PIC. This chip provides the results
of the measurements in Celsius format.
Of course, a mandatory ICSP header is also included on the
board, just in case.
I tend to use as many SMD parts as I can to save on PCB size
and make it look nicer. This time, however, the PIC I used is a TTH version
because I had that already and wanted to use it up.
Operation
After connecting the circuit to power (>7.5VDC, a 7805 regulator is on board) first it does a display test for a few seconds then it starts normal operation. Temperature is measured about once per second.
After connecting the circuit to power (>7.5VDC, a 7805 regulator is on board) first it does a display test for a few seconds then it starts normal operation. Temperature is measured about once per second.
At the moment the resolution of the temperature displayed is
0.5C. This can be further refined from software. I might do it in the future,
but for now I am eager to get it in the fridge and the living room.
Enclosure
This time I decided to put the PCB behind a modified transparent photograph holder which I got for about half a euro in the local stationery store: First I cut off the rear part of the plexiglass (that normally would hold the photograph against the front one), then I drilled 4 holes into the front one and with the help of some long screws I mounted the circuit behind it.
This time I decided to put the PCB behind a modified transparent photograph holder which I got for about half a euro in the local stationery store: First I cut off the rear part of the plexiglass (that normally would hold the photograph against the front one), then I drilled 4 holes into the front one and with the help of some long screws I mounted the circuit behind it.
![]() |
| Here you can see easily how I mounted the PCB on the back of the clear plexiglass. |
Note on comments
I will not see comments left on other sites that might feature this article, so if you want me to read your comments, please leave them here. I love receiving comments on my projects and I always answer them.
I will not see comments left on other sites that might feature this article, so if you want me to read your comments, please leave them here. I love receiving comments on my projects and I always answer them.



Nice project !
ReplyDeleteDo you plan to publish the software source code?
Greetings from Germany
Eric
@Anonymous: I'm afraid I won't put the code on the site but if you send me a private mail I will send it to you.
ReplyDeleteI would like to see the code to, i have a project with I-button and a PIC32 going on.
DeleteNice projekt btw, From Denmark
@Anonymous: I'm afraid I won't put the code on the site but if you send me a private mail I will send it to you.
DeleteVitya, how is DS1820 and the wiring holding up in the fridge so far? I mean, it's a pretty humid place, how did you seal it? I'm thinking of building a similar device where I would need to see the temperature difference between the inside the house and outside (an experiment having to do with the house insulation). How far from the PIC the DS1820 can be located, do you know?
DeleteAnd I also need to ask about the code: will you make it available at some point in the future? I will definitely need to make changes because I would need it to show not only the two temperatures but also the difference between them (so I don't have to carry a calculator around).
Keep up great work!
Cheers!
@ElectroNick: They look OK so far. I sealed only the pins of the DS1820 with hot glue. I forgot to mention this in the article. Also, as it turns out, you have to be careful with it - if you fiddle around with the hot glue too much, the chip overheats and looses its calibration (which I don't know how to fix, if it is possible at all). I found this out the hard way - now I have a DS1820 which about 60 degrees off... :(
Delete@ElectroNick: The cable I am using is about 2 meters - I don't know the limit, but it's much longer than if I used a sensor with analog output.
Delete