Skip to content

PTBresearch/Air-Quality-Measurement-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note: This repository is meant as an example. The code is incomplete and not the latest version.

Note: The global InfluxDB instance is planned to be replaced by Fiware.

Air Quality

Sensors List (Not Complete)

  • PPD42NS (Dust Concentration)

  • BME280 (Humidity, Air Pressure, Temperature)

  • CCS811 (TVOC Value, CO2 Equivalent)

  • MAX31855PMB1# (Temperature)

  • SHT35 (Temperature, Humidity)

  • GUVA-S12D (UV)

  • TCS34725 Light Sensor (RGB, Color Temperature, Brightness, Reference Value)

  • MH-Z19C (CO2 Value Infrared Sensor, Temperature)

  • SPH (DB)

  • HP206C ()

Images and Render

Front Image Blender Case with PCB Render Front Image Blender Base with PCB Render Front Image Blender PCB Render
Front Image Full Top Front Image Full Front Front Image Sensor Station
Side Image Open PCB V1 Front Image Front View Side Image Side View

Structure

.
├── Arduino-Code/          # The main folder for all microcontroller code.
│   ├── Main/              # Code for the primary Arduino prototype (likely ESP8266).
│   │   ├── lib/           # Libraries for this specific project.
│   │   └── Main.ino # The main program file for the Arduino.
│
├── Dokumentation/         # Images.
│
├── Files/                 # Specific files relevant to hardware and measurements.
│   ├── Gehaeuse/          # 3D models and design files for the project's enclosure.
│   └── Platinen/          # Design files (Gerber files, etc.) for the printed circuit boards (PCBs).
│
└── Raspberry-Installer/   # Scripts and files for setting up the Raspberry Pi.
    └── Docker/            # Docker configurations and source code for installing services on the Pi.
        └── src/           # Source code used by the Docker containers.

Function

┌── Raspberry Pi
│   └── Creates a Wi-Fi network
│
└── Arduino
    ├── Connects to the Wi-Fi network
    │
    ├── Reads data from the sensor
    │
    └── Sends data over Wi-Fi to the API
        │
        └── API
            ├── Collects the sent data
            │
            ├── Inserts the data into a local database (InfluxDB)
            │
            └── Inserts the data into a global database (InfluxDB)

Example JSON-Structure

{
  "arduino_board": "<arduino_id>",
  "sensors": [
    {
      "name": "<sensor_name>",
      "sensor_model": "<sensor_model>",
      "readings": [
        {
          "type": "<influx measurement>",
          "value": VALUE,
          "unit": "<unit>"
          "label": "<label optional>"
        },
        {
          "type": "<influx measurement>",
          "value": VALUE,
          "unit": "<unit>"
          "label": "<label optional>"
        }
      ]
    },
    {
      "name": "bme280",
      "sensor_model": "",
      "readings": [
        {
          "type": "temperature",
          "value": VALUE,
          "unit": "celsius"
        },
        {
          "type": "pressure",
          "value": VALUE,
          "unit": "hpa"
        },
        {
          "type": "humidity",
          "value": VALUE,
          "unit": "%"
        }
      ]
    }
  ]
}

Instalation

  1. Download:
git clone <url> luftqualitaet
  1. Edit WLAN_SSID in luftqualitaet/Raspberry-Installer/config.sh
export replace=<Hostname>
sed -i -e 's/WLAN_SSID = Hostname/WLAN_SSID = ${replace}/g' luftqualitaet/Raspberry-Installer/config.sh
  1. (Optional) Set Proxy Settings luftqualitaet/Raspberry-Installer/Docker/.env
echo "http_proxy=http://webproxy:8080
https_proxy=http://webproxy:8080
no_proxy=influx,localhost" > /home/pi/luftqualitaet/Raspberry-Installer/Docker/.env
  1. Login as Root
sudo -i
  1. Change directory to Installer Location
cd /home/pi/luftqualitaet/Raspberry-Installer
  1. Make Script executeable
chmod +x config.sh setup.sh
  1. Set Current Time
HTTP_DATE=$(curl -x http://webproxy:8080  -ksI 'https://ptb.de' | grep -i '^date:' | sed 's/Date: //i' | sed 's/ (GMT)//')
if [ -n "$HTTP_DATE" ]; then date -s "$HTTP_DATE" && echo "Systemzeit erfolgreich gesetzt."; else echo "WARNUNG: Konnte die Zeit nicht über HTTP abrufen."; fi
  1. Run Script
./setup.sh
  1. Change directory to Docker Location
cd /home/pi/luftqualitaet/Raspberry-Installer/Docker
  1. Start Docker
docker compose up -d
  1. Setup Influxdb (http://hostname:8086) and Grafan (http://hostname:3000)

  2. Set InfluxDB Token in Config ```/home/pi/Raspberry-Installer/Docker/src/config.yml````

  3. Restart Docker

docker compose down
docker compose up -d
  1. Restart Raspberry PI
systemctl reboot

Components

Raspberry PI

Component Order Link Datasheet Link(s) Further Information
Pi 4B https://www.reichelt.de/das-reichelt-raspberry-pi-4-b-4-gb-all-in-bundle-rpi-4b-4gb-allin-p263086.html
Micro SD https://www.reichelt.de/de/de/shop/produkt/microsdxc-speicherkarte_128gb_samsung_pro_plus-313955
GPS https://www.reichelt.de/de/de/shop/produkt/raspberry_pi_shield_-_multi-gnss_l76x-266060
Raspberry Pi Shield https://www.reichelt.de/de/de/shop/produkt/raspberry_pi_shield_-_display_lcd-touch_7_800x480_pixel-282508

Sensor Station

Component Sensor Type Order Link Datasheet Link(s) Notes Ambient Temperature Humidity Air Pressure
BME280 Temp & Pressure Sensor https://www.reichelt.de/ch/de/shop/produkt/entwicklerboards_-_temperatur-_feuchtigkeits-und_drucksensor-253982 https://cdn-reichelt.de/documents/datenblatt/A300/BST-BME280-DS002-1509607.pdf Inaccurate temperature (error tolerance of +3°C) Accuracy: +1.0°C <br> Range: -40°C to +85°C <br> Max Deviation: Up to +1.5°C Accuracy: +3% rF <br> Range: 0% to 100% rF <br> Max Deviation: up to +5% Accuracy: +1 hPa <br> Range: 300 hPa <br> Max Deviation: Up to +1.7 hPa
CCS811 TVOC https://www.reichelt.de/ch/de/shop/produkt/entwicklerboards_-_sensor_fuer_luftqualitaet_ccs811-253655 https://cdn-reichelt.de/documents/datenblatt/A300/SEN-CCS811V1-DATENBLATT-02-11-2020.pdf Has a burn-in period (48 hours) and a warm-up time (20 min) before it becomes accurate Accuracy: +3°C <br> Range: 0°C to +50°C <br> Max Deviation: approx. +5°C Range: 10% to 95%
PPD42NS Dust https://www.reichelt.de/ch/de/shop/produkt/arduino_-_staubsensor_ppd42ns-191264 https://cdn-reichelt.de/documents/datenblatt/A300/101020012_01.pdf Must be straight, requires 3 min to warm up, arbitrary operation can lead to damage, standard settings should not be changed Recommended Range: -10°C to +65°C Range: 0% to 70%
MAX31855PMB1# Typk Temp https://de.farnell.com/analog-devices/max31855pmb1/peripheriemodul-thermoel-digit/dp/2530496 https://www.farnell.com/datasheets/2025616.pdf Inaccurate temperature (error tolerance of +2°C) Recommended Range: -20°C to +85°C Range: 0% to 95%
D1 Mini D1 Mini https://www.reichelt.de/de/de/shop/produkt/d1_mini_-_kompatibles_esp8266_board_v2_0-253978
D1 Mini D1 Mini Pro https:www.reichelt.de/de/de/shop/produkt/d1_mini_pro_-_kompatibles_esp8266_board_cp2104-266066
Power Supply Breadboard https://www.reichelt.de/de/de/shop/produkt/entwicklerboards_-_spannungsversorgung_f_steckboards-202832 https://cdn-reichelt.de/documents/datenblatt/A300/DATENBLATTSBC-POW-BB.pdf Too high voltage can damage the device or even lead to a fire Recommended Range: 0°C to +70°C Range: 10% to 60% (Absolutely not intended for humid rooms)
GSM18E09-P1J Plug-in Power Supply https://www.conrad.de/de/p/mean-well-gsm18e09-p1j-steckernetzteil-festspannung-9-v-dc-2-a-18-w-1837961.html https://asset.conrad.com/media10/add/160267/c1/-/en/001837961DS01/datenblatt-1837961-mean-well-gsm18e09-p1j-steckernetzteil-festspannung-9-vdc-2-a-18-w.pdf Only lasts 3 years and is only 88% efficient Recommended Range: -25 to +60 Range: 20% to 90%
SHT35 Temp & Humidity https://de.farnell.com/seeed-studio/101020212/sensorplatine-arduino-board/dp/3932104 https://www.farnell.com/datasheets/3708357.pdf Environmentally sensitive and should not be touched with fingers as it can be damaged Recommended Range: -40°C to 125°C Range: 10% to 90%
ADC Analog Digital Converter https://www.conrad.de/de/p/joy-it-ky053adc-raspberry-pi-erweiterungs-platine-passend-fuer-einplatinen-computer-raspberry-pi-raspberry-pi-a-b-1656368.html https://asset.conrad.com/media10/add/160267/c1/-/de/001656368DS01/datenblatt-1656368-joy-it-ky053adc-raspberry-pi-erweiterungs-platine-passend-fuer-einplatinen-computer-raspberry-pi-raspberry-pi-a-b.pdf Sensitive to interference due to its high resolution, which can make it slower to measure rapidly changing signals or values Recommended Range: -40°C to 125°C Range: 0% to 95%
GUVA-S12D UV Sensor https://www.reichelt.de/de/de/shop/produkt/arduino_-_uv-sensor_guva-s12d-191215 https://cdn-reichelt.de/documents/datenblatt/A300/101020043_01.pdf Can be altered by temperature, sensitive to environmental influences, not precise Recommended Range: -30°C to +85°C Range: 0% to 95%
TCS34725 Light Sensor https://www.conrad.de/de/p/az-delivery-tcs34725-rgb-farb-sensor-mit-infrarot-filter-diy-modul-zur-farb-erkennung-kompatibel-mit-arduino-850037694.html https://ams-osram.com/products/sensor-solutions/ambient-light-color-spectral-proximity-sensors/ams-tcs34725-color-sensor Light can change measurement values, the sensor has a certain amount of background noise Recommended Range: -40°C to +85°C Range: 0% to 60%
MH-Z19C CO2 Sensor https://www.reichelt.de/de/de/shop/produkt/infrarot_co2-sensor_mh-z19c_pinleiste_rm_2_54-297320 https://cdn-reichelt.de/documents/datenblatt/C150/MH-Z19CDATENBLATT.pdf Only works at optimal temperatures (-10 ~ 50 °C) and is sensitive to heat and sun Recommended Range: -10°C to 50°C Range: 0% to 95%
Teensy4.1 Teensy4.1 https://www.reichelt.de/de/de/shop/produkt/teensy_4_1_usb_ohne_header-283580 https://cdn-reichelt.de/documents/datenblatt/A300/TEENSY_41_DE.pdf Consumes a lot of power, lacks a Wi-Fi or Bluetooth connection, and can overheat during complex tasks Recommended Range: -40°C to +85°C Range: 0% to 95%
HP206C Grove - Barometer https://de.farnell.com/seeed-studio/101020068/sensor-barometer-arduino-raspberry/dp/4007687 https://www.farnell.com/datasheets/3759062.pdf The chip only accepts an input voltage of 1.8 V to 3.6 V. Recommended Range: -40°C to +85°C Range: 5% to 90%

Mic

Component Sensor Type Order Link Datasheet Link(s) Notes Ambient Temperature Humidity Air Pressure
SPH0645 Mems Mic https://www.reichelt.de/de/de/shop/produkt/entwicklerboards_-_mikrofone_sph0645-271874 https://cdn-reichelt.de/documents/datenblatt/A300/DEBO_MEMS_MIC_DB_EN.pdf Sensitive to air, especially at the porthole (may require further investigation later) Recommended Range: -40°C to +85°C Range: 5% to 95%
D1 Mini D1 Mini https://www.reichelt.de/de/de/shop/produkt/d1_mini_-_kompatibles_esp8266_board_v2_0-253978
D1 Mini D1 Mini Pro https:www.reichelt.de/de/de/shop/produkt/d1_mini_pro_-_kompatibles_esp8266_board_cp2104-266066
D1 Mini D1 Mini Lite https://www.reichelt.de/de/de/shop/produkt/d1_mini_lite_-_kompatibles_esp8285_board-291438
Teensy4.1 Teensy4.1 https://www.reichelt.de/de/de/shop/produkt/teensy_4_1_usb_ohne_header-283580 https://cdn-reichelt.de/documents/datenblatt/A300/TEENSY_41_DE.pdf Consumes a lot of power, lacks a Wi-Fi or Bluetooth connection, and can overheat during complex tasks Recommended Range: -40°C to +85°C Range: 0% to 95%
Power Supply USB Charger https://www.reichelt.de/de/de/shop/produkt/usb-ladegeraet_5_v_1_a_usb-c_schwarz-268087?PROVID=2788

Notes on Individual Sensors (Regarding Placement)


General Notes

  • The enclosure must be sufficiently open to allow air to flow in for measurements.
  • Ensure thermal, optical, and acoustic decoupling of the microcontroller from the sensors (use a partition).
  • Leave space for 2-3 additional sensors (check sensor dimensions with a reference image).
  • Leave space for 2 more ESPs (D1 Mini Lite), for a total of 3.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published