December 19, 2010

Arduino + Dallas one-wire temperature sensor

Planning to play with thermometers, I've bought some Dallas 1-wire sensors: DS18B20 (plenty of examples on the web).

The sensor pinout is the following one (from the official datasheet):



The sensors are to be used in bus configuration:



with a 4K7 (or less, in case of long bus wires) pull-up resistor on the data line.

After breadboarding, I'm ready to play with this excellent "Dallas Temperature" Arduino library:



Here's the code I've used to play on the breadboard (showing temperatures through the Serial Monitor on Arduino IDE):

 DallasTemperatureSensors.pde
(compiled with Arduino IDE 0022)

UPDATED:

I've also added an external LCD to have a first version of a working thermometer (more thermometers to come...):