An air quality monitoring service with a Raspberry Pi and a SDS011 sensor.

Overview

Raspberry Pi Air Quality Monitor

A simple air quality monitoring service for the Raspberry Pi.

Installation

Clone the repository and run the following:

make install

Running

To run, use the run command:

make run

Architecture

This project uses python, flask, docker-compose and redis to create a simple web server to display the latest historical values from the sensor.

Example Data

Some example data you can get from the sensor includes the following:

{
    "device_id": 13358,
    "pm10": 10.8,
    "pm2.5": 4.8,
    "timestamp": "2021-06-16 22:12:13.887717"
}

The sensor reads two particulate matter (PM) values.

PM10 is a measure of particles less than 10 micrometers, whereas PM 2.5 is a measurement of finer particles, less than 2.5 micrometers.

Different particles are from different sources, and can be hazardous to different parts of the respiratory system.

Comments
  • activate the SDS011

    activate the SDS011

    Hey guys, I just wanted to check if my sensor is working and I wrote a simple command to show me the date and to trigger my sds011 device. `from sds011 import * from datetime import datetime import time print(datetime.now()) #2022-6-25 22:12:12 def time_now(): dateTimeObj = datetime.now() timestampStr = dateTimeObj.strftime("%d-%b-%Y (%H:%M:%S)") return timestampStr

    sensor = SDS011("/dev/ttyUSB0") sensor.sleep(sleep=False)

    sensor.sleep(sleep=True) `

    But I always get the following output and error: 2022-06-25 22:18:35.373715 WARNING:root:SDS011: While constructing the instance the sensor is not responding. Maybe in sleeping, in passive mode, or in a duty cycle? Will wake it up. Traceback (most recent call last): File "/home/teamplazer/try5.py", line 11, in sensor = SDS011("/dev/ttyUSB0") File "/home/teamplazer/sds011.py", line 184, in init self.__send(self.Command.WorkState, File "/home/teamplazer/sds011.py", line 465, in __send raise IOError("SDS011 sensor is not responding.") OSError: SDS011 sensor is not responding.

    Does anyone know what to do?

    opened by Fritz02 0
  • Air quality sensor SDS011

    Air quality sensor SDS011

    Hey guys, I'm a complete Newbie and I tried to create a raspberry pi project to measure the airquality with the following code: import paho.mqtt.publish as publish from sds011 import * sensor = SDS011("/dev/ttyUSB0")

    channelID = "acd" apiKey = "abcd" topic = "channels/" + channelID + "/publish/" + apiKey mqttHost = "mqtt.thingspeak.com"

    sensor.sleep(sleep=False) time.sleep(10) pmt_2_5, pmt_10 = sensor.query()

    print (time_now(), end='') print (f" PMT2.5: {pmt_2_5} Mikrogramm/Kubikmeter ", end='') print (f"PMT10 : {pmt_10} Mikrogramm/Kubikmeter") sensor.sleep(sleep=True) time.sleep(2) tPayload = "field1=" + str(pmt_2_5)+ "&field2=" + str(pmt_10)

    while(True): pmt_2_5, pmt_10 = get_data() tPayload = "field1=" + str(pmt_2_5)+ "&field2=" + str(pmt_10) try: publish.single(topic, payload=tPayload, hostname=mqttHost, port=tPort, > save_log() except: print ("[INFO] Failure in sending data") time.sleep(60)

    But when I try to run the program I get the following error: Traceback (most recent call last): File "/home/teamplazer/airquality3.py", line 3, in sensor = SDS011("/dev/ttyUSB0") File "/home/teamplazer/sds011.py", line 191, in init self.__get_current_config() File "/home/teamplazer/sds011.py", line 336, in __get_current_config response = self.__send(self.Command.DutyCycle, File "/home/teamplazer/sds011.py", line 465, in __send raise IOError("SDS011 sensor is not responding.") OSError: SDS011 sensor is not responding.

    How can I activate the sensor? Thank you for your help!

    opened by Fritz02 0
  • replace sds011 module with serial

    replace sds011 module with serial

    A PR to fix these issues:

    • https://github.com/rydercalmdown/pi_air_quality_monitor/issues/1
    • https://github.com/rydercalmdown/pi_air_quality_monitor/issues/8
    opened by abielzulio 0
  • Blank site

    Blank site

    Hi,

    I have to uninstall serial and install pyserial and then the code runs but I only get a blank webpage with the heading : Raspberry Pi Air Quality Monitor. no data

    opened by stevesmithnz 0
  • Increase time stored

    Increase time stored

    Hey how can I incerase the time of the data stored in the database, for example I'd like to store the data of 24h maybe making a read of the sensor every 10 minutes. Where I change this parameter?

    opened by kekko7072 0
  • Can't find stored data

    Can't find stored data

    I have gotten the code to run and the web page shows the data being collected, however, I cannot find where or access the hard data being stored. I believe it is being added to the "dump.rdb" file which you can get to through data -> redis. I'm pretty new to Pi's so any help would be appreciated!

    opened by jheptins 2
Owner
rydercalmdown
rydercalmdown
A very lightweight monitoring system for Raspberry Pi clusters running Kubernetes.

OMNI A very lightweight monitoring system for Raspberry Pi clusters running Kubernetes. Why? When I finished my Kubernetes cluster using a few Raspber

Matias Godoy 148 Dec 29, 2022
MohammadReza Sharifi 27 Dec 13, 2022
Using LSTM to detect spoofing attacks in an Air-Ground network

Using LSTM to detect spoofing attacks in an Air-Ground network Specifications IDE: Spider Packages: Tensorflow 2.1.0 Keras NumPy Scikit-learn Matplotl

Tiep M. H. 1 Nov 20, 2021
TensorFlow (v2.7.0) benchmark results on an M1 Macbook Air 2020 laptop (macOS Monterey v12.1).

M1-tensorflow-benchmark TensorFlow (v2.7.0) benchmark results on an M1 Macbook Air 2020 laptop (macOS Monterey v12.1). I was initially testing if Tens

particle 2 Jan 5, 2022
Fast and robust clustering of point clouds generated with a Velodyne sensor.

Depth Clustering This is a fast and robust algorithm to segment point clouds taken with Velodyne sensor into objects. It works with all available Velo

Photogrammetry & Robotics Bonn 957 Dec 21, 2022
Scikit-event-correlation - Event Correlation and Forecasting over High Dimensional Streaming Sensor Data algorithms

scikit-event-correlation Event Correlation and Changing Detection Algorithm Theo

Intellia ICT 5 Oct 30, 2022
Transfer SemanticKITTI labeles into other dataset/sensor formats.

LiDAR-Transfer Transfer SemanticKITTI labeles into other dataset/sensor formats. Content Convert datasets (NUSCENES, FORD, NCLT) to KITTI format Minim

Photogrammetry & Robotics Bonn 64 Nov 21, 2022
Python interface for the DIGIT tactile sensor

DIGIT-INTERFACE Python interface for the DIGIT tactile sensor. For updates and discussions please join the #DIGIT channel at the www.touch-sensing.org

Facebook Research 35 Dec 22, 2022
Official code for "EagerMOT: 3D Multi-Object Tracking via Sensor Fusion" [ICRA 2021]

EagerMOT: 3D Multi-Object Tracking via Sensor Fusion Read our ICRA 2021 paper here. Check out the 3 minute video for the quick intro or the full prese

Aleksandr Kim 276 Dec 30, 2022
MaRS - a recursive filtering framework that allows for truly modular multi-sensor integration

The Modular and Robust State-Estimation Framework, or short, MaRS, is a recursive filtering framework that allows for truly modular multi-sensor integration

Control of Networked Systems - University of Klagenfurt 143 Dec 29, 2022
Demo code for ICCV 2021 paper "Sensor-Guided Optical Flow"

Sensor-Guided Optical Flow Demo code for "Sensor-Guided Optical Flow", ICCV 2021 This code is provided to replicate results with flow hints obtained f

null 10 Mar 16, 2022
DeepLearning Anomalies Detection with Bluetooth Sensor Data

Final Year Project. Constructing models to create offline anomalies detection using Travel Time Data collected from Bluetooth sensors along the route.

null 1 Jan 10, 2022
🍅🍅🍅YOLOv5-Lite: lighter, faster and easier to deploy. Evolved from yolov5 and the size of model is only 1.7M (int8) and 3.3M (fp16). It can reach 10+ FPS on the Raspberry Pi 4B when the input size is 320×320~

YOLOv5-Lite:lighter, faster and easier to deploy Perform a series of ablation experiments on yolov5 to make it lighter (smaller Flops, lower memory, a

pogg 1.5k Jan 5, 2023
A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

A tutorial showing how to train, convert, and run TensorFlow Lite object detection models on Android devices, the Raspberry Pi, and more!

Evan 1.3k Jan 2, 2023
An open source bike computer based on Raspberry Pi Zero (W, WH) with GPS and ANT+. Including offline map and navigation.

Pi Zero Bikecomputer An open-source bike computer based on Raspberry Pi Zero (W, WH) with GPS and ANT+ https://github.com/hishizuka/pizero_bikecompute

hishizuka 264 Jan 2, 2023
Axel - 3D printed robotic hands and they controll with Raspberry Pi and Arduino combo

Axel It's our graduation project about 3D printed robotic hands and they control

null 0 Feb 14, 2022
Real-Time Social Distance Monitoring tool using Computer Vision

Social Distance Detector A Real-Time Social Distance Monitoring Tool Table of Contents Motivation YOLO Theory Detection Output Tech Stack Functionalit

Pranav B 13 Oct 14, 2022
Attendance Monitoring with Face Recognition using Python

Attendance Monitoring with Face Recognition using Python A python GUI integrated attendance system using face recognition to take attendance. In this

Vaibhav Rajput 2 Jun 21, 2022