Skip to content

This repository is aimed at developing a functional DIY Air Quality sensor based on AirGradient: https://www.airgradient.com/open-airgradient/instructions/diy/ except using a Raspberry Pi Pico W and python instead of a D1 Mini Pro and Arduino/C++

Notifications You must be signed in to change notification settings

NAU-IoT/AirGradientOnPi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AirGradientOnPi

This repository is aimed at developing a functional DIY Air Quality sensor based on AirGradient: https://www.airgradient.com/open-airgradient/instructions/diy/ except using a Raspberry Pi Zero with python instead of a D1 Mini Pro with Arduino/C++

Also containerized with docker for easy replication

List of Parts:

Wiring Diagram

Screen Shot 2023-08-22 at 4 41 33 PM

Enabling UART and I2C

  • I2C and UART must be enabled to work correctly:

    sudo raspi-config
    

    Enabling I2C:

    Navigate To Interface Options:

    Screen Shot 2023-08-22 at 2 14 33 PM

    Enter I2C Options:

    Screen Shot 2023-08-22 at 2 15 12 PM

    Select Yes:

    Screen Shot 2023-08-22 at 2 15 26 PM

    Enabling UART:

    Enter Serial Port Options Within Interface Option Menu:

    Screen Shot 2023-08-22 at 2 20 14 PM

    Select No:

    Screen Shot 2023-08-22 at 2 15 50 PM

    Select Yes:

    Screen Shot 2023-08-22 at 2 16 01 PM

    Select Finish:

    Screen Shot 2023-08-22 at 2 16 17 PM

Running with Docker

  • Install docker:
sudo apt install docker.io
  • Check if docker is functioning:
sudo docker run hello-world
  • Clone repository to get Dockerfile and configuration files:
git clone https://github.com/NAU-IoT/AirGradientOnPi.git
  • Change into directory:
cd AirGradientOnPi
docker build -t airquality .
  • Create a directory in a convenient location to store the docker volume. For example:
mkdir -p Data/AirQuality
  • Create a volume to store data inside the directory created in the previous step:
docker volume create --driver local \
  --opt type=none \
  --opt device=/SOME/LOCAL/DIRECTORY \
  --opt o=bind \
  YOUR_VOLUME_NAME
  • Execute docker container in AirGradientOnPi directory:
docker run --privileged -v YOUR_VOLUME_NAME:/Data -t -i -d --restart unless-stopped airquality
  • Verify container is running:
docker ps
  • Done!

Notes

  • To enter the container:
    • This can be done to check log files or modify the container without rebuilding/restarting
docker exec -it CONTAINER_ID /bin/bash
  • If error: Got permission denied while trying to connect to the Docker daemon socket at unix ... connect: permission denied
    • Run command, then log out and ssh back into system:
      sudo usermod -aG docker $USER
      

Running With Python

  • Install Dependencies:

    • Install OLED Library:
      sudo pip install adafruit-circuitpython-ssd1306
      
    • Install SCD30 library:
      sudo pip install adafruit-circuitpython-scd30
      
    • Install Python Imaging Library:
      sudo pip install Pillow
      
    • Install PM25 Library:
      sudo pip install adafruit-circuitpython-pm25
      
  • Clone This Repository:

    git clone https://github.com/NAU-IoT/AirGradientOnPi.git
    
  • Change into directory:

    cd AirGradientOnPi
    
  • Execute script:

    sudo python3 AirQuality.py
    
  • Done!

About

This repository is aimed at developing a functional DIY Air Quality sensor based on AirGradient: https://www.airgradient.com/open-airgradient/instructions/diy/ except using a Raspberry Pi Pico W and python instead of a D1 Mini Pro and Arduino/C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published