Digital Thermometer

The Dallas Semiconductor DS18B20 is a 12-bit resolution temperature sensor that interfaces to a microcontroller via the Dallas 1-Wire bus. I have written three MC68HC11 programs that display temperature to one tenth degree Fahrenheit on a 4 digit 7-segment LED display, a plotting program or a PC terminal screen. Get more information and the code.

I've ported the 1-wire code to the new MC9S12DP256. This program displays to a LCD on the MC9S12DP256 Development board, DRAGON12, from WYTEC.  There is a photo on my USB page.  Source code in same zip as above.

I recently ported my DS18B20 software to the new Freescale MC9S08QG8.  This little 16-pin gem has 8K of flash memory and a great many peripherals.
Click for larger view The DS18B20 is in a TO-92 package and in most cases you would want to remove it from the printed circuit board out to free air.  I use a three position Molex type socket.  If you can't get a sample the lowest price with free shipping I've found is $1.11 at several sites on eBay.  Or ElectroDragon.

Here is how someone else did it.  Or here.
Here is an interesting product from China.

Sparkfun recently introduced a sealed  DS18B20 temperature probe that lets you precisely measure temperatures in wet environments.  It has a six fool long cable.  Adafruit has a similar one.  Or Maker Shed.  Or SK Pang in UK.  Or Suntec Store in Hong Kong. Brewers Hardware has a number of different temperature sensor assemblies.  As does

Click for larger view In this photo you can see the MC9S08QG8 in a solderless breadboard with the temperature sensor six inches out the back of the enclosure.  The CPU displays the temperature on a four digit LED board controlled by a MC14489 driver.

The display board is a DB1 NUMERIC

Click for larger view The enclosure is a CM5-125 from Pactec.  I bought it from Mouser.  I believe the 150X5 from SIMCO and the Bud PC-11402 are equivalent.

The red color acrylic lens/filter has a special non-glare surface to make viewing easier.

Click for larger view Here is a picture of the completed project.  All of the photos are un-retouched available light.   The lens/filter causes the red digits to appear to float on a black background.  It makes an attractive appearance.

The MC9S08QG8 is a great chip but it does require a 3.3 volt supply.  The MC14489 requires 5 volts so we need two voltage regulators.  Here is the schematic and the software.  (Note that the program, on power-up, first sends out some data on the none implemented serial port.  The display starts after 5 seconds.)  The DB1 board uses a 3.3 K ohm resistor to set the LED current at the low end of the usable range.  This is fine for my breadboard which uses a 78L05 regulator.  If you like a "light up the room" bright display you can use a heftier regulator and choose a lower value for the current setting resistor.

Click for larger view I decided to design a printed circuit board to run this and other MC9S08QG8 projects.  To the left is a bare board leaning against a completed project.  If you click on the thumbnail you will get a very high resolution photo.

The MC9S08QG8 project board  is for sale.
Check the ordering page.

Click for larger view Here is the MC9S08QG8 project board populated with just the parts needed for the digital thermometer project.  Notice the one amp 5 volt regulator as well as the 100 ma 3.3 volt low dropout regulator.

There are also parts for a RS-232 interface that are not needed for just the temperature display.

Click for larger view Here is the board mounted in the CM5-125 enclosure.  Two holes in the project board fit mounting bosses in the enclosure.  Also visible are the DB1 display board and the red lens/filter.
Click for larger view Here we have added the wires for signal and power and the back panel with the DB9 RS-232 plug.


Click for larger view Here is the back side with the DS18B20 temperature sensor, power jack and optional RS-232 interface.

Click for larger view Here is another project using the Dallas Semiconductor DS18B20 temperature sensor  and the  MC9S08QG8 project board .  The software for the sensor is the same as above but now the output is directed to a LCD using my SPI to LCD interface.  I haven't found an enclosure for the project that I really like.  If anyone has a suggestion please send me an email.

Here is the software.

Click for larger view

Click here for a low battery power wireless temperature sensor using a DS18B20 and a XBee


Roger's Embedded Microcontrollers Home Page   

This page written by Roger Schaefer. Last updated September 9, 2014