Electronics

Temperature Sensor Module DYN - DS18B20

AED 12.50

1

Description

The RobotDYN DS18B20 is one of the simplest and least expensive ways to add temperature sensing to your Arduino project. The RobotDYN DS18B20 digital thermometer offers lower trigger points and temperature measurements in the range of 9 to 12 bits in Celsius. These sensors are fairly accurate and don't require any extra parts to function. With just a few connections and some Arduino code, you can start sensing temperature right away because the RobotDYN DS18B20 communicates over a 1-Wire bus, which by definition only needs one data line (and ground) for communication. The RobotDYN DS18B20 sensor can be used to monitor and control a large area because each RobotDYN DS18B20 has a distinct 64-bit serial code that enables multiple RobotDYN DS18B20s to operate on the same 1-Wire bus.

Package Includes:

  • 1x RobotDYN DS18B20 Temperature Sensor Module

Features:

  • Unique 1-Wire® interface requires only one port pin for communication
  • Each device has a unique 64-bit serial code stored in an onboard ROM
  • Can be powered from a data line. The power supply range is 3.0V to 5.5V
  • Measures temperatures from –55°C to +125°C 
  • The module has 2 mounting holes to fix it easily in your project 
  • Thermometer resolution is user-selectable from 9 to 12 bits
  • User-definable nonvolatile (NV) alarm settings with Alarm search command identify devices whose temperature is outside of programmed limits. 

Description:

The RobotDYN DS18B20 digital temperature sensor used in the module is one of the most widely used temperature sensors available produced by Maxim Integrated (formerly Dallas Semiconductor), it offers reasonable accuracy (0.5 °C) over a wide temperature range (-55 °C to + 125 °C). The Sensor Module can be used with both the Arduino (which runs at 5 V) and electronics like the ESP32 and Raspberry Pi, which have 3.3 V GPIO pins because its operating voltage ranges from 3.0 to 5.5 V.One of this sensor's most significant benefits is that it can communicate with the Arduino using just one digital pin. The Sensor Module uses the Dallas Semiconductor 1-Wire® protocol for communication. Similar to I2C in operation, but with a greater operating range and slower data rates. Another benefit is that multiple RobotDYN DS18B20 sensors can operate on a single 1-Wire bus because each RobotDYN DS18B20 Sensor Module has a different 64-bit serial code.

you can use a single Arduino pin to read data from multiple sensors that are connected together. Programmatically, the sensor's resolution can be changed to 9, 10, 11, or 12 bits. This translates into temperatures of 0, 0, 25, 0, 125, and 0, 0635 degrees Celsius, respectively. 12-bit resolution is the initial default setting.

Principle of Work:

The Sensor Module operates using the 1-Wire communication protocol. The other two pins are used for power, and only the data pin needs to be connected to the microcontroller via a pull-up resistor. The pull-up resistor is used to maintain the line's high state when the bus is not in use. A 2-byte register inside the Sensor Module will hold the temperature reading obtained by the sensor. By sending a series of data, this data can be read using the 1-wire method. To read the values, two different types of commands must be sent: a ROM command and a function command. The data sheet below provides the address value and sequence for each ROM memory. To learn how to communicate with the sensor, you must read it. You need not worry about any of these if you intend to interface it with Arduino. To access the data, use the built-in functions and the available library.

Pinout of the Board:

RobotDYN DS18B20 Description
GND GND
Data Connected to any digital pin
VCC 5V


Applications:

  1. Measuring temperature in hard environments
  2. Liquid temperature measurement
  3. Applications where the temperature has to be measured at multiple points

Circuit:

Connect digital pin 2 to the middle pin Out

GND with GND on Arduino 

Vcc to 5V on Arduino

Library: 

You can download the library by clicking here

Once the the.ZIP file is downloaded go to Arduino IDE -> Sketch -> Include Library -> Add.ZIP Library and look for the ZIP file to be installed.

Code:

This code is going to print the Temperature Sensor Module on the Serial Monitor.

#include "OneWire.h"
#include "DallasTemperature.h"

// Define to which pin of the Arduino the 1-Wire bus is connected:
#define ONE_WIRE_BUS 2

// Create a new instance of the oneWire class to communicate with any OneWire device:
OneWire oneWire(ONE_WIRE_BUS);

// Pass the oneWire reference to DallasTemperature library:
DallasTemperature sensors(&oneWire);

void setup() {
  // Begin serial communication at a baud rate of 9600:
  Serial.begin(9600);
  // Start up the library:
  sensors.begin();
}

void loop() {
  // Send the command for all devices on the bus to perform a temperature conversion:
  sensors.requestTemperatures();

  // Fetch the temperature in degrees Celsius for device index:
  float tempC = sensors.getTempCByIndex(0); // the index 0 refers to the first device
  // Fetch the temperature in degrees Fahrenheit for device index:
  float tempF = sensors.getTempFByIndex(0);

  // Print the temperature in Celsius in the Serial Monitor:
  Serial.print("Temperature: ");
  Serial.print(tempC);
  Serial.print(" \xC2\xB0"); // shows degree symbol
  Serial.print("C  |  ");

  // Print the temperature in Fahrenheit
  Serial.print(tempF);
  Serial.print(" \xC2\xB0"); // shows degree symbol
  Serial.println("F");

  // Wait 1 second:
  delay(1000);
}

Technical Details:

  • Programmable Digital Temperature Sensor
  • Communicates using 1-Wire method
  • Operating voltage: 3V to 5V
  • Temperature Range: -55°C to +125°C
  • Accuracy: ±0.5°C
  • Output Resolution: 9-bit to 12-bit (programmable)
  • Unique 64-bit address enables multiplexing
  • Conversion time: 750ms at 12-bit

Resources:

Library

Tutorial

For Temperature Sensor  Arduino Tutorial, please click here

For the Temperature Sensor Raspberry Pi tutorial, please click here

Comparisons:

The Dallas RobotDYN DS18B20 is better to work with than the original bare IC because you have it mounted on a PCB board with mounting holes pin headers and no need for an external resistor also the naming of the pins written on the board, generally, the sensr has a temperature range of -55 – 125° C / ± 0.5° C while in comparison to DHT11 which has a range of 0 – 50° C / ± 2° C the RobotDYN DS18B20 has an extraordinary speed compared to DHT11 but still, the DHT11 can sense the temperature and humidity.

DHT11 Specifications RobotDYN DS18B20
Humidity and temperature Measurement Temperature
0 – 50° C / ± 2° C Temperature Range -55 – 125° C / ± 0.5° C
20 – 80 / ± 5 % Humidity Range Not included
1 wire Communication Protocol  1 wire
1 Hz one reading every second Sampling Rate
3 – 5 V Operating Voltage 3 – 5 V
2.5 mA Minimum current 10 mA