I often work or sleep for hours in a close room so I got an idea to make my own device - my CO2Cube - to warn me if there is an exhaled air in the room. It operates in the body like a poison, so it is not good to work or sleep in such room. Now I get a kick to open a window or (moreover) it opens and closes the window itself when I sleep, as described in my next project:
https://create.arduino.cc/projecthub/viliamk/arduino-opens-a-window-when-the-air-in-a-room-is-exhaled-bda092?ref=user&ref_id=1736455&offset=0
My portable CO2Cube contains:- CCS811 sensor to measure the CO2
- pasive buzzer to make a sound if the CO2 level is high
- KY-001 temperature sensor
- OLED display 128x32
- push-button to show values on display
- 3.7V battery from an old mobile
- micro USB 5V Lithium Li-ion 18650 Battery Charger Module
- switch to turn ON/OFF my CO2 cube
- nRF24L01 transmitter to send a signal to open or close a window
The challenge of a portable arduino project is always about its consumption. To extend the battery life after charging there are following features:
- the measurement is every 10th second, during this time we put Arduino and CO2 sensor to sleep
- the brightness of the OLED display is reduced
- if there are acceptable values of CO2, the OLED display is OFF, we can display values for a short time by pushing the button
- if values of CO2 are higher, the OLED display starts to show them permanently and we are warned by the buzzer. It also sends a signal to another device to open or close a window.
The swith connects Arduino directly to the lithium battery to its 3.3V pin.
All the components are connected to this 3.3V pin of Arduino.
The code lower is divided into more tabs to be transparent. The tab PIN_scheme describes easily how to connect all the components correctly.
If you copy the code, copy the CO2Cube tab as the first code, then others.
DeviceThe making of the box for my CO2 cube took a lot of fun. The only problem I had was, that if I closed the CO2 sensor in the box with a small hole, it showed very weird values. I had to leave the sensor outside in the air.
Comments