This demo i will going to show you how to wire the DS18B20 Temperature Sensor on Arduino using library to communicate and acquire a data on DS18B20 Dallas Semiconductor Temperature Sensor.
The DS18B20 is a three pin transistor like chip, The Dallas Semiconductor Temperature Sensor has its own temperature and decoding library you can download the source code library at the download page.
Wiring the module to Arduino
Manual Wiring of the DS18B20 Chip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
/* Thi code will display the temperature in Celsius from a single temperature sensor in the Serial Monitor Window */ #include <OneWire.h> #include <DallasTemperature.h> const int PinBus = 10; OneWire bus(PinBus); DallasTemperature sensor(&bus); DeviceAddress sensor; void setup() { Serial.begin(9600); sensor.begin(); if (!sensors.getAddress(sensor, 0)) { Serial.println("No Temperature Sensor Found!") } } void loop() { sensors.requestTeperature(); float tempC = sensors.getTempC(sensor); Serial.println(tempC); delay(1000); } |
How to wire the DS18B20 Temperature Sensor Module on Arduino