ESP8266 Weather Server With LCD Display

36K14910

Intro: ESP8266 Weather Server With LCD Display

Components

  • NodeMCU ESP8266 Chip or any other ESP8266 chip
  • 1602A 16x2 LCD Display
  • I2C LCD Backpack
  • Some wires and breadboard
  • DHT11 Temperature Sensor

STEP 1: Attaching ESP8266 on Breadboard

  • This step is connecting the chip on to the breadboard .
  • Do not connect any wires yet.

The board should look like above picture without the wires .

STEP 2: Connect I2C Backpack to LCD Display

In this step you are to connect the I2C backpack board to the main 1602A LCD Board.

The I2C Board exposes only four wire pins

STEP 3: Temperature Sensor DHT11

Place the DHT11 Sensor on bread board as shown in image.

STEP 4: Wiring Connections

Sensor Wiring

  • GND - ESP8266 GND Pin
  • VCC - ESP8266 3.3 V Pin
  • Data - ESP8266 RX Pin

LCD I2C Wiring

  • GND - ESP8266 GND
  • VCC - ESP8266 5V Pin
  • SDA - ESP8266 D2 Pin
  • SCL - ESP8266 D1 Pin

ESP8266

  • Connect with micro usb cable to laptop
  • Make sure you have the USB to UART Driver installed
  • Install Arduino and install the below libraries and boards
    • LiquidCrystal I2C
    • DHT
    • ESP8266 Board

  • Run the arduino IDE and look for ports in tools and select the USB - UART Port
  • Then from samples choose blink example, upload and test if LED blinks
  • Now copy the code - Weather Server LCD Code

Then publish it and voila it will start showing the temperature and humidity in your lcd . Make sure to change Wifi config in code.

Also if you open browser : http://iot-web.local/api

It will also show an api with same sensor data

8 Comments

I have 2 problems at a time:
First: my LCD works only on 3V (where it displays very weak) not on VIN and i don't really know why.
Second: if i click http://iot-web.local/api - nothing happens
Amazing! The LCD didn't work at the start, but I changed the parameters into "LiquidCrystal_I2C lcd(0x27, 16, 2)" instead of "LiquidCrystal_I2C lcd(0x3F, 16, 2)"

Hi, may I ask - the ESP is 3.3v but the DHT and the LDC are both 5v - how do you overcome this difficulty and get a bright/readable display?

Thanks

D6

Hi I have used the NodeMCU variant of the esp8266 which comes with a 3.3v plus a 5v pin as well and the voltage regulator is also part of the board. Try that one out

OK cool - I am using an esp-201 with the external antenna to get some distance reliability (down the garden to the workshop) and add a server to the project, so I may well use a regulator module. Thanks. Good project.

Nice. This would be really useful to have next to my alarm clock. Then you could know the weather when deciding what to wear for the day.