Introduction: ESP8266 WiFi Temperature and Humidity Sensor

Picture of ESP8266 WiFi Temperature and Humidity Sensor

In this tutorial we will build ESP8266 WiFi Arduino temperature and humidity data logger. Data will be stored on EasyIoT server and displayed in web browser on remote computer or on mobile phone. With ESP8266 EasyIoT Arduino library you can build sensor with couple lines of code. You can add up to 65535 sensor nodes to one EasyIoT server.

EasyIoT server supports secure SSL connection - ESP8266 does not.

Look also to simplified version in EasyIoT Cloud:

See more tutorials at

Step 1: Materials

Picture of Materials

ESP8266 WiFi module

Arduino pro mini 8Mhz 3.3V

DHT22 temperature and humidity sensor

5V power supply

AMS1117 3.3 regulator

Capacitor 1000uF

EasyIoT server (Windows machine or Raspberry Pi)

WiFi network (WiFi router)

Step 2: Build Sensor Node

Picture of Build Sensor Node

Conenct Arduino pro mini, ESP8266, power supply and DHT22 temperature humidity sensor.

VCC 3.3 V to Arduino pro mini

VCC 3.3V to DHT22 sensor VCC

VCC 3.3V to ESP8266 VCC module

VCC 3.3V to CH_PHD pin on ESP8266 module

connect GND on Arduino, DHT22, ESP8266 and power supply GND

connect pin 3 on Arduino to pin RST pin on ESP8266

connect pin 10 on Arduino to pin UTXD pin on ESP8266

connect pin 11 on Arduino to pin URXD pin on ESP8266

connect pin 2 on Arduino to pin DATA pin on DHT22

After you connect wires upload program to Arduino sensor node. Before we start using ESP8266 WiFi module we need to update ESP8266 firmware. We use V0.9.2.2 version of firmware. Detail instructions how to update firmware can be found here.

ESP8266 temperature humidity program is on GitHub. Don't forget to set correct access point username and password and EasyIoT serverIP address in Esp8266EasyIoTConfig.h

Step 3: Build EasyIoT Server

Picture of Build EasyIoT Server

EasyIoT server will be responsible for logging sensor data. You can add up to 65535 ESP8266 WiFi sensor nodes to one EasyIoT server.

If you are using Windows machine: just download latest release of EasyIoT server win release and unzip it to Windows machine. Run EasyIoT.exe under administrator privileges.

Or if you are using Raspberry Pi: download latest version of EasyIoT server disc image to SD card. Windows users can write EasyIoT server image to SD card with Win32 Disk Imager.

Put SD card in Raspberry Pi and switch on Raspberry Pi. Raspberry Pi must be on same network as ESP8266 module.

Step 4: Add Sensor Node to EasyIoT Server

Picture of Add Sensor Node to EasyIoT Server

In web browser on computer enter Raspberry Pi IP address. Use username admin and password test when asked.

Go to Configure->Drivers->ESP8266 EasyIoT driver and enable driver. Press button Add Node and switch on your ESP8266 Arduino sensor. After couple of seconds you should see two added sensor modules (no timeout message). Then go back and add new modules to Group and modules and enable data logging (see attached pictures).

Step 5: Display Data

Picture of Display Data

Go in Web browser in computer and enter IP address of your Raspberry Pi. On front page you should see current temperature and humidity and chart of temperature and humidity.

Display data in web browser on remote computer or on mobile phone.


bcd98nw306 (author)2017-05-02

I've seen similar configurations that include a resistor but no capacitor. Is the capacitor required?

robkabob147 (author)2017-03-02

Could you run this off a coin cell battery? For example, I'd like to put this in my fridge to log temp and alert me if it drops below a certain point. So running a 5V power cord into the fridge would be a pain.

zencuke (author)2016-11-14

Nice project. By the way ESP8266 does support SSL. Why do you say it doesn't? Maybe it has been added since you posted this? Maybe it is the firmware on the esp8266 serial boards you use that don't support it? Lua and Micropython firmware both support SSL on esp8266.

If I do this I will likely use an I2C sensor instead. Then you don't need the Arduino. I'll probably use an MQTT server. It is rapidly becoming the standard for simple sensors. I wouldn't be surprised if EasyIot isn't based on MQTT anyway. They are a little short on technical data on their web pages so it is hard to tell. Anyway thanks for the Instructable..

Akin Yildiz (author)2014-12-20

this looks fun. i have done something similar. i really like the webpage interface. is that from the easyiot software?

EasyIoT (author)Akin Yildiz2014-12-22

Yes, this is EasyIoT interface. It works good on desktop and mobile devices and supports secure SSL connection (ESP8266 does not suport SSL).

I noticed that you have many projects supporting "electronic" gardening. I'm also using EasyIoT to monitor and control my balcony garden. Maybe I will write instructable about this.

Did you try NRF24L01 transceiver? It's really low power - it consumes less than 1/10 power of ESP8266 and it's really suitable for battery sensors. EasyIoT also supports NRF24L01.

sahrulrashid (author)EasyIoT2016-03-16

Do have tutorials or instructables on how to use NRF24L01 with arduino ? I build something that use moisture sensor with arduino and i want it to connected with EasyIOT using NRF24L01.

Can you point me to the right direction ? :D

BenediktM (author)EasyIoT2015-07-28

The esp does support ssl!
Just use nodeMCU

Akin Yildiz (author)EasyIoT2014-12-22

have you seen the plant doctor family ? the reason i chose ESP is that so I don't have to have a base, like raspi to capture data. NRF24L01 is bluetooth right? forgive my simple questions, i'm a true beginner. I am trying to put my system into plant pots and make it run on battery. it needs to be usb-rechargable as well. size/mobility is an issue. for model making my current setup is the smallest in size... i need a lot of help making my system more advanced/stable - especially better battery time. wouldn't you say using a wifi system be more universal/mobile. I can take my plant to anywhere with wifi and it will start uploading data.?!

EasyIoT (author)Akin Yildiz2014-12-22

Nice. NRF24L01 is not bluetooth. If you are using ESP on battery, then put it in sleep mode or it will consume too much battery. See my webpage for Arduino low power tips. Some of my sensors will work 10 years on 2 AA alkaline batteries. You can join forum and ask questions.

thomauto (author)2015-08-12

This might be a silly question but, will it display in fahrenheit? I'm going to build this when the parts get here but i was just curious.


scottinnh (author)thomauto2015-09-17

I mean this nicely, but it is a silly question. :-) These are just values. It's easy to represent the values as how our Imperial overlords wanted us to (until they switched to Metric anyways). You can also make up your own temperature system, so that water boils at 666 and freezes at 42. It's just scale.

(See the map() function for some easy ways to scale/convert, although for something like C<->F or F<->C there are are dedicated functions).

godfish (author)scottinnh2015-09-26

Ok, it's so easy? but how do you do it? most of us don't know how to do the code, or even know how to start...

tytower (author)godfish2016-03-13

See the examples at and others , sparkfun,etc It is a one line change in the code .very easy

scottinnh (author)2015-09-27

Just to respond to the reply post that isn't showing up (deleted?), the "easy" way to do anything in software is the same as learning a foreign language. You google a few translation (tell Google what you want) and then look over the answers.

If you are forced to, you can learn phrases, like you can learn to say "Bonjour, je m'apelle Scott. Parle vous Anglais?". (Apologies to Francophones for any errors here). That's step one: find some code that "works", but isn't perfect. C->F temp conversion is very common on Arduino, so I can guarantee Google will uncover something for you.

What you may find is a code snippet, incomplete and doesn't work for you as-is. That's when you need to do a little short reading about what you're trying to do, to know how something gets used without problem. error messages can be googled also.

Learning code is an iterative process, can be full of mistakes, but you adapt. It is a wonderful thing if you can learn to code but you don't do it for a living... It's a great surprise skill if your group of friends and hobbyists need something accomplished in code, and you can do it. The Arduino community is full of non-programmers, who can get stuff done by "learning just enough code".

ИванД2 (author)2015-05-28

Can i use Arduino pro mini V5, 16 MHz?

priyam170 (author)2015-04-30

how can i make the esp's IP static(assigned by router,something like

EasyIoT (author)priyam1702015-04-30

In this case you do not need static IP for ESP8266. It will work automatically even if ESP8266's IP changed. For more questions please join community on forum:

priyam170 (author)EasyIoT2015-04-30

Actually, I am making a home automation project. I have connected my ESP8266 to my home's wifi connection. and i am controlling equipment s from my phone's html based app for which i need IP of esp module(assigned by my router) but i gets changed

Saiboogu (author)priyam1702015-05-05

Ideally you would use DHCP reservations on your router so the devices can remain on DHCP, and you only need to visit one location to assign and view IPs, rather than update each machine/sensor/etc.

kapilrathi22 (author)2015-02-21

I am using ESP8266 with CP2102. For ESP8266 supply I am using LD33v connected to VCC and CH_PD. as soon as serial monitor is open it shows continuous garbage value which is never ending. How to solve this issue?

EasyIoT (author)kapilrathi222015-04-22

Maybe serial port speed is not correct or you have power supply with no enough current.

Dash_Merc (author)kapilrathi222015-04-22

You might need to overwrite the firmware using and the latest firmware from Espressif. You'll need a breadboard, a USB-to-Serial adapter (FTDI) that speaks 3v3 logic (NOT 5v, or you'll fry the ESP8266), and some jumper cables. There is plenty of information around the web (plenty on YouTube, too if you're a visual learner) to help you achieve this, so I'll leave the research to you.

PetervdPol (author)2015-03-11


Cool project. However: I don't own a Raspberry Pi or a Windoze box; Linux only here. Assuming Raspbian is Debian based and my pc's all run on Debian based distros there would be no obstacle. Wrong assumption, I'll print the errors below. Any chance of getting this running on e.g. Ubuntu 14.04?

Here's the blurb:

sudo mono EasyIoT.exe

2015-03-11T21:01:04.2252470+01:00INFOSystemSystem started

Unhandled Exception:

System.DllNotFoundException: librf24-bcm

at (wrapper managed-to-native) MySensorsDriver.RF24_wrap:new_RF24_2 (byte,byte,uint)

at MySensorsDriver.RF24..ctor () [0x00000] in <filename unknown>:0

at MySensorsDriver.MySensors..ctor () [0x00000] in <filename unknown>:0

at EasyIoT.EasyIoTService..ctor () [0x00000] in <filename unknown>:0

at EasyIoT.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: librf24-bcm

at (wrapper managed-to-native) MySensorsDriver.RF24_wrap:new_RF24_2 (byte,byte,uint)

at MySensorsDriver.RF24..ctor () [0x00000] in <filename unknown>:0

at MySensorsDriver.MySensors..ctor () [0x00000] in <filename unknown>:0

at EasyIoT.EasyIoTService..ctor () [0x00000] in <filename unknown>:0

at EasyIoT.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

EasyIoT (author)PetervdPol2015-03-13

RPI version does not work on Debian, because it uses RPI HW specific drivers - GPIO. That's why you get librf24-bcm error. You my try with Windows version on Debian, just replace System.Data.SQLite.dll with Debina version.

If you have more questions please join forum on our website for quicker response.

PetervdPol (author)2015-03-11

Update: I realised I have a Windoze 10 image in virtualbox, got the same errors, both in 10 and 8 compatibility mode. Using version 0.6 btw..

Thanks for putting this Ible together. I just bought a ESP8266 and I'm looking forward to what I can do with it, including possibly setting up an interface on my website. Looks like will be a good resource for info on my project as well. Thanks!

Thx, I will create more interiesting stuff.

About This Instructable




More by EasyIoT:ESP8266 Smart Plant Irrigation SystemESP8266 Controlling 4 RelaysESP8266 Door/window Sensor With SMS Alarm
Add instructable to: