Skip to content

CO2-Detector - Arduino/ESP/Display and Sensor

Advertising
Advertising
?
Creation quality: 5.0/5 (2 votes)
Evaluation of members on the printability, utility, level of detail, etc.

  • 12.6k views
  • 13 likes
  • 240 downloads

License
3D design format
STL and ZIP Folder details Close
  • box_esp49_26.stl
  • box_esp58_31.stl
  • box_nano.stl
  • code.zip
  • ledtube.stl
  • lid.stl
  • wall.stl

Learn more about the formats

Last update 2021-01-10 at 19:38
Publication date 2020-11-27 at 13:24
?
Published to Thingiverse on: 2020-11-26 at 19:33
Design number 234882

3D printer file info

3D model description

This thing measures temperature, humidity and CO2-level. The values are displayed on the LCD. An rgb-LED indicates when it´s time to ventilate. Additionally all the data can be broadcasted via MQTT to a server and then been shown as a chart in your browser.

Basics

I times of corona we are told to ventilate quite often. On the other hand we don´t want to sit in the cold. So there are several projects that build a „traffic-light“ to indicate when it´s time to ventilate.

First I just wanted to experiment a bit and used an arduino nano that I had laying around. I bought a cheep MQ-135 sensor which measures serval gasses in the air. With the library installed, an equivalent CO2-value is calculated.This seamed to be good enough, cause I just wanted to have an indicator when it´s time to ventilate. But calibrating that thing in fresh air didn´t work for me - I didn´t get reproducible values.
So I tried a CCS811 next. This one has logic on board and does the calculation of eCO2 and the calibration (base curve) by itself. But one problem remained: Whenever a disinfectant with alcohol in it is used in the room, the values had extrem high peaks.

That´s when I decided to try an „real“ CO2-Sensor, a MH-Z19B.This one has a temperature-sensor build in as well, so that it can do the environmental adjustment of the measurements. It assumes, that the lowest measured level in the last past 24 hours was taken in fresh air (400 ppm). This is the way this thing does it´s self calibration. This works fine in, for example, an office. Over night the CO2-level drops to about 400 ppm. Bingo - this one finally seams to be reliable!

The second sensor used in the project, the DHT22, delivers temperature and humidity - the air should be to dry (not below 50%), when you do corona-prevention - so you can monitor this too.

But of course you can use the other eCO2-sensors as well to experiment for yourself and for doing some fun stuff. The simple case I made for this purpose can carry all of them in the vented compartment.

The Housings

This one won´t win a price for elegant design - but it has room left for further improvement and experiments. There is a fix place for the 1602 display and the used logic-board. On the left, there is a vented compartment for the sensors. The inner wall can be removed for an easy mounting of the elements. I just used double-sides-tape to mount my two sensors.

The RBG-LED (1) was installed later. I drilled a 16 mm hole for it and used hotglue to fix it. The LED-tube itself is printed from transparent plastic.

Feel free to install a lipo and a step-up-converter or whatever you want ...

There are three versions of the body, for
- arnuino nano
- node-esp8266 development boards - 49 x 26 mm
- node-esp8266 development boards - 58 x 31 mm

The Sketch(es)

There is one that runs without WiFi. it just display the measurement locally on the display and by changing the color of the led. You can use this one with an arduino nano for example. Eventually you have to check/change the pins where sensor and so are connected.

The main sketch uses WiFi as well. Ad your credentials and the esp should connect to your router. Of course, this only makes sense if you want to use a mqtt-broker (add the ip) and node-red as well. If you do this, you can display the values over time in your browser and you can switch on/off the LCD-backlight as well :)
You can install both, mqtt-broker and node-red server on a rasperry. There are several tutorials online on how to do this.
As an alternative you can use a external service for that. This is a public and free one I found - but I haven´t testet it: https://www.hivemq.com/public-mqtt-broker/

Have a look at my screenshots. I add my Node-Red-flow as well.

You can influence the color-change by editing the constants for the colors. In case of corona-prevention you have to ventilate when 1000 ppm are reached. Against tiredness and for a better power of concentration do it at the latest from 1800 ppm. Thereafter, with the actual presets, the led will blink red!

I installed the following libraries:
- DHT sensor library (by Adafruit 1.4.0)
- MHZ19 (by Jonathan Dempsey 1.5.1) https://github.com/WifWaf/MH-Z19
- PubSubClient (by Nick O`Leary 2.8.0)
- RunningAverage (by Bob Tillaard 0.3.1)
- LiquidCrystal_I2C (by Frank de Brabander 1.1.2)
- Adafruit NeoPixel (by Adafruit 1.7.0)

Parts Used

Display 1602 (Hitachi or compatible) with I2C-port
Arduino Nano or ESP8266 for the WiFi-Version
MH-Z19B
DHT-22
RGB-LED (2810, here one pixel)
Resitor 470k
Some wire, solder, srews ...

Alternatives

Here are the alternaives for the other mentioned sensors if you like to experiment with them:

CCS811
The library: https://github.com/maarten-pennings/CCS811

MQ - 135
The library - https://github.com/GeorgK/MQ135

In the libraries there are examples that show how to use them. It should be easy to change the sketch appropriate.

Live long and prosper!

Advertising


Issue with this design? Report a problem.

Would you like to support Cults?

You like Cults and you want to help us continue the adventure independently? Please note that we are a small team of 3 people, therefore it is very simple to support us to maintain the activity and create future developments. Here are 4 solutions accessible to all:

  • ADVERTISING: Disable your banner blocker (AdBlock, …) and click on our banner ads.

  • AFFILIATION: Make your purchases online by clicking on our affiliate links here Amazon.

  • DONATE: If you want, you can make a donation via Ko-Fi 💜.

  • WORD OF MOUTH: Invite your friends to come, discover the platform and the magnificent 3D files shared by the community!


Sharing and downloading on Cults3D guarantees that designs remain in makers community hands! And not in the hands of the 3D printing or software giants who own the competing platforms and exploit the designs for their own commercial interests.

Cults3D is an independent, self-financed site that is not accountable to any investor or brand. Almost all of the site's revenues are paid back to the platform's makers. The content published on the site serves only the interests of its authors and not those of 3D printer brands who also wish to control the 3D modeling market.

100% secure payment by credit card, PayPal, Apple Pay, Google Pay, etc.
View all payment options.