Tuesday, March 14, 2017

Dallas 18B20 temperature sensor



Intro

The Dallas 18B20 is probably the most common temperature sensor in the Arduino community. It's cheep, it's small and part of many Arduino startet kits.

Wiring


The left pin is the Ground (GND) pin. The middle is the data line. We connect the data line to digital pin 2 (D2). The right pin can be connected to 3V3 or to 5V. And since this sensor works on the 1-wire bus, we have to connect the data line also to VCC though a 4.7kOhm resistor.

Video


Here is the Video of the process.


Code

 Just install a library for the Dallas sensor and open the simple sketch
DallasTemperature library

The simple sketch
 If you run the serial monitor, you can see the actual temperature.

No comments:

Post a Comment