Skip to content
CO2, humidity and temperature sensor on ESP8266
Branch: master
Clone or download
jehy Update
added donate badge
Latest commit e1cdc6c Apr 10, 2019

Arduino esp8266 mh-z19 serial

Build Status Donate

CO2, humidity and temperature sensor on ESP8266 with mh-z19 co2 sensor and dht-22 temperature and humidity sensor.

sensor sample

You can use project as backend to this program. See full description on (you can use Google translate from Russian).


All required libraries can be installed with Arduino IDE:

Via console:

arduino --pref "boardsmanager.additional.urls=" --save-prefs
arduino --install-library "ArduinoJson:5.13.3"
arduino --install-library "DHT sensor library:1.2.3"
arduino --install-library "LiquidCrystal I2C:1.1.2"
arduino --install-boards esp8266:esp8266

cp WiFiCreds.h.sample WiFiCreds.h # EDIT AFTER COPY!
cp dataServer.h.sample dataServer.h # EDIT AFTER COPY!

arduino --verify --board esp8266:esp8266:d1:CpuFrequency=80,FlashSize=4M3M arduino-esp8266-mh-z19-serial.ino


  1. Copy file dataServer.h.sample to dataServer.h and specify there your server address;
  2. Copy file WiFiCreds.h.sample to WiFiCreds.h and specify there your WiFi cridentials;
  3. Install DHT sensor library version 1.2.3;
  4. Install ArduinoJson library v 5.13.3;
  5. Install LiquidCrystal_I2C library v 1.1.2;
  6. Compile and upload your sketch;
  7. Enjoy!

For Wemos D1, before compiling sketch:

  1. Add to additional boards in preferences;
  2. Select wemos D1 (or your other board) in boards manager and install it.
You can’t perform that action at this time.