Luftqualität kontrollieren und fit bleiben!

Maker: MicrocontrollerProjects

Surely you know the following problem: You are working together with several people in an office and after some time your concentration drops strongly. So you decide to get a coffee to counteract the tiredness. When you return with the fresh coffee in your hand, you immediately notice that the air in the office is stale and stuffy. So you open the window to ventilate. What would have happened if you had aired out an hour ago? Would the last hour have been more productive? Probably so, but how can you tell when it's the right time to ventilate while you're brooding intently over your tasks? Many chemicals in the air are also odorless. This is where the SGP30 Air Quality Sensor comes in! It allows you to permanently monitor the indoor air quality in terms of CO2 and volatile organic compounds (VOCs) and to ventilate at an early stage. Thus, productivity and well-being can be increased.

In the following YouTube video tutorial from MikrocontrollerProjekte you will find all steps described in detail:

Hardware needed

  • Adafruit SGP30 Air Quality Sensor Breakout Board
  • Nucleo-F401RE
  • USB cable type A to mini-B
  • 4x Jumper-Wire

Required Software (completely free of charge)

  • ST-LINK Utility
  • RS232 terminal e.g. HTerm
  • (optional: Python 3 + PySerial)
  • (optional: System Workbench for STM32)

Hardware setup

The hardware setup is very simple. You connect the SGP30 breakout board to the NucleoF401RE using the jumper wires (see video) according to the following scheme:

Quick Start

Step 1: Download the ST-LINK utility and install it completely including drivers.

Step 2: Connect the hardware to your PC via USB cable as described in the chapter Hardware Setup.

Step 3: Download the compiled software (SGP30_AirQualitySensor.bin) from GitHub and transfer it to the Nucleo board using the ST LINK Utility (File -> Open File -> "SGP30_AirQualitySensor.bin", then: Target -> Program and Verify -> Start):

https://github.com/MikrocontollerProjekte/YouTubeProjects/tree/master/SGP30%20Gas%20Sensor/Firmware

Step 4: If everything is assembled correctly and the software communicates successfully with the sensor, the green User LED (LD2) should blink every second. Now you need to use the Windows Device Manager to find the COM port that the ST board used to register a virtual COM port on your PC.

Step 5: Now you can use any RS232 terminal program (e.g. HTerm) to read the serial data sent by the board via your COM port with the settings (baud rate 115200, 8 data bits, 1 stop bit, no parity). With this you have already done the most important thing, the sensor works and measures successfully!

For advanced users

Only if the quick start was successful, you can continue here. To be able to evaluate the sensor data over several hours, e.g. with Excel or Matlab, I wrote a small Python 3 script.

Thanks to the PySerial extension, it reads the RS232 data directly from the serial port and stores it in a logfile (*.csv), separated by a semicolon.

Step 1: Download and install Python 3. Then you have to install the Python extension PySerial. This can be done comfortably with the Python package management program PIP by typing the following command in the Windows command prompt: "pip install pyserial".

Step 2: Download the Python script from GitHub:

https://github.com/MikrocontollerProjekte/YouTubeProjects/tree/master/SGP30%20Gas%20Sensor/Python

Step 3: You have to change the COM5 in the Python script in line 22: (port='COM5', ## xtagstartz--- change to your COM-Port here) with your COM-Port. You can find it again in the Windows Device Manager. Then save and run the script.

Passend dazu

16531-SparkFun_Air_Quality_Sensor_-_SGP30__Qwiic_-05_600x600.jpg16531-SparkFun_Air_Quality_Sensor_-_SGP30__Qwiic_-04_600x600.jpg
Sparkfun SparkFun Air Quality Sensor - SGP30 (Qwiic)
Sale price11,40 € Regular price13,37 €
In stock, 144 units
Sparkfun-Indoor-Air-Quality-Sensor-ENS160-Qwiic_1.jpgSparkfun-Indoor-Air-Quality-Sensor-ENS160-Qwiic_2.jpg
Sparkfun SparkFun Indoor Air Quality Sensor - ENS160 (Qwiic)
Sale price23,30 €
Not in stock, available for backorder

Passend zu diesem Artikel

View all
Save 4,29 €
14348-01_600x600.jpg14348-04_600x600.jpg
Sparkfun SparkFun Environmental Combo Breakout - CCS811/ BME280 (Qwiic)
Sale price24,50 € Regular price28,79 €
Only 1 unit left
Save 1,91 €
sparkfun-air-quality-breakout-ccs811-01_600x600.jpgsparkfun-air-quality-breakout-ccs811-03_600x600.jpg
Sparkfun SparkFun Air Quality Breakout - CCS811
Sale price11,30 € Regular price13,21 €
Only 3 units left
Save 1,97 €
16531-SparkFun_Air_Quality_Sensor_-_SGP30__Qwiic_-05_600x600.jpg16531-SparkFun_Air_Quality_Sensor_-_SGP30__Qwiic_-04_600x600.jpg
Sparkfun SparkFun Air Quality Sensor - SGP30 (Qwiic)
Sale price11,40 € Regular price13,37 €
In stock, 144 units
Save 1,69 €
18345-SparkFun_Air_Quality_Sensor_Breakout_-_SGP40__Qwiic_-01.jpg18345-SparkFun_Air_Quality_Sensor_Breakout_-_SGP40__Qwiic_-02.jpg
Sparkfun SparkFun Air Quality Sensor - SGP40 (Qwiic)
Sale price9,60 € Regular price11,29 €
In stock, 4 units
image_(2).jpg
BlueDot BlueDot SGP30 Board Indoor Air Quality Sensor
Sale price25,28 €
In stock, 7 units
Save 6,79 €
SparkFun Photoacoustic Spectroscopy CO2 Sensor - PASCO2V01 (Qwiic)SparkFun Photoacoustic Spectroscopy CO2 Sensor - PASCO2V01 (Qwiic)
Sparkfun SparkFun Photoacoustic Spectroscopy CO2 Sensor - PASCO2V01 (Qwiic)
Sale price38,70 € Regular price45,49 €
Only 1 unit left