This is a PlatformIO project designed to display CO2 levels using a Panel ESP32-4848S040.
It reads data from a Senseair S8 CO2 sensor and an SHT31 temperature and humidity sensor, displaying the real-time readings and the history of the last 2 hours.
Sensors are on separate sensor board and are retrieved over websocket.
This setup is chosen because the SenseAir S8 CO2 sensor uses up to 300mA when reading and this makes the tft screen flicker during reading.
You can find the sensor code at the SensorHub repo.
There is also weather forecast data shown which is retrieved from visualcrossing.com.
You will need to setup an account with visualcrossing to be able to download weather data but registration and 1000 free API credits per day are included in the free accounts.
You can setup your free account here.
Assuming you already have the SensorHub running and a visualcrossing account API key you can use these steps to install:
- Clone this repository.
git clone https://github.com/CelliesProjects/co2-display-esp32.git
- Open the extracted folder in PlatformIO and add a
secrets.h
file to theinclude
folder with the following content:
#ifndef SECRETS
#define SECRETS
const char *WIFI_SSID = "network";
const char *WIFI_PSK = "password";
const char *VISUAL_CROSSING_CITY = "city";
const char *VISUAL_CROSSING_COUNTRY = "country";
const char *VISUAL_CROSSING_API_KEY = "your api key";
#endif
- Build and upload the firmware to the ESP32.
If all went well the board will now search for the sensorhub and connect automagically.
This project is licensed under the MIT License.