ESP8266 WiFi Temperature and Humidity Sensor





Introduction: 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

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

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

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

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

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.



    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest
    • Oil Contest

      Oil Contest

    28 Discussions

    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.


    4 replies

    The formula for converting Celsius to Fahrenheit is (C * 1.8) +32

    Just put that in your sketch to convert whatever variable holds the temp.

    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).

    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...

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

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

    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.

    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..

    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.

    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

    The esp does support ssl!
    Just use nodeMCU

    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.?!


    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.

    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".

    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

    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.