| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This project connects several air quality sensors via i2c bus to the ESP8266 microcontroller. It automatically detects the supported sensors. Most WiFi features of the ESP8266 are implemented (web, telnet, web sockets, mqtt, mDNS, ntp client, upload).
Table of contents generated with markdown-toc
There are many sensors for indoor air quality: Air Quality Sensors List
At this time this software supports the following devices:
The electrical and softare specifications of the selected sensors are listed in Sensor Specs.
It should be straight forward to use this frame work to expand but also to remove unwanted modules.
Many gas sensors are not suitable for low power operation as a metal oxid sensor needs to be heated for a brief time. For humidity, tempterauter and pressure mesaurements, the system can run from a battery.
To build the system one will need to consider the ESP8266 pinout and configuratin as well as the Wiring of the Board As can be seen in the images below, I use a standard PCB and add JST connectors and socker for ESP. The front and back panel I cut on laser cutter. I use M2.5 stand offs.
Sorry no circuit diagram with pullup and wire connections has been made to include in the docs at this time.
The software folder in this destribution will need to become the main sketch folder (Arduino Preferences). When opening Sensi main program, all other modules are loaded.
This software will work with ESP8266 2.x and 3.x Arduino Libary. However several libraries were modified for 3.x compatibility as listed below. The byte statement was replaced with uint8_t.
All hard coded settings are stored in .h files in the src folder.
For first time progamming of a new ESP, you will need to upload via a USB cable. Afterwards you can use OTA or http uploader.
You will also need to upload files to the LittleFS using the https://github.com/earlephilhower/arduino-esp8266littlefs-plugin in order to view the sensor from a web browser. After initial upload you can upload files to (http://host/upload).
The libraries included in this distribution are:
Data is displayed on an LCD and can be sent to MQTT server or viewed through Web Page. A Websocket interface has been created that transmitts data in JSON format. It is unwise to enable MQTT and Web Page services simultanously as likley there is not enough memory and CPU time available to handle both.
When wireless connection is lost, the wifi driver scans for available networks and reestablishes the connection. Up to 3 netids can be setup.
The software currenlty works with multiple separate i2c buses. The software scans all availabel pins for i2c devices and identifies the pin configuration for SCL and SDA for the supported sensors. The motivation to provide multiple ports was that some breakout boards affect the proper operation of other boards. For example LCD display corrupts within 12-24hrs time frame. SPS30 does not properly reset after program upload. MLX sensor sometimes reports excessive or negative temperature. ESP8266 Arduino frame work does not provide independent i2c interfaces and all share one single i2c layer. Its not possible to run multiple i2c ports at different clock speeds and with different clock stretching simultanously. However before each communication one can switch to a differnt SCL and SDA pins and set the clock speed.
Most settings are stored in EEPROM and can be changed at runtime. Over the air programming OTA, JSON encoding, HTTP firmware updater (http://host:8890/firmware), telnet interface, HTTP server are provided and can be enabled/disabled.
Runtime settings are listed in Runtime Settings and over the terminal with '?' command.
Passwords are set but since SSL is not available, the system is not particulary secure. For more secure use, disable telnet and littleFS upload.
Debugging of code was enabled with two approaches:
If you do not want the backlight of the LCD to blink you can turn it off in the settings. You can also have it turn itself off during the night.
The sensor readings are compared to expected range and LCD backlight flashes if readings are outside recommended range. Those ranges are:
It is common to find CO2 concentration above 1000ppm in single family homes. To lower CO2 concentration you need to open two windows at opposite sides of the house and let air circulate.
The LCD screen is a HD44780 compatible display with 4 lines of 20 characters.
It uses and I2C to LCD adapter that is based on PCF8574T.

The sensiorion SCD30 is a light based CO2 sensors and measures addtionally temperature and humidity.
https://www.sensirion.com/en/environmental-sensors/carbon-dioxide-sensors/carbon-dioxide-sensors-co2/

The sensirion SPS30 is a particulate matter sensor based on light scattering.
https://www.sensirion.com/en/environmental-sensors/particulate-matter-sensors-pm25/

The senserion SGP30 is a metal oxide gas sensor measuting tVOC and eCO2.
https://www.sensirion.com/en/environmental-sensors/gas-sensors/sgp30/

The Bosch BME680 measures temperature, humidity, perssure and airquality. Air quality is a VOC senosr.
https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors-bme680/

The sciosense device measures eCO2 and tVOC.
https://www.sciosense.com/products/environmental-sensors/ccs811-gas-sensor-solution/

The Melex MLX sensor series is a contact less IR temperature sensor.
https://www.melexis.com/en/product/MLX90614/Digital-Plug-Play-Infrared-Thermometer-TO-Can

The Maxim 30105 is a multi wavlength reflectance sensor, built to detect heartbeat and blood oxygenation.
https://www.maximintegrated.com/en/products/interface/sensor-interface/MAX30105.html

Data display through:
Network related libraries:
Other Libraries: ArduJSON https://github.com/bblanchon/ArduinoJson.git
Wifi
Displaying Data through Web Site
Working with JSON:
https://circuits4you.com/2019/01/11/nodemcu-esp8266-arduino-json-parsing-example/
Creating Webcontent on ESP
GET & POST https://randomnerdtutorials.com/esp8266-nodemcu-http-get-post-arduino/
JSON & autoupdate https://circuits4you.com/2019/03/22/esp8266-weather-station-arduino/
JSON & tabulated data https://circuits4you.com/2019/01/25/esp8266-dht11-humidity-temperature-data-logging/
Simple autorefresh https://circuits4you.com/2018/02/04/esp8266-ajax-update-part-of-web-page-without-refreshing/
WebSocket
HTTP Update Server for Firmware Update
NTP
Air Quality
Weather Data
| Back | FazBrowse Home | New Git URL |