In this tutorial we will show how to build DS18B20 and ESP8266 temperature sensor without Arduino. We will use Arduino IDE and report temperature over WiFi on EasyIoT server.

Sensor temperature is visible in EasyIoT server Web interface. If data logging is enabled you can see temperature chart.

Sensor temperature chart

Materials

ESP8266 WiFi module

ESP8266 ESP-01 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-01 Serial WIFI Wireless Transceiver Module
$2.45
$8.10
ESP8266 ESP-03 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-03 Serial WIFI Wireless Transceiver Module
$2.07
$2.15
ESP8266 ESP-12 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-12 Serial WIFI Wireless Transceiver Module
$2.09
$1.88
ESP8266 ESP-05 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-05 Serial WIFI Wireless Transceiver Module
$1.88
$3.89
ESP8266 ESP-07 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-07 Serial WIFI Wireless Transceiver Module
$2.18
$1.87
ESP8266 Lua Nodemcu WIFI Network Development BoardESP8266 Lua Nodemcu WIFI Network Development Board
$7.43
$3.20

 

DS18B20 temperature sensor

DS18B20 DALLAS Temperature SensorDS18B20 DALLAS Temperature Sensor
$0.99
$0.99
DS18B20 DALLAS Waterproof  Temperature Sensor DS18B20 DALLAS Waterproof Temperature Sensor
$1.44
$1.05
DS18B20 Temperature Sensor moduleDS18B20 Temperature Sensor module
$1.89
$1.99
 

 

4.7K resistor

400X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm400X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm
$1.82
$3.99

 

See buying guide at the end of tutorial.

EasyIoT server configuration

In EasyIoT server add new node in Virtual driver. Node type is Temperature (AI). Tutorial how to add node to EasyIoT server can be found here. Remember Virtual node address, because you will need it later.

Program

Program is available at GitHub. It is based on program contributed by community member @Dennis. To load program you will need ESP8266 Arduno IDE. Read Arduino ESP8266 IDE tutorial how to program ESP8266 in Arduino IDE.

In program you will need to change some settings. First set your AP username and password:

#define AP_SSID "your ssid"

#define AP_PASSWORD "your AP password"

Next change settings related to EasyIoT server like username, password, IP address, port and node address. Change following lines:

#define EIOT_USERNAME    "admin"

#define EIOT_PASSWORD    "test"

#define EIOT_IP_ADDRESS  "192.168.1.5"

#define EIOT_PORT        80

#define EIOT_NODE        "N13S0"

Connection

Connection diagram is very simple. Add DS18B20 to ESP8266 GPIO2 and one pull up resistor.

ESP8266 DS18B20 connection

 

ESP8266 DS18B20 temperature sensor prototype

 

Check also EasyIoT Clud ESP8266 DS18B20 temperature sensor.

See more tutorials at ​http://iot-playground.com/build​ 

Buying guide

To support this site and EasyIoT framework development please buy in our store.

DS18B20 DALLAS Temperature Sensor

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements.

5PCS DS18B20 DALLAS Temperature Sensor

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements.

DS18B20 DALLAS Waterproof Temperature Sensor

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements

DS18B20 Temperature Sensor module

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements.

400X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm

5pcs 3.3V regulator module 800mA

Basic regulator module based on AMS1117.

2xAA 3V Battery Holder Box Case Wire

This 2xAA battery holder puts a nice finishing touch on your battery powered project.

10Pcs 2xAA Plastic Battery Storage Case Box Holder

This 2xAA battery holder puts a nice finishing touch on your battery powered project.

ESP8266 ESP-01 Serial WIFI Wireless Transceiver Module

ESP8266 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-03 Serial WIFI Wireless Transceiver Module

ESP8266 serial WIFI model ESP-03

ESP8266 ESP-12 Serial WIFI Wireless Transceiver Module

ESP8266 serial Port WIFI wireless module ESP-12

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266 Lua Nodemcu WIFI Network Development Board

ESP8266 Lua Nodemcu WIFI Network Development Board

 


Comments   

#19 Matt 2017-01-19 08:17
I'm using a BMP280(Temp,Hum,Pres). Using this example I was able to set it up to log both temp and humidity. When I add a node for pressure I set the node to Pressure(AI) and node is N24S0.
/Api/EasyIoT/Control/Module/Virtual/N24S0/ControlL evel/SOMEVALUE returns "404 Not Found"
If I set the node to Temperature(AI) or Humidity(AI) the same url works.
+1 #18 Adam 2016-04-10 19:16
Unfortunately I have an error:

ESP8266-DS18B20:56: error: 'base64_encode' was not declared in this scope

base64_encode(unameenc, uname, strlen(uname));
+1 #17 poulayn 2016-03-06 20:37
eps8266WIFI LIBRAIRY DOWLOAD OR ???
#16 Super User 2016-02-16 08:48
Quoting 이건희:
I got an error with avr/pgmspace
in Base64.cpp, #include
exists but I can't find avr/pgmspace.h

how can i solve this problem

help me


Please search forum for solution.
#15 이건희 2016-02-16 08:04
I got an error with avr/pgmspace
in Base64.cpp, #include
exists but I can't find avr/pgmspace.h

how can i solve this problem

help me
#14 Jose Vazquez 2015-10-25 15:15
Hi. Is it possible to combine two sensors on an single ESP module? For instance: temp and humdity. Thanks
#13 Leon van der Krogt 2015-10-08 18:25
Another issue I had with understanding how it works;

first generate a new virtual node ID(http://iot-playground.com/2-uncategorised/39-how-to-add-module-to-easyiot-server) in EasyIoT server. See the ID on picture "node added". The generated number is the ID you have to fill in the sketch before uploading;

Change in the sketch;
define EIOT_NODE "N13S0" ------ here you change N13S0 into the generated code.
#12 David Hughes 2015-10-08 10:03
Tried changing
avr/pgmspace.h into pgmspace.h in Base64.h library and it worked fine
#11 Leon van der Krogt 2015-10-07 21:57
This problem? "/pgmspace.h: No such file or directory"


Probably you are missing the Base64 library in the Arduino IDE.
Goto; Sketch, Include Library, Manage Libraries...
Search for base64 and install this one.

Then open \libraries\arduino-base64-master\Base64.cpp and change;
avr/pgmspace.h into pgmspace.h

Stop and start Arduino IDE and try again.
#10 David Hughes 2015-10-04 17:59
Quoting Todd McIntyre:
New error? After adding Base64.h I'm now getting

C:\Program Files (x86)\Arduino\libraries\arduino-base64-master\Base64.cpp:2:26: fatal error: avr/pgmspace.h: No such file or directory
#include
^
compilation terminated.
Error compiling.

huh?



I also get the same error.

Was there a resolution to this? I have included all the libraries, but clearly something is not right

You have no rights to post comments