DS18B20 Thermometer

This very simple project shows how to use a DS18B20 temperature sensor to make a thermometer. It is based on the 1-wire application note.

You can download the full article and source codes using the following link:



DS18B20 Thermometer - Revision 1.3, 2012-08-25

1. Schematic


The LED digits are not multiplexed. The 1-wire device is connected to the microcontroller using two simple resistors.

The pull-up resistor R15 is used to power the sensor. The microcontroller will also be used to draw current during temperature conversion, and it's why R16 is added, in order to limit the current in case of shortcut on the 1-wire device.

The components are connected on the breadboard of a simple protoshield.

2. Software architecture


The DS18B20 Thermometer uses the DS18B20 functions of the 1-wire library to get and display the current temperature according to the following schema.

The application performs several initializations and finally reads and displays the temperature in an infinite loop.

Conclusion


This project shows how to use a DS18B20 temperature sensor to make a thermometer. This project is interesting for beginners who want to start programming and debugging on Freescale microcontrollers by creating a very simple application.