DS18B20 Temperature Sensor Module

In this experiment, we will learn how to use the DS18B20 module to test the ambient temperature and make a thermometer.
Since the previous output of the temperature sensor is analog. It is therefore necessary to add a/D and D/a chips in the line transformation. In addition, the external Arduino port is not resource rich and the usage rate is not high. So we create the Ds18b20 module.

The new DS18B20 temperature sensor module is very effective in solving the problem. It has the characteristic of the economy, unique 1-wire bus and full application of the Arduino platform.
Users can easily form a network of sensors using this module.
Product settings

  • Temperature range:-55 to 125 °c
  • Typical accuracy: 0.5 °c
  • Resolution: 9-12 bits, depending on the program

Required component:
(1) x Arduino Uno R3
(1) x USB cable
(1) x DS18B20 module
(x) x F-M wires

Component Introduction

The DS18B20 module uses a single bus. The supply voltage range from 3.0 V to 5.5 V and no standby power source. It can measure a temperature range from-55 to 125 degrees with an accuracy of/-0.5 °c.
The programmable DPI of the temperature sensor is 9 to 12. The temperature conversion is 12 digits type of network. The maximum is 750 milliseconds. Families can be set non-volatile temperature settings.
Each DS18B20 contains a unique serial number that allows multiple DS18B20 to operate on a bus.

Schematic link Wiring diagram

DS18B20 Temperature Sensor Module Wiring diagram
DS18B20 Temperature Sensor Module Wiring diagram

The temperature sensor can detect the temperature in several places at the same time.
Download the program then open the monitor, we can see the data as below:

Before you start, download and unzip the following libraries at /Progam Files(x86)/Arduino/Libraries (default), in order to use the sensor with the Arduino board.

// First we include the libraries
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices
// (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup(void)
// start serial port
Serial.println(“Dallas Temperature IC Control Library Demo”);
// Start up the library
void loop(void)
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print(” Requesting temperatures…”);
sensors.requestTemperatures(); // Send the command to get temperature readings
Serial.print(“Temperature is: “);
Serial.print(sensors.getTempCByIndex(0)); // Why “byIndex”?
// You can have more than one DS18B20 on the same bus.
// 0 refers to the first IC on the wire

Show Buttons
Hide Buttons