DS1820

The DS1820, DS1822 and DS18B20 are one-wire temperature sensors with 9-12 bit resolution, which can operate using only two wires (ground and data).

Hello World

Import programDS1820_HelloWorld

DS1820 Hello World

Library

Import libraryDS1820

Library for reading temperature from DS1820, DS18B20 and DS1822

Pinout

Datasheet

http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf

Notes

The library shown above is simple in usage, however it does not allow for all features of the original library, which you can find here:

Import libraryDS1820

Dallas / Maxim DS1820 1-Wire library. For communication with multiple DS1820 on a single 1-Wire bus. Also supports DS18S20 and DS18B20. This fork fixes a timing problem I had with latest mbed library; allows immediate return from convert_temperature(); tidies up a few other things, including some documentation errors.