Coder Social home page Coder Social logo

kmetz / coro2sens Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 8.0 3.78 MB

Build a simple device that warns if CO₂ concentration in a room becomes a risk for COVID-19 aerosol infections.

License: MIT License

C++ 100.00%
covid-19 co2-sensor esp8266 esp32 scd30 co2-concentration co2 arduino platformio arduino-sketch

coro2sens's Introduction

CorO₂Sens

Build a simple device that warns if CO₂ concentration in a room becomes a risk for COVID-19 aerosol infections.

  • Measures CO₂ concentration in room air.
  • Controls an RGB LED (green, yellow, red, like a traffic light).
  • A buzzer can be connected that alarms if levels are critical.
  • Also opens a WiFi portal which shows current readings and a graph (not connected to the internet).
  • Can be built for ~ $60 / 50€ (parts cost).

This project was heavily inspired by ideas from Umwelt-Campus Birkenfeld.

You can also find a good overview of the topic by Rainer Winkler here: Recommendations for use of CO2 sensors to control room air quality during the COVID-19 pandemic.

coro2sens overview

Sensors

  • The sensor used here is the Sensirion SCD30 (around $50 / 40€) which is optionally augmented by a BME280 pressure sensor to improve accuracy.
  • Look here if you want to use MH-Z19B sensors.

Threshold values

LED color CO₂ concentration
Green ("all good") < 800 ppm
Yellow ("open windows") 800 – 1000 ppm
Red ("leave room") > 1000 ppm

Based on a Recommendation from the REHVA (Federation of European Heating, Ventilation and Air Conditioning associations, rehva.eu) for preventing COVID-19 aerosol spread, especially in schools.

Web server

You can read current levels and a simple graph for the last hour by connecting to the WiFi coro2sens that is created. Most devices will open a captive portal, immediately showing the data. You can also open http://10.0.0.1/ in a browser.

You need

  1. Any ESP32 or ESP8266 board (like a WEMOS D32 (about $18 / 15€) or WEMOS LOLIN D1 Mini (about $7 / 6€)).
    ESP32 has bluetooth, for future expansion.
  2. Sensirion SCD30 I2C carbon dioxide sensor module (mouser, digikey) (around $50 / 40€).
  3. 1 NeoPixel compatible RGB LED (WS2812B, like the V2 Flora RGB Smart NeoPixel LED, you can also remove one from a larger strip which might be cheaper).
  4. A 3V piezo buzzer or a small speaker.
  5. Optional: Bosch BME280 I2C sensor module (like the GY-BME280 board), for air pressure compensation, improves accuracy (less than $5 / 4€).
  6. A nice case :) Make shure the sensor has enough air flow.

Wiring

ESP8266 pin ESP32 pin goes to
3V3 3V3 SCD30 VIN, BME280 VIN
5V 5V LED +5V
GND GND SCD30 GND, BME280 GND, LED GND, Buzzer (-)
SCL / D1 SCL / GPIO 22 SCD30 SCL, BME280 SCL
SDA / D2 SDA / GPIO 21 SCD30 SDA, BME280 SDA
GPIO 0 / D3 GPIO 16 LED DIN
GPIO 14 / D5 GPIO 19 Buzzer (+)

Flashing the ESP using PlatfomIO

  • Simply open the project, select your env (esp12e for ESP8266 / esp32dev for ESP32) and run / upload.
  • Or via command line:
    • pio run -t -e esp12e upload for ESP8266.
    • pio run -t -e esp32dev upload for ESP32.
  • Libraries will be installed automatically.

Flash using the Arduino IDE

Please let me know of any issues you might encounter (open a GitHub issue or write me on twitter.com/kmetz or [email protected]). Also, I'd be for hire for customizations.

coro2sens's People

Contributors

kmetz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

coro2sens's Issues

Compiling error (solved)

Hi,

I just finished your instructions. I have an ESP8266 board, a Seeed SCD30 and a 3V piezo speaker. I had to download and integrate almost all of the libraries as zips because they were not found in the board manager.

I do not need the LED function and the BME280. When I wanted to compile the script, I got the following error message:

Arduino: 1.8.20 Hourly Build 2021/12/20 07:34 (Mac OS X), Board: "Arduino Uno"

In file included from /Users/privat/Downloads/coro2sens/coro2sens/coro2sens/coro2sens.ino:99:0:
/Users/privat/Documents/Arduino/libraries/ESPAsyncWebServer-master/src/ESPAsyncWebServer.h:26:10: fatal error: functional: No such file or directory
 #include <functional>
          ^~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for Arduino Uno board.


This report would be more detailed if the option
"Verbose output during compilation"
in File -> Preferences would be activated.

Do the errors occur because the components are missing?

BME280 | bme280 stops after the first reading

Hi @kmetz,
thanks a lot for the great instructions. Everything works beautifully over here.
The only small issue i have is, that bme280isConnected changes to false after the first reading of the BME280 sensor.
I can't seem to solve it... any pointers?

Thanks much in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.