IoT Weather Station with ESP8266-12E

IoT weather station that shows room and local temperatures.


What is does

Temperature sensor gets temperature data and LCD screen displays it. Local temperature is taken from a server which gets the data from ESP8266-12E has built-in Wi-Fi which it uses to access the server.

Part list

  • ESP8266-12E
  • 1602 LCD Display store link
  • DS18B20 temperature sensor store link
  • 2,2k resistor
  • Breadboard and jumber cables

Prototyping with arduino

Building things with ESP takes a lot longer than Arduino, because of the long upload time. I tested each of the components separately and then made them to work together. I used materials from to set up my computer as a server using a python script.

Switching to ESP8266-12E

Making everything work with ESP was not easy. First the temperature sensor wasn’t giving the same readings as with Arduino. I found this thread where someone told to use 2,2k resistor instead of 4,7k, which worked fine with Arduino.

Up next was getting the data from openweathermap to the ESP. I tried to handle the JSON formatted data with the ESP, but my C++ skills didn’t quite cut it. Instead I set up a server that uses Python Flask to get the data and serve it to the ESP.

Below is the code for Flask.

from flask import Flask
from requests import get
import json
app = Flask(__name__)
def helsinkiTemp():
 r = get("")
 d = r.json()
 t = d["main"]["temp"]-273.15
 return str(t)
if __name__ == "__main__":

Code for ESP can be found on GitHub.


Circuit diagram for the weather station.

The temperature sensor is working in leech mode, where it takes power from the data pin while sending out data from it.

Plans for the future

  • Adding more information, it would be great to know if its raining or not.
  • Right now the device doesn’t actively check if it has a Wi-Fi connection.
  • 3D-printed case.
  • Custom circuit board instead breadboard.

Sources used


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: