0% found this document useful (0 votes)
89 views

ESP8266 DS18B20 Sensor Web Server Arduino IDE

This document is a comprehensive guide on using the DS18B20 temperature sensor with the ESP8266 and Arduino IDE, covering wiring, library installation, and coding for both single and multiple sensors. It explains how to read temperature data and display it on a web server. Additionally, it includes details on required components and installation steps for necessary libraries to facilitate the project.

Uploaded by

Techno Genisys
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)
89 views

ESP8266 DS18B20 Sensor Web Server Arduino IDE

This document is a comprehensive guide on using the DS18B20 temperature sensor with the ESP8266 and Arduino IDE, covering wiring, library installation, and coding for both single and multiple sensors. It explains how to read temperature data and display it on a web server. Additionally, it includes details on required components and installation steps for necessary libraries to facilitate the project.

Uploaded by

Techno Genisys
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/ 201

6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

ESP8266 DS18B20 Temperature Sensor with Arduino


IDE (Single, Multiple, Web Server)

This is a in-depth guide for the DS18B20 temperature sensor with ESP8266 using Arduino IDE. We’ll
cover how to wire the sensor, install the required libraries, and write the code to get the sensor readings
from one and multiple sensors. Finally, we’ll build a simple web server to display the sensor readings.

Throughout this tutorial we’ll cover the following topics:

1. Read temperature from one DS18B20 temperature sensor;


2. Read temperature from multiple DS18B20 temperature sensors;
3. Display DS18B20 sensor readings on a web server.

You might also like reading other DS18B20 guides:

ESP32 DS18B20 Temperature Sensor with Arduino IDE


ESP32/ESP8266 DS18B20 Temperature Sensor with MicroPython
ESP32 with Multiple DS18B20 Temperature Sensors
DS18B20 Temperature Sensor with Arduino

Learn more about the ESP8266 with our course: Home Automation using ESP8266.

Introducing DS18B20 Temperature Sensor

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 1/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

The DS18B20 temperature sensor is a one-wire digital temperature sensor. This means that it just
requires one data line (and GND) to communicate with your ESP8266.

It can be powered by an external power supply or it can derive power from the data line (called
“parasite mode”), which eliminates the need for an external power supply.

Each DS18B20 temperature sensor has a unique 64-bit serial code. This allows you to wire multiple
sensors to the same data wire. So, you can get temperature from multiple sensors using just one GPIO.

The DS18B20 temperature sensor is also available in waterproof version.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 2/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Here’s a summary of the most relevant specs of the DS18B20 temperature sensor:

Communicates over one-wire bus


Power supply range: 3.0V to 5.5V
Operating temperature range: -55ºC to +125ºC
Accuracy +/-0.5 ºC (between the range -10ºC to 85ºC)

For more information consult the DS18B20 datasheet.

Parts Required
To complete this tutorial you need the following components:

ESP8266 – read Best ESP8266 Wi-Fi Development Boards


DS18B20 temperature sensor (one or multiple sensors) – waterproof version
4.7k Ohm Resistor
Breadboard
Jumper wires

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your
projects at the best price!

ESP8266 with DS18B20 Schematic Diagram

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 3/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

As mentioned previously, the DS18B20 temperature sensor can be powered through the VDD pin
(normal mode), or it can derive its power from the data line (parasite mode). You can choose either
modes.

Parasite Mode

Normal Mode

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 4/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Note: in this tutorial we’re connecting the DS18B20 data line to GPIO 4 , but you can use any other
suitable GPIO.

Read our ESP8266 GPIO Reference Guide to learn more about the ESP8266 GPIOs.

Note: if you’re using an ESP-01, GPIO 2 is the most suitable pin to connect to the DS18B20 data
pin.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 5/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Preparing Your Arduino IDE


We’ll program the ESP8266 using Arduino IDE, so make sure you have the ESP8266 add-on installed
before proceeding:

Install ESP8266 Board in Arduino IDE (Windows, Mac OS X, and Linux instructions)

Installing Libraries for DS18B20


To interface with the DS18B20 temperature sensor, you need to install the One Wire library by Paul
Stoffregen and the Dallas Temperature library. Follow the next steps to install those libraries.

1. Open your Arduino IDE and go to Sketch > Include Library > Manage Libraries. The Library
Manager should open.

2. Type “onewire” in the search box and install the OneWire library by Paul Stoffregen.

3. Then, search for “Dallas” and install the Dallas Temperature library by Miles Burton.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 6/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

After installing the libraries, restart your Arduino IDE.

Code (Single DS18B20)


After installing the required libraries, you can upload the following code to the ESP8266. The code
reads temperature from the DS18B20 temperature sensor and displays the readings on the Arduino IDE
Serial Monitor.

/*********
Rui Santos
Complete project details at https://RandomNerdTutorials.com
*********/

#include <OneWire.h>
#include <DallasTemperature.h>

// GPIO where the DS18B20 is connected to


const int oneWireBus = 4;

// Setup a oneWire instance to communicate with any OneWire devices


OneWire oneWire(oneWireBus);

// Pass our oneWire reference to Dallas Temperature sensor


https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 7/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

DallasTemperature sensors(&oneWire);

void setup() {
// Start the Serial Monitor
Serial.begin(115200);
// Start the DS18B20 sensor
sensors.begin();
}

void loop() {
sensors.requestTemperatures();
float temperatureC = sensors.getTempCByIndex(0);

View raw code

There are many different ways to get the temperature from DS18B20 temperature sensors. However, if
you’re using just one single sensor, this is one of the easiest and simplest ways.

How the Code Works


Start by including the OneWire and the DallasTemperature libraries.

#include <OneWire.h>
#include <DallasTemperature.h>

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 8/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Create the instances needed for the temperature sensor. The temperature sensor is connected to
GPIO 4 .

// GPIO where the DS18B20 is connected to


const int oneWireBus = 4;
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(oneWireBus);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);

In the setup() , initialize the Serial Monitor at a baud rate of 115200.

Serial.begin(115200);

Initialize the DS18B20 temperature sensor:

sensors.begin();

Before actually getting the temperature, you need to call the requestTemperatures() method.

sensors.requestTemperatures();

Then, get the temperature in Celsius by using the getTempCByIndex() method as shown below:

float temperatureC = sensors.getTempCByIndex(0);

Or use the getTempFByIndex() to get the temperature in Fahrenheit.

float temperatureF = sensors.getTempFByIndex(0);

The getTempCByIndex() and the getTempFByIndex() methods accept the index of the temperature
sensor. Because we’re using just one sensor its index is 0. If you want to read more than one sensor,
you use index 0 for one sensor, index 1 for other sensor and so on.

Finally, print the results in the Serial Monitor.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 9/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Serial.print(temperatureC);
Serial.println("ºC");
Serial.print(temperatureF);
Serial.println("ºF");

New temperature readings are requested every 5 seconds.

delay(5000);

Demonstration
After uploading the code, open the Arduino IDE Serial Monitor at a 9600 baud rate. You should get the
temperature displayed in both Celsius and Fahrenheit:

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 10/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Getting Temperature from Multiple DS18B20


Temperature Sensors

The DS18B20 temperature sensor communicates using one-wire protocol and each sensor has a unique
64-bit serial code, so you can read the temperature from multiple sensors using just one single digital
Pin.

Schematic
To read the temperature from multiple sensors, you just need to wire all data lines together as shown in
the next schematic diagram:

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 11/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Code (Multiple DS18B20s)


Then, upload the following code. It scans for all devices on GPIO 4 and prints the temperature for
each one. This sketch is based on the example provided by the DallasTemperature library.

/*********
Rui Santos
Complete project details at https://RandomNerdTutorials.com
*********/

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged TO GPIO 4


#define ONE_WIRE_BUS 4

// Setup a oneWire instance to communicate with any OneWire devices (not


OneWire oneWire(ONE_WIRE_BUS);

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 12/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

// Pass our oneWire reference to Dallas Temperature.


DallasTemperature sensors(&oneWire);

// Number of temperature devices found


int numberOfDevices;

// We'll use this variable to store a found device address


DeviceAddress tempDeviceAddress;

void setup(){
// start serial port
Serial.begin(115200);

View raw code

How the code works


The code uses several useful methods to handle multiple DS18B20 sensors.

You use the getDeviceCount() method to get the number of DS18B20 sensors on the data line.

numberOfDevices = sensors.getDeviceCount();

The getAddress() method finds the sensors addresses:

if(sensors.getAddress(tempDeviceAddress, i)){

The address is unique for each sensor. So each sensor can be identified by its address.

Then, you use the getTempC() method that accepts as argument the device address. With this method,
you can get the temperature from a specific sensor:

float tempC = sensors.getTempC(tempDeviceAddress);

To get the temperature in Fahrenheit degrees, you can use the getTemF() . Alternatively, you can
convert the temperature in Celsius to Fahrenheit as follows:

DallasTemperature::toFahrenheit(tempC)
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 13/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Demonstration
After uploading the code, open your Serial Monitor at a baud rate of 115200. You should get all your
sensors readings displayed as shown below:

Display DS18B20 Temperature Readings in a Web Server


To build the web server we’ll use the ESPAsyncWebServer library that provides an easy way to build
an asynchronous web server. Building an asynchronous web server has several advantages. We
recommend taking a quick look at the library documentation on its GitHub page.

Installing the ESPAsyncWebServer library


The ESPAsyncWebServer library is not available to install in the Arduino IDE Library Manager. So,
you need to install it manually.

Follow the next steps to install the ESPAsyncWebServer library:

1. Click here to download the ESPAsyncWebServer library. You should have a .zip folder in your
Downloads folder
2. Unzip the .zip folder and you should get ESPAsyncWebServer-master folder
3. Rename your folder from ESPAsyncWebServer-master to ESPAsyncWebServer
4. Move the ESPAsyncWebServer folder to your Arduino IDE installation libraries folder
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 14/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Installing the ESPAsync TCP Library


The ESPAsyncWebServer library requires the ESPAsyncTCP library to work. Follow the next steps to
install that library:

1. Click here to download the ESPAsyncTCP library. You should have a .zip folder in your
Downloads folder
2. Unzip the .zip folder and you should get ESPAsyncTCP-master folder
3. Rename your folder from ESPAsyncTCP-master to ESPAsyncTCP
4. Move the ESPAsyncTCP folder to your Arduino IDE installation libraries folder
5. Finally, re-open your Arduino IDE

Code (DS18B20 Async Web Server)


Open your Arduino IDE and copy the following code.

/*********
Rui Santos
Complete project details at https://RandomNerdTutorials.com
*********/

// Import required libraries


#ifdef ESP32
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#else
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <Hash.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>S
#endif
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is connected to GPIO 4


#define ONE_WIRE_BUS 4

// Setup a oneWire instance to communicate with any OneWire devices


OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature sensor


DallasTemperature sensors(&oneWire);

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 15/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

View raw code

Insert your network credentials in the following variables, and the code will work straight away.

const char* ssid = "REPLACE_WITH_YOUR_SSID";


const char* password = "REPLACE_WITH_YOUR_PASSWORD";

How the Code Works


In the following paragraphs we’ll explain how the code works. Keep reading if you want to learn more
or jump to the “Demonstration” section to see the final result.

Importing libraries
First, import the required libraries.

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <Hash.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <OneWire.h>
#include <DallasTemperature.h>

Instantiate DS18B20 Sensor


Define the GPIO that the DS18B20 data pin is connected to. In this case, it’s connected to GPIO 4
(D1).

#define ONE_WIRE_BUS 4

Instantiate the instances needed to initialize the sensor:

// Setup a oneWire instance to communicate with any OneWire devices


OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature sensor


DallasTemperature sensors(&oneWire);

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 16/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Create variables that will hold the temperature and humidity as String values:

String temperatureF = "";


String temperatureC = "";

We’ll get new sensor readings every 30 seconds. You can change that in the timerDelay variable.

unsigned long lastTime = 0;


unsigned long timerDelay = 30000;

Setting your network credentials


Insert your network credentials in the following variables, so that the ESP8266 can connect to your
local network.

const char* ssid = "REPLACE_WITH_YOUR_SSID";


const char* password = "REPLACE_WITH_YOUR_PASSWORD";

Create an AsyncWebServer object on port 80.

AsyncWebServer server(80);

Read Temperature Functions


Then, we create two functions to read the temperature.

The readDSTemperatureC() function returns the readings in Celsius degrees.

String readDSTemperatureC() {
// Call sensors.requestTemperatures() to issue a global temperature and
sensors.requestTemperatures();
float tempC = sensors.getTempCByIndex(0);

if(tempC == -127.00){
Serial.println("Failed to read from DS18B20 sensor");
return "--";
} else {
Serial.print("Temperature Celsius: ");
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 17/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Serial.println(tempC);
}
return String(tempC);
}

In case the sensor is not able to get a valid reading, it returns -127. So, we have an if statement that
returns two dashes (–-) in case the sensor fails to get the readings.

if(tempC == -127.00){
Serial.println("Failed to read from DS18B20 sensor");
return "--";

The reaDSTemperatureF() function works in a similar way but returns the readings in Fahrenheit
degrees.

The readings are returned as string type. To convert a float to a string, use the String() function.

return String(tempC);

Building the Web Page


The next step is building the web page. The HTML and CSS needed to build the web page are saved on
the index_html variable.

In the HTML text we have TEMPERATUREC and TEMPERATUREF between % signs. This is a placeholder
for the temperature values.

This means that this %TEMPERATUREC% text is like a variable that will be replaced by the actual
temperature value from the sensor. The placeholders on the HTML text should go between % signs.

We’ve explained in great detail how the HTML and CSS used in this web server works in a previous
tutorial. So, if you want to learn more, refer to the next project:

DHT11/DHT22 Temperature and Humidity Web Server with Arduino IDE

Processor
Now, we need to create the processor() function, that will replace the placeholders in our HTML text
with the actual temperature values.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 18/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

// Replaces placeholder with DS18B20 values


String processor(const String& var){
//Serial.println(var);
if(var == "TEMPERATUREC"){
return temperatureC;
}
else if(var == "TEMPERATUREF"){
return temperatureF;
}
return String();
}

When the web page is requested, we check if the HTML has any placeholders. If it finds the
%TEMPERATUREC% placeholder, we return the temperature in Celsius by calling the
readDSTemperatureC() function created previously.

if(var == "TEMPERATUREC"){
return temperatureC;
}

If the placeholder is %TEMPERATUREF% , we return the temperature in Fahrenheit.

else if(var == "TEMPERATUREF"){


return temperatureF;
}

setup()
In the setup() , initialize the Serial Monitor for debugging purposes.

Serial.begin(115200);

Initialize the DS18B20 temperature sensor.

sensors.begin();

Get the current temperature values:


https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 19/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

temperatureC = readDSTemperatureC();
temperatureF = readDSTemperatureF();

Connect to your local network and print the ESP8266 IP address.

WiFi.begin(ssid, password);
Serial.println("Connecting to WiFi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();

// Print ESP8266 Local IP Address


Serial.println(WiFi.localIP());

Finally, add the next lines of code to handle the web server.

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){


request->send_P(200, "text/html", index_html, processor);
});
server.on("/temperaturec", HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, "text/plain", temperatureC.c_str());
});
server.on("/temperaturef", HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, "text/plain", temperatureF.c_str());
});

When we make a request on the root URL, we send the HTML text that is stored in the index_html
variable. We also need to pass the processor function, that will replace all the placeholders with the
right values.

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){


request->send_P(200, "text/html", index_html, processor);
});

We need to add two additional handlers to update the temperature readings. When we receive a request
on the /temperaturec URL, we simply need to send the updated temperature value. It is plain text, and
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 20/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

it should be sent as a char, so, we use the c_str() method.

server.on("/temperaturec", HTTP_GET, [](AsyncWebServerRequest *request){


request->send_P(200, "text/plain", temperatureC.c_str());
});

The same process is repeated for the temperature in Fahrenheit.

server.on("/temperaturef", HTTP_GET, [](AsyncWebServerRequest *request){


request->send_P(200, "text/plain", temperatureF.c_str());
});

Lastly, we can start the server.

server.begin();

In the loop() , update the temperature values every 30 seconds ( timerDelay variable).

void loop(){
if ((millis() - lastTime) > timerDelay) {
temperatureC = readDSTemperatureC();
temperatureF = readDSTemperatureF();
lastTime = millis();
}
}

That’s pretty much how the code works.

Demonstration
After uploading the code, open the Arduino IDE Serial Monitor at a baud rate of 115200. After a few
seconds your IP address should show up.

In your local network, open a browser and type the ESP8266 IP address.

Now you can see temperature in Celsius and Fahrenheit in your web server. The sensor readings update
automatically without the need to refresh the web page.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 21/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Wrapping Up
This was an in-depth guide on how to use the DS18B20 temperature sensor with the ESP8266 and
display the readings on a web server.

The DS18B20 communicates via one-wire protocol and each sensor has a unique 64-bit serial code,
which means you can read many sensors on the same data pin.

We hope you’ve found this tutorial useful. We have other tutorials with the ESP8266 that you may also
like:

ESP8266 with BME280 using Arduino IDE (Pressure, Temperature, Humidity)


ESP8266: DHT Temperature and Humidity Readings in OLED Display
ESP8266 0.96 inch OLED Display with Arduino IDE
ESP8266 DHT11/DHT22 Temperature and Humidity Web Server with Arduino IDE

Learn more about the ESP8266 with Home Automation using ESP8266 (eBook + Video Course).

Thanks for reading.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 22/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

[eBook] Build Web Servers with ESP32 and ESP8266


(2nd Edition)

Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor
sensors remotely. Learn HTML, CSS, JavaScript and client-server communication
protocols DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and
Node-RED.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 23/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Home Automation using ESP8266 eBook and video course » Build IoT and home automation
projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior
experience!

What to Read Next…

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 24/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

ESP8266 NodeMCU HTTP POST with Arduino IDE (ThingSpeak and IFTTT.com)

Getting Started with ESP-NOW (ESP8266 NodeMCU with Arduino IDE)

ESP32 HTTP GET and HTTP POST with Arduino IDE (JSON, URL Encoded, Text)

Enjoyed this project? Stay updated by subscribing our newsletter!

Your Email Address

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 25/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

SUBSCRIBE

178 thoughts on “ESP8266 DS18B20 Temperature Sensor


with Arduino IDE (Single, Multiple, Web Server)”

Jasmin
August 5, 2016 at 11:45 am

Hey cool – a Pampers way to proceed! Thanks!

Reply

Rui Santos
August 8, 2016 at 12:10 pm

You’re welcome Jasmin!

Reply

Rick
August 5, 2016 at 12:22 pm

Great! Thanks for this tutorial.

Reply

Rui Santos
August 8, 2016 at 12:11 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 26/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

You’re welcome. Thank you for reading,


Rui

Reply

JvG
August 5, 2016 at 12:23 pm

Cool item, like to see more of this and if I may,… some more articles with ESP modules
in low power/power save mode (where the whole solution is powered by 1 18650 battery…

Reply

Rui Santos
August 8, 2016 at 12:11 pm

Thanks for the great suggestion!

Reply

Jerry
August 5, 2016 at 1:04 pm

Hi, thanks for the neat project, it looks very useful, and I may well build one of these for
outdoor temp while we are living in our motor home this winter. Question though, could one
add another sensor of the same kind for outdoor and use one for indoor?? Thus two Dallas
temp sensors? Also could one also add a LCD display to display the temps locally as well as
on the network?

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 27/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Rui Santos
August 8, 2016 at 12:12 pm

Yes, you can add as many sensors as you want. I kinda talk about that subject in this blog
post: https://randomnerdtutorials.com/guide-for-ds18b20-temperature-sensor-with-arduino/

Reply

Tom
August 8, 2016 at 5:41 pm

I’m using this with a Wemos D1 Mini with battery shield and SD card, works well!
Would love to see more code for more than one DS18B20 sensor!
Thanks!

Reply

Serafino Convertini
August 5, 2016 at 2:51 pm

Hi, if I try to compile this code on my IDE I get this error:

Temperature_Sensor:17: error: ‘D1’ was not declared in this scope

#define ONE_WIRE_BUS D1

It seems that D1 is not recognize. What do you think about?

Reply

Rui Santos
August 8, 2016 at 12:10 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 28/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

You probably had the Board Generic ESP board, I’ve fixed the code and it should
regardless of the board.

Reply

Bruce
August 5, 2016 at 2:54 pm

Hi. Great tutorial as usual. I have a suggestion for another ESP tutorial and that is to be able
to pass data to a MySQL db. I have one set up on one of my RasPi’s and it receives data from
my other RasPis but I also have ESP modules that I would like to collect data from but can’t
figure out how to do that. I think this would be a great general interest topic to cover…if it
can be done.
Thanks,
Bruce

Reply

Rui Santos
August 8, 2016 at 12:10 pm

Thanks for the suggestion. I might do something like that in the future

Reply

selcuk ozbayraktar
August 5, 2016 at 3:24 pm

Hi Rui,

I want to try this with ESP8266-01, GPIO2, so what should I use instead of “D1” ?

Thanks in advance
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 29/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

Rui Santos
August 8, 2016 at 12:10 pm

You should use 2

Reply

selcuk ozbayraktar
August 8, 2016 at 12:18 pm

Thanks Rui, I have already discovered it, to help others I found following tabulation
(these definitions are not declared in libraries of all ESP boards) :

D0 = GPIO 16; // Use only numbers i.e “16”


D1 = GPIO 5;
D2 = GPIO 4;
D3 = GPIO 0;
D4 = GPIO 2;
D5 = GPIO 14;
D6 = GPIO 12;
D7 = GPIO 13;
D8 = GPIO 15;
D9 = GPIO 3;
D10 = GPIO 1;

Reply

Rui Santos
August 8, 2016 at 12:27 pm

Exactly! thank you for sharing and I’m glad you found the solution in the meanwhile

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 30/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Tom
August 5, 2016 at 3:39 pm

Works like expected! Would love to see the time added to web page with temps!
Thanks!

Reply

Rui Santos
August 8, 2016 at 12:09 pm

Happy to hear that Tom.


Thank you for trying my project!
Rui

Reply

Ton
August 5, 2016 at 11:12 pm

Hoi Rui

Would you please explain to me what to change in the sketch so that the web-page is
refreshing every x seconds ?

regards Ton.

Reply

Rui Santos
August 8, 2016 at 12:08 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 31/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Copy that line of code and add to the HTML section of my code. http://imgur.com/a/YZlZp
With that snippet of code your page updates every 6 seconds.
I hope this helps Ton.
Rui

Reply

Ton
August 10, 2016 at 12:25 pm

hallo Rui,

Thanks for your quick answer, however as off i am an complete newbee i would ask you a
little bit more on how to do it.
1)Do i have to insert the complete line in the code.?
2) Where do i have to insert it ? (after with line)
I have to learn a lot and also buy you books, so i hope you would help me..

regards Ton.

Reply

Ton
August 10, 2016 at 12:30 pm

sorry the line i mean is

Reply

Ton
August 10, 2016 at 12:45 pm

Excuses ,but the code would not copy but i mean http://imgur.com/a/YZlZp
Ton.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 32/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Rui Santos
August 12, 2016 at 7:26 pm

You have to manually type that line of code into to the HTML head tag

Ton
August 13, 2016 at 10:32 pm

Hallo Rui,
Thanks again for your help , it works.
I put the line after doctype html>

Regards Ton.
PS your tutorials are TOP

client.println(“”);

John
August 11, 2016 at 12:46 pm

Another great tutorial Rui, Thanks! I usually use an ESP07 or ESP12 in projects. Can you tell
me how the GPIO numbers relate to the “Dn” numbering of the Nodemcu 1.0 Module.
Thanks.

Reply

Ton
August 11, 2016 at 3:08 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 33/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

cnx-software.com/2015/10/29/getting-started-with-nodemcu-board-powered-by-esp8266-
wisoc/

is this what you mean?

Reply

Rui Santos
August 12, 2016 at 7:28 pm

Hi John,
There’s a comment in this blog post that mentions that

Reply

John
August 29, 2016 at 12:51 pm

Yes, I did find that list of gpio’s. Thank you Rui for your tireless efforts!

Reply

Bob
August 12, 2016 at 11:02 am

Hello Rui, I built your project with the esp and DS1820B and it works fine with my mobile
device but when I use Chrome or Firefox I don’t get a response. The ESP sees the connect but
the browser just sits there. Any ideas?

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 34/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Rui Santos
August 12, 2016 at 7:30 pm

Do you have any special security plugin running your computer? It might be blocking
connection or something

Reply

rajesh
September 10, 2016 at 11:16 am

not even opening in browser or mobile..

Reply

luiz abbadia
August 16, 2016 at 7:46 pm

Yes !!!…as always…good job!!!!


I am waiting for a light in the path from you to write a tutorial about FTP and this ESP8266
Node MCU, if you have time, one day maybe?

Reply

pierre chevalier
August 23, 2016 at 7:32 pm

bonsoir
j’ai lu avec attention votre tuto

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 35/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

peut on le mettre en place avec un réseau adhoc


cordialement
pierre

Reply

Rui Santos
August 24, 2016 at 8:55 am

Thank you for reading!

Reply

Prasad
August 24, 2016 at 8:53 am

Realy nice and informative thank you somuch for your kindness to freely over flow the
knowldge. It is help to poors who cannot spend money for learning. God will take care of
you. Thanks for shearing.

Reply

Rui Santos
August 24, 2016 at 8:55 am

You’re welcome. Thank you for reading!

Reply

Andrew
September 4, 2016 at 1:11 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 36/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

I have just created an account for your home automation server and have set up a led and its
working perfectly – Thank you.

I also wanted to monitor room temperature, but cant see how to do this on the home
automation server – is this possible?

Reply

Dharmresh
September 4, 2016 at 10:52 pm

How to refresh web for particular time interval

Reply

Doan Xuan Duc


September 5, 2016 at 3:16 am

Great tutorial !!
Btw, I have a question, how can I update the temparature data, when it changes, to the
webserver without reloading the page ??
Thank you for reading !

Reply

Rui Santos
October 2, 2016 at 11:41 am

Simply search for HTML auto refresh web page and you’ll find a snippet of HTML code
that you can copy and add to this project.

Thanks,
Rui

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 37/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

VASANT
September 10, 2016 at 5:52 pm

Many Thanks for your wonderful tutorials.Your program gives a dynamic IP. How can I have
a fixed IP?
Thanks
Vasant

Reply

Rui Santos
October 2, 2016 at 11:37 am

You can either assign a fixed IP address in your router to your ESP’s MAC address.
Or simply Google ESP8266 Arduino IDE fixed IP address and you’ll find a snippet of code
that you can use

Reply

Arslan Zaidi
September 25, 2016 at 12:58 pm

Hi Rui, what changes required if I want to do the same on Wemos D1?

Reply

Rui Santos
October 2, 2016 at 11:29 am

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 38/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

You just need to be careful if you’re setting the right GPIO to read the temperature sensor,
the rest of the project should work just fine

Reply

Jaeyu
December 23, 2016 at 4:02 pm

Must be in the same router?


Any possible way to notice at far away?? ^^

Reply

Rui Santos
December 26, 2016 at 7:52 pm

Yup, because it’s a local web server

Reply

Nelu
December 25, 2016 at 6:51 am

Hello!
why give me this error:
#error “Please define I/O register types here”
thaks !

Reply

Rui Santos
December 26, 2016 at 7:54 pm
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 39/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

I’ve never experienced that error…

Reply

Keir
December 26, 2016 at 10:50 am

Many thanks for posting the article and code. Works like a charm on my basic ESP2866 and
the DS18B20 board that I had from a Pi project. My first couple of days with the ESP8266,
what an amazing piece of kit!

Reply

Rui Santos
December 26, 2016 at 7:55 pm

I’m glad it worked! Thanks for your feedback Keir!

Have a great day,


Rui

Reply

MosheB
December 26, 2016 at 8:37 pm

Hi Rui, Merry Christmas.

First of all, thanks for another great tutorial.

I built the project with the esp and DS1820B and it works fine.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 40/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Now I’m building another project, reads the data with ESP, and displays in serial terminal,
showing like in the browser, but I see trash.
How do I translate the view, it would be like in the browser?
And how I present data also in LCD?
Can you give me some aimed please?

Thanks a lot.

Reply

Rui Santos
December 28, 2016 at 1:36 pm

You probably opened the Arduino IDE monitor at the wrong baud rate.
Look again and be sure that you’ve selected the right baud rate in the Arduino IDE serial
monitor window

Reply

MosheB
December 28, 2016 at 1:52 pm

Hi Rui, Thank you for your comment.


The Baud rate is OK.
I see that the results of the measurement, but it probably displays HTML with a lot of other
data.
I would like to isolate the data of temperature, how do I do it?

Thanks.

Reply

maryam
January 8, 2017 at 12:16 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 41/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Thanks.It was awesome.

Reply

Rui Santos
January 9, 2017 at 5:12 pm

Thank you!
I’m glad it was helpful

Reply

Chevalier Pierre
March 18, 2017 at 8:47 pm

Hello Rui
i use fdti, esp8266-01, ds18b20
I modified the line
#define ONE_WIRE_BUS 5
to
#define ONE_WIRE_BUS 2 (gpio2)
It worked once until “New client”
Without being able to access the web
Since the script stops after the ip address
why ?
Best regards
Pierre

Reply

Ray
April 22, 2017 at 12:32 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 42/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

As I am typing this reply the browser is still trying to connect to the ESP-12. It’s now more
then 5 minutes. The serial monitor gives an IP and as soon as I type in the IP it shows: New
client but nothing happens. As a matter of fact, It is (the browser) still trying to connect.

Reply

marc
February 25, 2018 at 7:03 pm

Hello, the weserver is running but page are not reachable


any idea ?

thanks,

Reply

Rui Santos
March 14, 2018 at 6:08 pm

It looks like you’re not entering the right IP address in your web browser or your ESP is not
establishing a Wi-Fi connection with your router.
Make sure you double-check the serial monitor and it prints the IP address that you’re using
to access in your web browser.

Reply

Marcin
August 2, 2018 at 4:30 pm

Dear Rui,
ESP is connected to wifi, I know IP address but WWW page isn’t available, also serial
moitor shows nothing. Any ideas what could be the problem ?

Thx
Marcin
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 43/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

Jeroen
September 12, 2018 at 5:56 pm

@marc and @marcin

Try using an other pin for the ds18B20 sensor. I had to connect to D5 instead of D1. The page
loaded instantly when connected to the right port.

Reply

Hrvoje
October 27, 2018 at 6:42 pm

Hello!

I’ve did this project but now i want to learn something new. For example i want to add an
LED which indicates readings from ds18b20, how to do that?

Regards,
Hrvoje

Reply

Sara Santos
October 29, 2018 at 10:07 am

Hi.
How will the LED indicate the sensor readings? Can you explain further?
Or did you mean OLED display?
If you want to display your sensor readings in an OLED display, you can take a look at the
following tutorial:
https://randomnerdtutorials.com/esp8266-0-96-inch-oled-display-with-arduino-ide/

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 44/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Regards,
Sara

Reply

Matthew Wray
February 1, 2019 at 5:00 pm

Thank you so much for providing the correct libraries!!!

Reply

Martin
February 3, 2019 at 1:05 pm

How do I get two DS18B20 readings at the same page?


Thanks in advance

Reply

Sara Santos
February 5, 2019 at 9:41 am

Hi Martin.
After getting the second temperature value and it is saved in a variable, for example
“temperatureValue”, you just need to send it to the client:
client.println(temperatureValue);
As you do with the other temperature values in lines 95 to 98 in the
code: https://github.com/RuiSantosdotme/Random-Nerd-
Tutorials/blob/master/Projects/DS18B20__ESP8266_web_server.ino
I hope this helps.
Do you know how to get the temperature from the second sensor?
Regards,
Sara

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 45/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

GK
February 18, 2019 at 7:01 am

Hi,
Thank you for your tutorial.
Will the same code work in all the development board for ESP8266?
If not what changes do we need to make?

Thanking you in advance.


GK

Reply

Sara Santos
February 18, 2019 at 4:43 pm

Hi.
This code works for ESP8266.
It should work in all models.
The only thing you may need to change is the pin that the sensor is connected to.
In our example it is connected to D1(GPIO 5). You may need to connect to another pin, in
case your specific development board doesn’t have that pin available.
I hope this answers your question.
Regards,
Sara

Reply

Attilio Volpe
July 2, 2019 at 7:34 pm

Hi and thanks a lot for your toutorials, I’m trying to get connected with web server, I’m using
an ESP01, and there is no way to do it.
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 46/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

I found now in my nettwork list “ESP_89ED249” network, I’m connected to this and by
ipconfig I know the IP address (192.168.4.1), if I type this on my Chrome I’m able to see the
web server…
Please tell me what is going wrong.
Another issue I’m don’t able to get data from DHT11 sensor, any suggestion for this?

Reply

Sara Santos
July 12, 2019 at 10:22 pm

Hi.
Without further information, it is very difficult to understand what might be wrong.
If you’re having issues with the DHT11 temperature sensor, I suggest reading our
troubleshooting guide: https://randomnerdtutorials.com/solved-dht11-dht22-failed-to-read-
from-dht-sensor/
Regards,
Sara

Reply

gam
July 17, 2019 at 7:33 am

Thanks for your tutorials and cord work, these days i,m work on another job. After that I’l go
throw and inform you.

Reply

Darko
July 17, 2019 at 12:34 pm

Hi,
Thank you very much for your tutorials.
One question: is it possible to use second ESP8266 (with LCD for example) in this system to

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 47/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

display measured temperature on LCD? I’d like to measure water temperature in a pool and
display the result on both side: on PC and LCD. Thank you for your answer.
Darko

Reply

Neil Austen
August 15, 2019 at 11:17 am

My ESP 8266 would only connect to my wifi if I added delay(10); after


Serial.begin(115200);
Not to sure why but works perfectly now.
Thanks for code. Also, enjoying your ESP 32 book

Reply

Sara Santos
August 24, 2019 at 10:56 am

Thank you for sharing that. It may be useful for our readers.
I’m glad you’re enjoying our ESP32 course.
Regards,
Sara

Reply

henry probo santoso


August 30, 2019 at 3:50 am

hey, thanks for the tutorial, but i want to ask about the use of ds18b20 with esp board, i heard
that digital pin of esp has input range 0 to 3,3 and analog pin 0 to 1. So does it save using a
ds18b20 modul for esp ?
thanks in advance

Reply
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 48/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Sara Santos
August 30, 2019 at 9:56 am

Hi Henry.
If you’re using an ESP8266 NodeMCU development board, the analog input range is 0 to
3.3V.
If you’re using an ESP-01, the input range is 0 to 1V.
The data pin of the DS18B20 is connected to a digital pin. So, you don’t need to worry
about the analog input range.
To learn more about analog input with the ESP8266,
read: https://randomnerdtutorials.com/esp8266-adc-reading-analog-values-with-nodemcu/
Regards,
Sara

Reply

Nûr
August 31, 2019 at 8:25 pm

Would the coding be the same, i.e. with minor changes if I use proximity sensor instead of a
temperature sensor?

Reply

Nûr
August 31, 2019 at 8:35 pm

What library should be used for the proximity sensor instead of ‘#include
DallasTemperature’?

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 49/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Sara Santos
September 1, 2019 at 9:17 am

What sensor are you using?


If you’re using ultrasonic sensor, you can read this
guide: https://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/
Regards,
Sara

Reply

Treath Wharton
September 16, 2019 at 3:28 am

Hi Sara/Rui,
I have an Arduino Mega running an established Aquaponics garden. What project do you
offer that I can purchase to make the senors visible online, not just on my local network?

Reply

Sara Santos
September 16, 2019 at 9:22 am

Hi.
We don’t have any project about that using Arduino.
We have these projects with the ESP32 that show how to create your own server domain
that you can access from anywhere:
https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/
https://randomnerdtutorials.com/visualize-esp32-esp8266-sensor-readings-from-anywhere/
Regards,
Sara

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 50/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Treath Wharton
September 16, 2019 at 10:16 am

Ok, thank you for the very fast reply! I have two ESP32’s so I’ll keep them for another
project.

Reply

jenish jain
September 22, 2019 at 3:42 am

I am using the same sketch with addition to displaying the values on an OLED screen, but the
values are getting distorted on the display as soon as i connect more than one sensor, could
someone help me with this i am using OLED in I2C interface.

Reply

Sara Santos
October 2, 2019 at 3:45 pm

Hi.
With those details, it is very difficult to find out what can be wrong.
You can read our OLED guide with the ESP8266 and see if it helps find out what might be
wrong.
Regards,
Sara

Reply

andrei
November 3, 2019 at 8:36 am

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 51/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

hello

how can we name the sensors ?


like Boiler_sensor, heater_sensor… to be displayed in the web server ?

thank you

Reply

Sara Santos
November 5, 2019 at 6:13 pm

What do you mean?

Reply

andrei
November 5, 2019 at 7:18 pm

i want to make a project with 2 temperature sensors, so i want to assign names in order to
know which temperature i am reading in my webserver

Reply

andrei
November 3, 2019 at 4:22 pm

and can i link a GSM shield to send SMS , to the ESP8266 board, in addition to comunciating
to webserver ?

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 52/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Sara Santos
November 5, 2019 at 10:20 am

Yes.
You should be able to do that.
Regards,
Sara

Reply

paulo lima
April 21, 2020 at 6:35 pm

ok. im sorry to type again, but with the full code i only can read one
sensor and i need several, but i dont know coding, im not a programe, just
curious, can yoy give some help for the complete code with server, thanks and sorry to ask
again.

Reply

Sara Santos
April 23, 2020 at 11:14 am

Hi.
If you want to get the data from each sensor in different variables, this tutorial might be
easier to understand: https://randomnerdtutorials.com/esp32-multiple-ds18b20-temperature-
sensors/

Regards,
Sara

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 53/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Kalman
May 1, 2020 at 9:36 pm

Hello Sara and Rui! Thank you so much for your tutorials! I have a question about this one.
Ds18b20 web server is working perfectly on my computer, but…i cant see it on my Android
phone, which is in the same wifi network. Can you tell me what can be a reason?

Reply

Sara Santos
May 3, 2020 at 3:04 pm

Hi.
What web browser are you using?
Regards,
Sara

Reply

Kalman
May 3, 2020 at 4:17 pm

Im using Chrome on my Android phone. When i log into my home network i cant see
server page on my phone, just on my computer. But i noticed that ESP create his own
network,and after i connect with phone to it i can see server page on phone. Is this the
way it should works?

Reply

Sara Santos
May 4, 2020 at 4:39 pm

Hi.
That’s not the way it should work.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 54/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Add this line

WiFi.mode(WIFI_STA);

Before initializing Wi-fi:


WiFi.begin(ssid, password);

It should solve the problem.


Regards,
Sara

Reply

LUCA SBRENNA
May 8, 2020 at 8:02 am

Hello and congratulations.


I am struggling with a network consisting of 15 ds18b20 sensors, where I monitor the
temperature of the home.
I connected most of the sensors with individual telephone cables ( 5 to 20 meters long each).
In 3 cases I connected 2 sensors to a single cable.
I tried to monitor them through the wemos d1 version 3 and connected all according to the
rule, gnd to gnd, vcc to the 3v3 of the wemos and the data to the pin d7 of the wemos with
resistance from 4k7 between data and 3v3.
I can read up to 6/7 sensors at the same time, if I connect further ones, it returns -127 on all of
them. I also tried to lower the resistance value to 1k given the length of the sections but I do
not solve.
I measured the current that supplies the wemos and it is 3.27v.
How can I solve it?

Reply

Sara Santos
May 8, 2020 at 10:10 am

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 55/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Hi Luca.
I’m sorry, but I don’t know what might be the issue.
What pins are you using to connect your sensors?
Take a look at this article to see if you’re using any pins that you
shouldn’t: https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
Regards,
Sara

Reply

dave
May 8, 2020 at 8:44 pm

Please read the One-Wire data sheets about how to wire.


the length of the wire should be about the same for each sensor.
you could have 5 long wires on one pin of the D1 and then 8 shorter wires on a separate pin.

Reply

dave
May 8, 2020 at 8:53 pm

op’s I could not edit my post to add that when the one-wire sends a signal the length of the
wire can come into play. if a close one returns a value before a far one even gets the request,
then the collision causes problems.
One way is to have all the sensor wires the same length and connect as some place.
if you have the D1 in in the basement and some sensors in the basement and some on the 2nd
floor, you could run a wire from the basement to the first floor, then all the basement wires
would run to a point on the first floor and all the 2nd floor sensors would run to that same
point. a STAR configuration.

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 56/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Ronald van Lee


June 14, 2020 at 2:49 pm

Hi Rui,
Ken jou tel me of it is possible to get more then oneDS18B20 sensors on one ESP8266.
Like this DS18B20 Multiple Temperature Sensors OneWire with ESP32 and Arduino IDE
best regards Ronald.

Reply

Sara Santos
June 16, 2020 at 8:38 pm

Hi.
Yes, it is possible.
Regards,
Sara

Reply

Leoncio Nascimento
June 23, 2020 at 10:56 pm

Thank you Rui for tutorial and Sara for post suport on issues!!!

The project run very well except for one issue here, it only recognize two sensors (i made
with four intalled). I already change the place of the sensors and just two sensors have output
in serial monitor. Do you have any idea of what is happening? Thanks!

Reply

Leoncio Nascimento
June 23, 2020 at 11:31 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 57/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

I already found the solution. It was a soldering problem (obviously!!!) thanks

Reply

David Adams
July 14, 2020 at 12:30 pm

Very nice article, Rui. Just a couple things: It looks like the DeviceAddress type is an array of
8-bit unsigned integers “typedef uint8_t DeviceAddress[8];”, so I think the address of the
sensors are an 8-bit serial code, not 64. Also, I don’t know why the getTempCByIndex and
getTempFByIndex functions are considered “slow”. I think I’d rather use those than than
dealing with the DeviceAddress. In DallasTemperature.cpp, indeed, these functions wrap
calls using the DeviceAddress type:

float DallasTemperature::getTempCByIndex(uint8_t deviceIndex) {

DeviceAddress deviceAddress;
if (!getAddress(deviceAddress, deviceIndex)) {
return DEVICE_DISCONNECTED_C;
}
return getTempC((uint8_t*) deviceAddress);

Reply

Mike/F4DEY
August 21, 2020 at 7:40 pm

HEllo Rui and Sara

I built the DS18B20 appli with ESP32 version and it’s work
_ temperature displayed on monitor and also with webserver
thanks ! your tutorial are very easy to follow and detailled !

now I want to use a ESP-01 to read a DS18B20 temperature senor


I built this projet, it work with serial monitor
but for webserver, I have a error during execution (after download and reset):
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 58/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Exception (3):
epc1=0x40100818 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4006f1b9
depc=0x00000000

stack>>> (stack displayed)

during compilation I had this message:


Executable segment sizes:
IROM : 268020 – code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 27324 / 32768 – code in IRAM (ICACHE_RAM_ATTR, ISRs…)
DATA : 1260 ) – initialized variables (global, static) in RAM/HEAP
RODATA : 2536 ) / 81920 – constants (global, static) in RAM/HEAP
BSS : 25320 ) – zeroed variables (global, static) in RAM/HEAP

this ESP-01 was OK in the past with older version of IDE and old librarie
I could use webserver to send SMS for example.
why not working now?
I search on web but it’s not easy to understand …

thanks for advice!

Mike

Reply

Bert Sch
August 21, 2020 at 11:38 pm

Really nice and thank you Rui & Sara, works very well. Can you by any chance tell me what
code I need to add to push the data of the 2 sensors (in my case) to an Influx database?

Reply

Sara Santos
August 22, 2020 at 8:18 am
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 59/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Hi.
Thanks for your comment.
Unfortunately, at the moment, we don’t have any tutorials about influx db.
Regards,
Sara

Reply

Amaluddin
August 22, 2020 at 4:38 pm

Why there is no IP address show up in my Serial Monitor?

Reply

Sara Santos
August 24, 2020 at 5:32 am

Hi.
After uploading the code, press the ESP8266 RST button, so that it starts running the code
and print the IP address.
Regards,
Sara

Reply

Chi Thanh Hoang


October 2, 2020 at 1:35 am

If using NodeMCU, use either pin D3/GPIO0 or D4/GPIO2 you don’t need pullup of 4.7K,
the board already has 12K pullup on those pins.
I build 3 boards using D4/GPIO2 without 4.7K and they work perfectly.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 60/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

It is a bit tricky because I found those pullup while reading the schematic of NodeMCU.

The same about A0 pin for ADC, there is existing voltage divider with 220K and 100K res.

Good article you wrote!

Reply

Bob
October 5, 2020 at 2:07 am

First Rui thank you I have just discovered this. Unfortunately I am not having success with
the web server display code. as soon as a browser hits the esp8266 12E server the console
monitor shows continuous resets. I’m not sure where to start with the trouble shooting. I have
taken these steps
reflashed multiple esp8266 12e boards multiple times with different flash tools including
NodeMCU Flasher. The previous section without the web server works well.

Reply

Stephen Castle
October 21, 2020 at 1:58 am

I’m not having any success with the web page coming up, its not bringing up anything, not
even with serial monitor other than a stack error:

Panic
C:\Users\Steve\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\e
sp8266\core_esp8266_main.cpp:98 __yield

ctx: sys
sp: 3ffff9f0 end: 3fffffb0 offset: 01b0

stack>>>
3ffffba0: 00000000 00000001 00000100 40207340
3ffffbb0: 00000000 00006d2b 3ffeee74 40208cd5
3ffffbc0: 3fff2147 3ffeee74 3ffeee74 40207883

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 61/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials
3ffffbd0: 3fff2147 3ffeee74 3ffeee74 402078c4
3ffffbe0: 3fff00e4 00000404 3ffffc44 40202131
3ffffbf0: 3fff2147 3ffffc50 3ffffc44 40202288
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1384, room 16


tail 8
chksum 0x2d
csum 0x2d
v3de0c112
~ld
xC⸮Connecting to WiFi

I did the single test 1st And it came out fine on the serial monitor with temperatures every 5
seconds displaying a reading, its something in the Web server but I dont know what ? I’ve
copied & pasted the code ? Im using Huzzah 8266 AI Thinker Mod chip

Reply

JAY
November 6, 2020 at 2:50 pm

HI. I have same question . Do you solve the problem? I really need help.

Reply

PManns
December 15, 2021 at 4:06 pm

same question

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 62/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Mike/F4DEY
October 21, 2020 at 8:10 am

HEllo
for my side (see previous post in this file) , I have reflashed the SDK with last version and it
works now!
allaboutcircuits.com/projects/flashing-the-ESP-01-firmware-to-SDK-v2.0.0-is-easier-now/

I don’t know what is this date “ets Jan 8 2013” ? but old SDK ??

best regards

Mike

Reply

Jack Lupton
December 4, 2020 at 6:49 pm

Thank you for this post. It gives me the first clue as to what might be going on. I’m not
looking forward to the work involved, though. I wonder how I can buy an ESP8266 and
insure it has firmware that will work already installed. At this point, I’ve already put a huge
amount of time into getting this to work.

Reply

Roland
November 23, 2020 at 9:34 pm

Hi,

I have a problem, my output in the Serial Monitor is always -127 C.

Can anyone help me?

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 63/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Sara Santos
November 24, 2020 at 11:19 am

Hi.
That usually means that the sensor is not wired properly, or that it is not getting enough
power.
Regards,
Sara

Reply

Jack Lupton
December 3, 2020 at 9:46 pm

Hi. Thanks for what you do. I am having a similar problem to others in the comments above.
Working my way through the tutorial everything works as expected until I get to the Async
web server section. My issue is the same as Stephen Castle. I ran nmap and found the address
displayed for the lan in the serial monitor is correct. But when I try to connect to it I get a
dump of hex numbers same as Mr. Castle. It continues to refresh until I close the browser
window. That seems like a pretty big hint as to what is going wrong. Any ideas of how to fix
this.

Reply

Oao
December 19, 2020 at 7:11 pm

I am having similar problem on error trying to load the website. The error is as below. Can
anyone please help. thanks.
ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3584, room 16


tail 0
chksum 0xb0
csum 0xb0

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 64/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

v2843a5ac
~ld

Connecting to WiFi
…..
192.168.1.5

Reply

Jake
January 14, 2021 at 3:48 pm

Same here, did you ever get this to work?

Reply

Brent
January 19, 2021 at 5:25 pm

I’m thinking that it’s time for the developers of this project to load it onto an ESP8266
board and come up with a solution for this problem. I’m not sure where the problem is
and I’m not good enough at programming to figure it out.

Reply

Dave
December 19, 2020 at 11:34 pm

Hello,

First of all thank you for such a great site! I have purchased your Home Automation Course.
And am really pleased.
I have run and tested my circuit and all works well. I have it wired exactly as your multi-
sensor example.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 65/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

I have copied and pasted the Web server code there were no issues upon upload it connects it
connects with my network and provides me with an IP address. The problem is that when i
copy that IP address in to a browser it will not connect via WiFi? I even tried to un-plug my
Serial Port connection to the ESP8266 board, and then power it independently. Still am not
getting a connection. All of your other code has been perfect, I must be doing something
mechanically incorrect ?

Reply

Dave
December 19, 2020 at 11:48 pm

I checked Windows diagnostics and this was the message ”

The remote device or resource won’t accept the connection Detected Detected

The device or resource (wpad.Home) is not set up to accept connections on port “The World
Wide Web service (HTTP)”.

Reply

Sara Santos
December 20, 2020 at 10:13 am

Hi Dave.
That’s weird.
I’ve never faced that problem.
What browser are you using?
I’ve found this: appuals.com/fix-remote-device-resource-wont-accept-connection/
Take a look and see if it helps.
If this doesn’t work, since your are a RNT costumer, please post your issue in the
RNTLAB forum: https://rntlab.com/forum/
I can follow your issue closer there.
Regards,
Sara

Reply

Dave
December 20, 2020 at 3:41 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 66/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Sara,
Thanks for the reply I wanted to let you know that this is the first time this has happened
for me as well. I am able to join other IP addresses from RNT tutorials. i.e. BME680
async server works perfectly.

I have tried three browsers, Vivaldi, Chrome, Explorer, with the same result.
I erased the memory on my 8266 NodeMCU board and reflashed it. I also reactivated
the Wifi chip on the board via MicroPython.

I have only rarely been able to get webrepl to talk to these boards so I am wondering if
there is a common issue with the firmware. Perhaps this is an issue with some of these
boards I have three from the same vendor?

I will see if there is something incorrect in my laptops network settings? I don’t want to
fix something that is not broken as I am able to connect to other similar devices. I did
want to say before I go that I can’t access this ip address on my Android phone either?

I will report any findings to https://rntlab.com/forum/.

Thank you again,

Dave

Reply

Rockfunster
January 12, 2021 at 3:32 pm

Hi Sara and Dave,

First of all I would also like to thank you for assembling this material. It gives a good
head start!

Though I also experienced, that the example is not quite working for me, when I
copied the example code for the web server scenario. Today, I finally managed to
figure out why that was.

This example uses async web server (me-no-dev /


ESPAsyncWebServer). In the readme of the server implementation the following is
stated:
“Important things to remember

You can not use yield or delay or any function that uses them inside the callbacks”

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 67/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

So when you open the website, the web server callbacks contact the temperature
sensor (through dallas and onewire) and tries to read out data, but it does that with
adding some delay, and on top of that if you use dallas in blocking mode (which is by
default, you can change by: sensors.setWaitForConversion(false);, but in this case you
have to manage some timing aspect), than it also calls yield (see
DallasTemperature::blockTillConversionComplete), which eventually causes the
application to crash.

I verified my theory by adding yield or delay calls to the callbacks. It made the
application instantly fail, when it hit the yield function. It seemed, that it is more
forgiving with delay. However, neither of yield or delay is recommended as stated
above.

I would rather execute periodic temperature reading in the loop(), and from the
callback only get the already determined values making the callbacks simple and fast.

I used the newest of everything: arduino core, dallas, onewire, async web server.

Cheers!

Brent
December 22, 2020 at 10:41 pm

This looks like a pretty cool project, I just wish I could get it to work on the ESP8266. I’ve
confirmed that the ESP and everything else works and that the problem would seem to be
related to this code. The board connects to the WiFi and has a valid IP until I try access the
WebServer from any Web Browser. As soon as I do that the WiFi disconnects, the Serial
monitor dumps a bunch of hex numbers and then the WiFi reestablishes link to my router. I
truly don’t understand a lot of his code so would anyone have any suggestions as to how this
could be fixed. Thanks

Reply

Richard
January 11, 2021 at 9:14 pm

There is a problem with the Dallas Temperature Library and the ESPAsyncTCP lib. You’ll
find an explanation on Reddit. This code works fine on ESP32 because then the
ESPAsyncTCP lib is not used.
Regards
Richard

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 68/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

Jake
January 14, 2021 at 3:50 pm

Is there a solution or way around that error in the lib for the 8266?

Reply

Jake
January 14, 2021 at 4:07 pm

Is this the explanation you’re referring to:

reddit.com/r/esp8266/comments/iofuxy/esp8266_crashes_anytime_i_connect_to_the_ip/g
4dn2es/?utm_source=reddit&utm_medium=web2x&context=3

Why is this an error now, but worked fine for users back in 2016 when this tutorial was
first published?

Reply

Sam
December 23, 2020 at 2:48 am

Wow .. That is the Best and simple explanation of the code .. I hope everyone use this method
,it will become so easy for beginners to learn. Thanks alot again for this.

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 69/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Jake
January 14, 2021 at 3:52 pm

Thanks for great tutorial!

Like a few others, unfortunately my serial monitor just throws a list of hex errors after I
connect to the IP it establishes via my browser:

“ctx: sys
sp: 3fffead0 end: 3fffffb0 offset: 0000
3fffead0: 3fffeb00 3fffec80 00000000 40100ab1
3fffeae0: 000000fe 00000000 00000000 00000000
etc”

Any way around this?

Reply

Wojciech Mizgalski
January 20, 2021 at 9:45 am

// Route for root / web page


server.on(“/”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, “text/html”, index_html, processor);
});
server.on(“/temperaturec”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, “text/plain”, String(sensors.getTempCByIndex(0)-3).c_str());
});
server.on(“/temperaturef”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, “text/plain”, String(sensors.getTempFByIndex(0)-5.4).c_str());
});

and

// Replaces placeholder with DHT values


String processor(const String& var){
//Serial.println(var);
if(var == “TEMPERATUREC”){
return String(sensors.getTempCByIndex(0)-3);
}
else if(var == “TEMPERATUREF”){
return String(sensors.getTempFByIndex(0)-5.4);
}

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 70/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

return String();
}

Reply

Jake
January 20, 2021 at 11:29 pm

Thank you for the code Wojciech, this does help – the hex error codes in the serial
monitor are gone, the webpage now displays when I connect to the IP from my browser
(iPhone).

However the temps displayed are not correct- they start at negative temps, then slowly
climb to 0C and 32F, which is curious.

In your lines “if(var == “TEMPERATUREC”){return


String(sensors.getTempCByIndex(0)-3);”
and
“else if(var == “TEMPERATUREF”){return String(sensors.getTempFByIndex(0)-5.4);}

what is the purpose of the “-3” and “-5.4” terms? Are they correction factors? I have tried
removing them, but the temps displayed are still incorrect.

Reply

Richard
January 21, 2021 at 3:11 pm

Following code works for ESP8266 with Arduino IDE V1.8.13:

/*********
Rui Santos
Complete project details at https://RandomNerdTutorials.com

modified for ESP8266 by Richard 2021-01-21 and working on WeMosD1mini V1.0.0


(Arduino IDE Boards WeMosD1R1)
avoiding callback problems according to Rockfunster
*********/

// Import required libraries


#ifdef ESP32
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 71/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#define ONE_WIRE_BUS 15 // ESP32
#else
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <Hash.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#define ONE_WIRE_BUS 4 // D2
#endif
#include <OneWire.h>
#include <DallasTemperature.h>

// Setup a oneWire instance to communicate with any OneWire devices


OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature sensor


DallasTemperature sensors(&oneWire);

// Replace with your network credentials


const char* ssid = “mps3_2”;
const char* password = “TJsvDwdTdgvi”;

String StrTempC;
String StrTempF;

// Create AsyncWebServer object on port 80


AsyncWebServer server(80);

String readDSTemperatureC() {
// Call sensors.requestTemperatures() to issue a global temperature and Requests to all
devices on the bus
sensors.requestTemperatures();
float tempC = sensors.getTempCByIndex(0);

if(tempC == -127.00) {
Serial.println(“Failed to read from DS18B20 sensor”);
return “–“;
} else {
Serial.print(“Temperature Celsius: “);
Serial.println(tempC);
}
return String(tempC);
}

String readDSTemperatureF() {
// Call sensors.requestTemperatures() to issue a global temperature and Requests to all
devices on the bus
sensors.requestTemperatures();
float tempF = sensors.getTempFByIndex(0);

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 72/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

if(int(tempF) == -196){
Serial.println(“Failed to read from DS18B20 sensor”);
return “–“;
} else {
Serial.print(“Temperature Fahrenheit: “);
Serial.println(tempF);
}
return String(tempF);
}

const char index_html[] PROGMEM = R”rawliteral(

html {
font-family: Arial;
display: inline-block;
margin: 0px auto;
text-align: center;
}
h2 { font-size: 3.0rem; }
p { font-size: 3.0rem; }
.units { font-size: 1.2rem; }
.ds-labels{
font-size: 1.5rem;
vertical-align:middle;
padding-bottom: 15px;
}

ESP DS18B20 Server

Temperature Celsius
%TEMPERATUREC%
°C

Temperature Fahrenheit
%TEMPERATUREF%
°F

setInterval(function ( ) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById(“temperaturec”).innerHTML = this.responseText;
}
};
xhttp.open(“GET”, “/temperaturec”, true);
xhttp.send();
}, 10000) ;
setInterval(function ( ) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 73/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

document.getElementById(“temperaturef”).innerHTML = this.responseText;
}
};
xhttp.open(“GET”, “/temperaturef”, true);
xhttp.send();
}, 10000) ;

)rawliteral”;

// Replaces placeholder with DHT values


String processor(const String& var){
//Serial.println(var);
if(var == “TEMPERATUREC”){
//return String(sensors.getTempCByIndex(0));
return StrTempC;
}
else if(var == “TEMPERATUREF”){
//return String(sensors.getTempFByIndex(0));
return StrTempF;
}
return String();
}

void setup(){
// Serial port for debugging purposes
Serial.begin(115200);
Serial.println();

// Start up the DS18B20 library


sensors.begin();

// Connect to Wi-Fi
WiFi.begin(ssid, password);
Serial.println(“Connecting to WiFi”);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
Serial.println();

// Print ESP Local IP Address


Serial.println(WiFi.localIP());

// Route for root / web page


server.on(“/”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, “text/html”, index_html, processor);
});
server.on(“/temperaturec”, HTTP_GET, [](AsyncWebServerRequest *request){
//request->send_P(200, “text/plain”, (sensors.getTempCByIndex(0)).c_str());
request->send_P(200, “text/plain”, String(StrTempC).c_str());
});
server.on(“/temperaturef”, HTTP_GET, [](AsyncWebServerRequest *request){
//request->send_P(200, “text/plain”, String(sensors.getTempFByIndex(0)).c_str());
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 74/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

request->send_P(200, “text/plain”, String(StrTempF).c_str());


});
// Start server
server.begin();
}

void loop(){
StrTempC = readDSTemperatureC();
Serial.print(StrTempC);
Serial.print(” “);
StrTempF = readDSTemperatureF();
Serial.println(StrTempF);
}

Reply

Terry
February 2, 2021 at 5:29 am

I would Suggest a delay between reads. 1wire does not like constant polling of one device,
other than serial number checks.
Nice catch by the way.
I had an issue with the other code I wrote for another application. Seems a call back just
likes you to get in a get out. I found that if a second call back occurs while i am still inside
one, I was getting crashes.

Reply

Tony
January 31, 2021 at 8:06 pm

I was having the same problem trying to get this to work on a NodeMCU ESP8266.

Same crash, stack dump each time, and then a processor reboot.

Finally tracked it down to readDSTemperatureC( ) and readDSTemperatureF( ).

They crash trying to poll the 1-wire hardware when called from these call-backs
request->send_P(200, “text/plain”, readDSTemperatureC().c_str());
and
request->send_P(200, “text/plain”, readDSTemperatureF().c_str());

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 75/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Moving the 1-wire polling code to the main loop( ) function and having it store temperature
values in a global variable, which the readDSTemperatureC() and readDSTemperatureF() can
then read and display, “fixed” the problem.

Some sort of issue with calling the 1-wire function from the server callbacks? Not-reentrant
maybe?

Reply

Sara Santos
February 1, 2021 at 10:10 pm

Hi.
Yes.
I need to update this code as soon as possible.
Regards,
Sara

Reply

Tomis
February 1, 2021 at 2:00 pm

If think that is some problem with this webservice.


I got the same problem ets Jan 8 2013,rst cause:2, boot mode:(3,6)

I tried this https://randomnerdtutorials.com/esp32-esp8266-thermostat-web-server/ totorial


and was everything ok.

Reply

Luo
February 2, 2021 at 2:43 pm

Thinks very much !! It’s run well.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 76/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

Tony49D
February 3, 2021 at 12:52 am

Richard, thank you. I’ve been tearing my hair out trying to solve this problem & your
solution worked (well, after I’d removed the different character codes inserted by copying
from the web page text). It obviously used to work OK so I wonder what has changed?
Maybe the latest version of <ESPAsyncWebServer.h> is different in the way it reacts to the
callback issue.

Reply

Mark Weir
February 6, 2021 at 6:09 am

Hi Guys,
How would I modify the webserver code to show multiple DS18B20 readings?
I only need degrees C so I have room but cant figure out where to pull the seperate data from
each device into the programme.
Love these tutorials and the challenges they present.
Thanks Mark

Reply

Zayoo
March 13, 2021 at 8:11 pm

Delete from functions:


//readDSTemperatureC()
sensors.requestTemperatures();
float tempC = sensors.getTempCByIndex(0);
//readDSTemperatureF()

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 77/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

sensors.requestTemperatures();
float tempF = sensors.getTempFByIndex(0);

ADD global variables:


float tempC;
float tempF;

ADD function on top:


void radDSTemperatures(){
sensors.requestTemperatures();
tempC = sensors.getTempCByIndex(0);
tempF = sensors.getTempFByIndex(0);
}

ADD in loop() function:

void loop(){
delay(1000);
radDSTemperatures();
}

Reply

Andrew
March 31, 2021 at 7:01 pm

Hello

Than You for great tutorial.


I want to make temperature and smoke measurement using DS18B20 and MQ2.I changed the
code for my need. Do It possible to turn of server?
I want to measure temperature and smoke – when will be above some level programme gives
signal which turn off relay. This relay turn off the 220V device. But when temperature is fall
programme is still running because the server is running.
Thank you

Reply

Tad
April 3, 2021 at 9:33 am

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 78/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Hello everyone. I have a problem with my “wireless temperature” project.

I’m uploading my project to my esp. I go step by step and record.


Now I copy the IP address and put it in the internet browser and then it tells me that the page
does not exist and arduiono serial monitor writes me this

https://ctrlv.cz/Y3M2

https://ctrlv.cz/6svZ

Reply

Sara Santos
April 5, 2021 at 2:22 pm

Hi.
The code is now fixed.
Can you copy the new code and try it again?
Regards,
Sara

Reply

Tad
April 12, 2021 at 5:06 am

Ok thank. The program is good and print good temperature. Do you have any experience
with temperature via internet?

Reply

Lukas
April 6, 2021 at 1:46 pm

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 79/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Thank you very much for this detailed article. It helped me a lot and made some of my
projects much easier. There are now remote engine monitoring modules in railway vehicles
all over germany, my heating system is running on those ds18b20 sensors and even the plant
watering system in the greenhouse is relying on some of them. I always use three or more
sensors in parallel because they are so cheap and it makes the whole system much more
reliable. The code includes a remote warning function in case one of the sensors outputs a
value out of the range of the others. And all the information for these projects are available in
one article. Great work!

Reply

Ron N
April 14, 2021 at 5:14 am

Fantastic tutorial! Needed to set up a remote temperature monitor for my attic and it took less
than an hour. I went through the entire tutorial step by step and everything worked great. I
used Arduino 1.8.13 on Linux, but I took a short cut: instead of manually unzipping and
copying the EspAsyncWebServer-master.zip and EspAsyncTCP-master.zip, I simply used
Sketch->Include Library->Add .ZIP library from the Arduino IDE. Thank you.

Reply

Stefan cremers
May 21, 2021 at 8:28 am

Did somebody have used two ds18b20 sensors with the onewire protocol and was able to
compare the two values? I am trying this for quite some time but i cannot get the hang of it…
thanks in advance! if my code is desired, please let me know.

Reply

Christian
June 2, 2021 at 8:44 am

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 80/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Hey, Thanks for this great Project.


Is it possible to add a e-Paper Display to this Project?

Reply

Sara Santos
June 2, 2021 at 9:27 am

Hi.
Yes. However, at the moment, we don’t have any tutorials with the epaper display.
Regards,
Sara

Reply

Gail Meier
June 3, 2021 at 7:24 pm

Is it possible to show how to add in the Elegant OTA code into this multiple sensor
webserver.
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-
arduino-ide/
I looks so simple with you OTA examples, but I have problem with the Webserver ‘include’
files being in conflict. This web server here is different than your examples.
Thanks

Reply

Sara Santos
June 4, 2021 at 9:44 am

Hi.
What is exactly the issue that you’re getting?
Regards,
Sara

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 81/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

Duncan Lovett
June 18, 2021 at 11:43 pm

Hello,
I have this working on a board that I made up a couple of years ago. I want to change the wifi
name and password so I have downloaded the arduino 1.8.1.5 and installed the libraries and
esp board in arduino. I have added your script and changed the wifi name and password.
Every time I compile I get the following error message, despite manually confirming that the
ESP Libari is in the arduino folder and is correctly named

Arduino: 1.8.15 (Mac OS X), Board: “NodeMCU 0.9 (ESP-12 Module), 80 MHz, Flash,
Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache +
32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB
OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200”

(…)
-> candidates: [ESPAsyncTCP@1.2.2]
/Users/duncanlovett/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.0-
newlib4.0.0-gnu23-48f7b08/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -
U__STRICT_ANSI__ -
I/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/tools/sdk
/include -
I/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/tools/sdk
/lwip2/include -
I/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/tools/sdk
/libc/xtensa-lx106-elf/include -
I/var/folders/lw/pdmsk9dn48x971w_n13kv2_40000gn/T/arduino_build_27253/core -c -w -
Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -
std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -
DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -
DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -
DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10815 -
DARDUINO_ESP8266_NODEMCU_ESP12 -DARDUINO_ARCH_ESP8266 “-
DARDUINO_BOARD=\”ESP8266_NODEMCU_ESP12\”” -DFLASHMODE_QIO -
DESP8266 -
I/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/cores/es
p8266 -
I/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/variants/
nodemcu -
I/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/libraries/
ESP8266WiFi/src -
I/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/libraries/
Hash/src -I/Users/duncanlovett/Documents/Arduino/libraries/ESPAsyncTCP/src
/var/folders/lw/pdmsk9dn48x971w_n13kv2_40000gn/T/arduino_build_27253/sketch/NodeM
CU_Temp_Sensor.ino.cpp -o /dev/null

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 82/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Alternatives for ESPAsyncWebServer.h>: []NodeMCU_Temp_Sensor:15:12: fatal error:


ESPAsyncWebServer.h>: No such file or directory

ResolveLibrary(ESPAsyncWebServer.h>) 15 | #include <ESPAsyncWebServer.h>S

-> candidates: [] | ^~~~~~~~~~~~~~~~~~~~~~

compilation terminated.
Using library ESP8266WiFi at version 1.0 in folder:
/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/libraries/
ESP8266WiFi
Using library Hash at version 1.0 in folder:
/Users/duncanlovett/Library/Arduino15/packages/esp8266/hardware/esp8266/3.0.0/libraries/
Hash
Using library ESPAsyncTCP at version 1.2.2 in folder:
/Users/duncanlovett/Documents/Arduino/libraries/ESPAsyncTCP
exit status 1
ESPAsyncWebServer.h>: No such file or directory

Any suggestions on what to try?

Many thanks for a great tutorial.

Reply

Sara Santos
June 19, 2021 at 8:26 am

Hi.
The problem is with the ESPAsyncWebServer library.
Or it is not installed or it is not properly installed.
That’s what the error is about.
Regards,
Sara

Reply

Duncan Lovett
June 19, 2021 at 5:22 pm

Sure Sara, its’ installed as per your instructions, I can see it correctly named in the correct
folder on my mac and shows as a library in the ardiuno app.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 83/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Any suggestions?

Thanks

Duncan

Reply

Terry
June 19, 2021 at 10:59 pm

Have a look at the github library, as quite a few changes have been made due to the
boardmanager changes to the ESP core.
For library issues, that is a good place to get library helo.

Reply

Sara Santos
June 21, 2021 at 9:49 pm

Hi.
Check that you only have one arduino IDE installation and that it is not conflicting with
other files.
Otherwise, I don’t know what can be causing the issue.
Regards,
Sara

Reply

waln
March 25, 2022 at 7:34 am

Hi. I gladly joined and made this website. Thank you very much.
I answer Duncan Lovett. I was the same.
I found a small error in the code.
https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 84/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

In place:
#include <ESPAsyncWebServer.h> S
You need to write:
#include <ESPAsyncWebServer.h>
That’s it. With respect.

Reply

Milad
July 7, 2021 at 6:13 pm

Hi
Thx for this great tutorial !
I am using DS18B20 with esp8622E-12
I am getting a minus value for the temperature and I don’t know why exactly

Anyone can help ?

Reply

Sara Santos
July 9, 2021 at 9:17 am

Hi.
That usually happens when the sensor is not wired properly or it doesn’t have enough
power.
Regards,
Sara

Reply

Filippo Germi
September 26, 2021 at 10:52 am

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 85/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Hi really nice tutorial, i could replicate it quite easily, now i have problem/doubt, i’d put 3
dallas sensors that should read in three different positions, but web server shod me just one
temperature (F and C) value, how to get the
sowed all reading just in celsius?
Thanks for help

Reply

Filippo Germi
September 26, 2021 at 3:42 pm

Hi nice tutorial, i tried the web server example and perfectly work, then i’d connected 3Dallas
sensor in serei (as per example) with web server code, unfortunately it shows only 1
temperature. How to modify the code for get show 3 different temperature (one for sensor)
just in C? thanks

Reply

Sara Santos
September 27, 2021 at 11:06 am

Hi.
We have an example with multiple sensors with web server.
Here it is: https://randomnerdtutorials.com/esp8266-nodemcu-plot-readings-charts-multiple/
Regards,
Sara

Reply

Filippo Germi
October 8, 2021 at 1:29 pm

thanks i’ll try


regards Filippo

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 86/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

Joschen
November 30, 2021 at 4:06 pm

Hi Sara,
hi Rui,
thank you for that very helpful tutorial I’ve learned a lot from.
I wonder if and how to can enhanche the code for requesting date/time from a NTP-time
server. Maybe you have already an example and share the code.
Thank you

Reply

Sara Santos
November 30, 2021 at 4:18 pm

Hi.
Here’s a tutorial about NTP time: https://randomnerdtutorials.com/esp8266-nodemcu-date-
time-ntp-client-server-arduino/
Regards,
Sara

Reply

Dragos Chelan
December 30, 2021 at 5:25 pm

Hi,
Thank you for the tutorial
I used it for a project that uses 3 pcs ds18b20. I only use degrees Celsius. I changed the
temperature display to degrees F for sensor 2 and added another sensor. I tried to make the
changes so that the web page would refresh itself for all 3 values, but only the first two are
updated. What exactly needs to be changed?

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 87/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Reply

Chelan Dragos
January 2, 2022 at 11:38 am

I done it. I forgot to multiply setInterval function.


Great tutorials you got here, many thanks

Reply

Frank
February 8, 2022 at 9:52 pm

Hi, greetings from Italy, I wanted to know if it is possible to modify the sketch to get 4 or
more DS18B20 sensors only in Celsus and on the web page, in the same way as your sketch
that I tried and it works only with 1 sensor even if I have connected them 4.
I would add that I am not a very trained programmer.
I can modify existing sketches a little.
Thank you.

Reply

Rolf
February 28, 2022 at 8:12 pm

Hi,
Do you have an example with several DS18S20 on Node MCU providing the temperature
values via MQTT?
With kind regards
Rolf

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 88/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Sara Santos
March 1, 2022 at 12:23 pm

Hi.
Here it is: https://randomnerdtutorials.com/esp8266-nodemcu-mqtt-publish-ds18b20-
arduino/
Regards,
Sara

Reply

Roy
March 22, 2022 at 11:42 pm

Thanks for this great tutorial. To make the website work, I had a compile error at first but
installing the AsyncTCP library from github resolved it.

Reply

ilas
May 18, 2022 at 9:25 pm

Hi Sara, great tutorial!


After many tests I realized that the ESP8266 tends to heat up a lot (it absorbs 70mA) I
deactivated the “soft AP” mode but it continues to heat up a lot, if I try with other codes that
always act as a web server towards the ESP8266 always reading the temperature of the
DS18b20, I notice that the absorption drops to about 30mA with the ESP8266 lukewarm.
I preferred to use your code because it is nicer also in terms of graphics of the web page …
Is it possible to make it heat less?
Thanks in advance

Reply

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 89/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Leave a Comment

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

Post Comment

Visit Maker Advisor – Tools and Gear for


makers, hobbyists and DIYers »

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 90/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

Home Automation using ESP8266 eBook and


video course » Build IoT and home automation
projects.

Build a Home Automation System from


Scratch » With Raspberry Pi, ESP8266,
Arduino, and Node-RED.

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 91/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 92/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 93/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 94/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 95/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 96/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 97/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 98/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 99/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 100/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 101/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 102/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 103/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 104/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 105/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 106/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 107/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 108/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 109/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 110/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 111/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 112/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 113/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 114/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 115/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 116/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 117/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 118/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 119/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 120/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 121/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 122/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 123/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 124/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 125/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 126/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 127/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 128/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 129/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 130/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 131/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 132/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 133/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 134/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 135/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 136/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 137/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 138/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 139/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 140/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 141/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 142/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 143/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 144/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 145/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 146/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 147/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 148/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 149/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 150/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 151/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 152/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 153/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 154/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 155/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 156/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 157/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 158/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 159/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 160/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 161/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 162/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 163/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 164/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 165/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 166/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 167/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 168/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 169/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 170/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 171/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 172/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 173/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 174/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 175/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 176/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 177/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 178/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 179/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 180/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 181/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 182/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 183/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 184/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 185/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 186/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 187/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 188/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 189/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 190/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 191/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 192/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 193/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 194/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 195/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 196/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 197/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 198/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 199/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 200/201
6/27/22, 9:38 AM ESP8266 DS18B20 Sensor Web Server Arduino IDE (Single, Multiple) | Random Nerd Tutorials

About Support Terms and Conditions Privacy Policy Refunds Complaints’ Book
MakerAdvisor.com Join the Lab

Copyright © 2013-2022 · RandomNerdTutorials.com · All Rights Reserved

https://randomnerdtutorials.com/esp8266-ds18b20-temperature-sensor-web-server-with-arduino-ide/ 201/201

You might also like