<p>DS18B20 Temperature Sensor Module is a digital temperature sensor , and you can easily connect it to Arduino with only one 4.7-pound resistor, base 1 – Ground 2 – Output – Base 3 to the positive of the source, with resistance to base 2 Is connected. The connection of this sensor to the Arduino via the 1-wire protocol is established. Therefore, several sensors can be connected only through one common wire to Arduino. The output is digitally accurate to 12 bits. Therefore, the temperature can be measured with a precision of 0.0625 º C.</p> <div><strong>Applications:</strong></div> <div> </div> <div>DS18B20 Temperature Sensor is suitable for the cold storage, granaries, storage tanks, telecommunications room, electric power room, cable trough, and other temperature measurement and control areas; bearing, cylinder, textile machinery, air conditioning, and other small space industrial equipment temperature and control; , Refrigerator, freezer, and low-temperature drying oven, etc. heating/cooling pipe calorie measurement, central air conditioning household thermal energy measurement and industrial temperature measurement and control and Many more..</div> <hr /> <h4><strong>Features:</strong></h4> <p> </p> <ol> <li>Digital signal output</li> <li>18B20 Temperature Sensor Chip</li> <li>Resolution adjustment ranges from 9-12 bytes.</li> <li>Send data via a pin</li> <li>Temperature measurement ranges: -55°C to +125°C, be accurate to 0.5°C.</li> </ol> <hr /> <h4><strong>Package Includes:</strong></h4> <p>1 x DS18B20 Temperature Sensor Module</p>
Pin Connections Table 1
Board Sensor Pin Connection DS18B20 Module VCC/GND/DATA 3.3-5V / GND / board data pin
DS18B20 Temperature Sensor Module - Arduino Uno
DS18B20 Temperature Sensor Module - Arduino Nano
DS18B20 Temperature Sensor Module - Arduino Mega
DS18B20 Temperature Sensor Module - ESP32
DS18B20 Temperature Sensor Module - ESP8266
DS18B20 Temperature Sensor Module - STM32
DS18B20 Temperature Sensor Module - Raspberry Pi Pico
1 //ekostra.com
2 //electronics store in egypt
3 //+201008896258
4
5 // OneWire data pin 2 on Arduino Uno. Needs a 4. 7k pull-up resistor between data and VCC.
6 #include <OneWire.h>
7 #include <DallasTemperature.h>
8
9 #define ONE_WIRE_BUS 2
10 OneWire oneWire(ONE_WIRE_BUS);
11 DallasTemperature sensors(&oneWire);
12
13 void setup () {
14 Serial.begin (115200 );
15 sensors.begin();
16 }
17
18 void loop () {
19 sensors.requestTemperatures();
20 float tempC = sensors.getTempCByIndex(0 );
21
22 if (tempC == DEVICE_DISCONNECTED_C) {
23 Serial.println ("Error: DS18B20 not found - check wiring/pull-up resistor.");
24 } else {
25 Serial.print ("Temperature: "); Serial.print (tempC); Serial.println (" C");
26 }
27
28 delay (1000 );
29 }
1 //ekostra.com
2 //electronics store in egypt
3 //+201008896258
4
5 // OneWire data pin 2 on Arduino Nano. Needs a 4. 7k pull-up resistor between data and VCC.
6 #include <OneWire.h>
7 #include <DallasTemperature.h>
8
9 #define ONE_WIRE_BUS 2
10 OneWire oneWire(ONE_WIRE_BUS);
11 DallasTemperature sensors(&oneWire);
12
13 void setup () {
14 Serial.begin (115200 );
15 sensors.begin();
16 }
17
18 void loop () {
19 sensors.requestTemperatures();
20 float tempC = sensors.getTempCByIndex(0 );
21
22 if (tempC == DEVICE_DISCONNECTED_C) {
23 Serial.println ("Error: DS18B20 not found - check wiring/pull-up resistor.");
24 } else {
25 Serial.print ("Temperature: "); Serial.print (tempC); Serial.println (" C");
26 }
27
28 delay (1000 );
29 }
1 //ekostra.com
2 //electronics store in egypt
3 //+201008896258
4
5 // OneWire data pin 2 on Arduino Mega. Needs a 4. 7k pull-up resistor between data and VCC.
6 #include <OneWire.h>
7 #include <DallasTemperature.h>
8
9 #define ONE_WIRE_BUS 2
10 OneWire oneWire(ONE_WIRE_BUS);
11 DallasTemperature sensors(&oneWire);
12
13 void setup () {
14 Serial.begin (115200 );
15 sensors.begin();
16 }
17
18 void loop () {
19 sensors.requestTemperatures();
20 float tempC = sensors.getTempCByIndex(0 );
21
22 if (tempC == DEVICE_DISCONNECTED_C) {
23 Serial.println ("Error: DS18B20 not found - check wiring/pull-up resistor.");
24 } else {
25 Serial.print ("Temperature: "); Serial.print (tempC); Serial.println (" C");
26 }
27
28 delay (1000 );
29 }
1 //ekostra.com
2 //electronics store in egypt
3 //+201008896258
4
5 // OneWire data pin 4 on ESP32. Needs a 4. 7k pull-up resistor between data and VCC.
6 #include <OneWire.h>
7 #include <DallasTemperature.h>
8
9 #define ONE_WIRE_BUS 4
10 OneWire oneWire(ONE_WIRE_BUS);
11 DallasTemperature sensors(&oneWire);
12
13 void setup () {
14 Serial.begin (115200 );
15 sensors.begin();
16 }
17
18 void loop () {
19 sensors.requestTemperatures();
20 float tempC = sensors.getTempCByIndex(0 );
21
22 if (tempC == DEVICE_DISCONNECTED_C) {
23 Serial.println ("Error: DS18B20 not found - check wiring/pull-up resistor.");
24 } else {
25 Serial.print ("Temperature: "); Serial.print (tempC); Serial.println (" C");
26 }
27
28 delay (1000 );
29 }
1 //ekostra.com
2 //electronics store in egypt
3 //+201008896258
4
5 // OneWire data pin D4 on ESP8266. Needs a 4. 7k pull-up resistor between data and VCC.
6 #include <OneWire.h>
7 #include <DallasTemperature.h>
8
9 #define ONE_WIRE_BUS D4
10 OneWire oneWire(ONE_WIRE_BUS);
11 DallasTemperature sensors(&oneWire);
12
13 void setup () {
14 Serial.begin (115200 );
15 sensors.begin();
16 }
17
18 void loop () {
19 sensors.requestTemperatures();
20 float tempC = sensors.getTempCByIndex(0 );
21
22 if (tempC == DEVICE_DISCONNECTED_C) {
23 Serial.println ("Error: DS18B20 not found - check wiring/pull-up resistor.");
24 } else {
25 Serial.print ("Temperature: "); Serial.print (tempC); Serial.println (" C");
26 }
27
28 delay (1000 );
29 }
1 //ekostra.com
2 //electronics store in egypt
3 //+201008896258
4
5 // OneWire data pin PB4 on STM32. Needs a 4. 7k pull-up resistor between data and VCC.
6 #include <OneWire.h>
7 #include <DallasTemperature.h>
8
9 #define ONE_WIRE_BUS PB4
10 OneWire oneWire(ONE_WIRE_BUS);
11 DallasTemperature sensors(&oneWire);
12
13 void setup () {
14 Serial.begin (115200 );
15 sensors.begin();
16 }
17
18 void loop () {
19 sensors.requestTemperatures();
20 float tempC = sensors.getTempCByIndex(0 );
21
22 if (tempC == DEVICE_DISCONNECTED_C) {
23 Serial.println ("Error: DS18B20 not found - check wiring/pull-up resistor.");
24 } else {
25 Serial.print ("Temperature: "); Serial.print (tempC); Serial.println (" C");
26 }
27
28 delay (1000 );
29 }
1 //ekostra.com
2 //electronics store in egypt
3 //+201008896258
4
5 // OneWire data pin 2 on Raspberry Pi Pico. Needs a 4. 7k pull-up resistor between data and VCC.
6 #include <OneWire.h>
7 #include <DallasTemperature.h>
8
9 #define ONE_WIRE_BUS 2
10 OneWire oneWire(ONE_WIRE_BUS);
11 DallasTemperature sensors(&oneWire);
12
13 void setup () {
14 Serial.begin (115200 );
15 sensors.begin();
16 }
17
18 void loop () {
19 sensors.requestTemperatures();
20 float tempC = sensors.getTempCByIndex(0 );
21
22 if (tempC == DEVICE_DISCONNECTED_C) {
23 Serial.println ("Error: DS18B20 not found - check wiring/pull-up resistor.");
24 } else {
25 Serial.print ("Temperature: "); Serial.print (tempC); Serial.println (" C");
26 }
27
28 delay (1000 );
29 }
Project Notes: OneWire digital temperature sensor, breakout module (has its own pull-up resistor onboard on most versions - add an external one if readings are unstable).