Air Quality & Aerosol (VOC) Sensor and Alarm by Spo_ck 3d model
Warning. This content is not moderated and could be offensive.
smoke
3dmdb logo
Thingiverse
Air Quality & Aerosol (VOC) Sensor and Alarm by Spo_ck

Air Quality & Aerosol (VOC) Sensor and Alarm by Spo_ck

by Thingiverse
Last crawled date: 3 years, 4 months ago
Air Quality & Aerosol (VOC) Sensor and Alarm
Please also have a look on my GitHub:https://github.com/Spo-ck/Air-Quality-Aerosol-VOC-Sensor-and-Alarm
During the COVID-19 Pandemic, monitoring the Air Quality is important. Because of this, I developed this compact Air Quality Monitor based on the M5StickC Microcontroller and the SGP30 Sensor. The System is very small and can also be worn as a smart watch. When the eCO2 hits the threshold of 1000 ppm or the TVOC hit the threshold of 150 ppb, the sensor will trigger an alarm (sound and lght), so that you can leave a dangerous and potentially infectious room or open the windows.
System as Smart Watch close up
System as Smart Watch
Electronic
Part List
Electronic
Buzzer module
BME280 Barometric Sensor
GY-SGP30 Gas Sensor (alternative Grove SGP30)
M5StickC Microcontroller
Grove Sensor Cable
PCB
Generic 1x8 Pin Header 2,54mm
Generic solid core wires (PCB)
Generic Lead Solder
Tools
Soldering Station
Solder Pump
Third Hand
Soldering Tools
Pin Mapping
GND: Buzzer Module -, BME280 GND, SGP30 GND
3.3V: Buzzer Module +, BME280 VIN, SGP30 VIN
G26: Buzzer Module S
G32: BME280 SDA, SGP30 SDA
G33: BME280 SCL, SGP30 SCL

Electronic Schematic
Assembly
The system basically consists out of the M5StickC Microcontroller, a Buzzer Module, a BME280 Barometric Sensor Module (Temperature, Humidity, Pressure) and an SGP30 Gas Sensor Module (eCO2, TVOC, Ethanol, H2). The Buzzer Module is connected to the M5StickCs Pin Header, and the seonsors are connected to the I2C bus via the Grove connector.
All 3 components are soldered together on a single prototyping PCB. To this prototyping PCB is then soldered a 1x8 Pin Header (2.54mm) so that the PCB can be connected to the front pin header of the M5StickC. As power supply off all 3 modules, the 3.3V and the GND Pin of the M5StickCs Pin Header are utilized. The Buzzer-Modules signal pin is soldered to Pin 26, because this pin allows output signals.
Because of the sensor modules need to be connected to the I2C Bus, which is only available on the Grove connector of the M5StickC, a 20cm Grove sensor cable was utilized. One connector was cutted of, and the 5V and GND Cables were removed. The remaining Yeallow (G32, SDA) and white (G33, SCL) cables were soldered to the corresponding pins on the PCD, to connect them to the sensor module
PCB Front
PCB Back
PCB Cased
3D-Printing
Settings
Profile: 0.2mm
Infill: 10%
Support: Yes
Parts
Filament: PLA (OWL-Filament)
Printer: Creality Ender 3
Generic M3 Screws
Assembly
The Sensor PCB Case consists out of 3 parts, a body frame, a front and a bottom part. For the Assembly, the Soldered PCB is first fittet into the Body Frame from the bottom so that the case mathes the pin header exactly. The Sensor cable is the placed into the small hole on the top side of the frame. After that, the Front and Bottom Party are crewed to the case. The Screwd sensor case it then first plugged into the Pin Header of the M5StickC. After that, the Sensor Cable is plugged into the Grove Connecter.
PCB Cased
System Detailed View
Arduino Code
You can download the code from my Github
Libraries
M5StickC
Wire.h
Adafruit_Sensor.h
Adafruit_SGP30.h
Adafruit_BME280.h
EEPROM.h
About the Code

The purpose of this Microcontroller Code is to generate sensor data from the sensors connected to trigger an Alarm when the Air Quality is bad. For this reason, the SGP30 Sensor Module measures eCO2 and TVOC in the breathing Air. The BME280 Barometric Sensor is required to calibrate the SGP30, and therefore to enhance its accuracy.
When the eCO2 value is over 1000 ppm, or the TVOC value is over 150 ppb, an alarm is triggered. The alarm will result in an alarm sound provided by the buzzer modele, the built in LED enlight in RED and the display turning RED. By the built in settings options, the Buzzer can also set into silent mode, where only the LED and the Display are tiggered in case of an alarm. The alarm sound is only triggered once in 60s, when the eCO2 or TVOC value hits the threshold value, but the LED will be enlighted in RED untill the Sensor Value is below the threshold again. In addition, the buzzer then disabled for 1 minute. Because of this, you will not hear multible buzzer alarms, when the sensor value is falling below, and hitting the threshold again within one minute.
System Alarm
The System has three built in views. The Detailed View shows only the eCO2 and the TVOC values, whereas the Air Quality view shows the Time, Temperature, Humidity and the Battery Status in addition. More advanced is the Chart View, which shows the eCO2 value for the last 20min. If the critical threshold was hit, the bar shown will turn red, and if the value is below, the bar will be green.
To navigate through the different views, the front button (Button A) is used. The last view is also stored in EEPROM, so that the sensor will start in the last used view when it starts next time.
System Detailed View
System Air Quality View
System Chart View
Nomally, the display is On all time, but it is also possible to disable the display. In this mode, the front button needs to be pressed one time to turn the display on for 5s. After that, pressing this button again will make the view change as usual.
In addidion, a settings view is implemented. In the settings view, one can change the Display Mode (Display always on or on for 5s) and the Alarm Mode (Buzzer turned off or on). This view is opened when the side button (Button B) is pressed. In this view, the first option it the Display Mode. When the Front Button is pressed, the Mode will change (Display always on or on for 5s). The option is confirmed with pressind the side button again. After that, the settings for the Alarm Mode (Buzzer turned off or on) is opened and can be changed with pressing the front button. In general, the active settings option is indicated with a red line on the left side. Pressing the side button a third time will confirm the settings, and open the last Sensor View again.
System Settings
How To
In order to flash this code on the M5StickC, the Arduino IDE needs to download and to be installed first. Then, the M5StickCs driver and the above mentioned libraries need to be installed. You can then open (or copy/past) the code into the IDE and flash it.
M5StickC Manual and Software
Arduino IDE
Still tp be implemented
Every Gas Sensor is different, so it also needs to be calibrated. In order to calibrate it, it needs to be turned on for 12h, and this value is then valid for 7 days. To do so, the value needs to be stored in EEPROM, and send to the sensor in the Settings function. Because I never used it for 12h, this is not implemented yet. If not set, the sensor used 400 ppm for eCO2 and 0 ppb for TVOC as calibration value.
Also, it was not possible to set the display off completely. In the current implementation, it will only be black in the 5s-On mode and not completely off.

Tags