0% found this document useful (0 votes)
98 views4 pages

DS18B20 Temperature Sensor Module

This module uses a DS18B20 temperature sensor chip to measure temperature in the range of -55°C to 125°C with an accuracy of +/-0.5°C. It requires a 5V power supply and outputs the analog temperature signal on pin "S" while pin "R" is for power and pin "G" is ground. An example Arduino code uses the OneWire and DallasTemperature libraries to read the temperature from the DS18B20 sensor.

Uploaded by

john
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views4 pages

DS18B20 Temperature Sensor Module

This module uses a DS18B20 temperature sensor chip to measure temperature in the range of -55°C to 125°C with an accuracy of +/-0.5°C. It requires a 5V power supply and outputs the analog temperature signal on pin "S" while pin "R" is for power and pin "G" is ground. An example Arduino code uses the OneWire and DallasTemperature libraries to read the temperature from the DS18B20 sensor.

Uploaded by

john
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DS18B20 Temperature Sensor Module

DESCRIPTION:
This module is temperature sensor with chipDS18B20, It’s different from other
NTC- MF523950 temperature sensor(ST1147) or LM35 temperature sensor(SE039).

Specification:
● Chip : DS18B20

● Temperature Range : -55℃~+125℃


● Accpply : +/-0.5℃
● Supply voltage : 5V DC

PIN CONFIGURATION:

1、 “S”: Analog output pin,real-time output voltage signal


2、 “R” : +5V
3、 “G” :GND

1/4
Example:
This is a simple code for the DS18B20 temperature module, Wire as below:

Code:
// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 10 on the Arduino


#define ONE_WIRE_BUS 10

// 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);

/*
* The setup function. We only start the sensors here
2/4
*/
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");

// Start up the library


sensors.begin();
}

/*
* Main function, get and show the temperature
*/
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 temperatures
Serial.println("DONE");
// After we got the temperatures, we can print them here.
// We use the function ByIndex, and as an example get the temperature from the
first sensor only.
Serial.print("Temperature for the device 1 (index 0) is: ");
Serial.println(sensors.getTempCByIndex(0));
}

3/4
Result:

4/4

You might also like