Skip to content

A minimalist, DIY PurpleAir clone

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

shanet/ClearAir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClearAir

Shane Tully (shanetully.com)

A minimalist, DIY PurpleAir clone.

Note: This project may go long periods of time without being updated, however it is actively used and maintained. Bug reports and pull requests are welcome.

About

ClearAir is DIY PurpleAir clone built to be a minimalist replacement. It uses the same sensors and calculations, but for a third of the cost. A Ruby script is provided for reading the current values from the sensor over the network. Other frontends/clients can be written tailored to your needs.

Hardware

ClearAir was built and tested on an Adafruit Feather M0 WiFi.

Usage

Setting up the hardware

BME688 PMSA003I
3V -> 3V 3V -> 3V
GND -> GND GND -> GND
SCL -> SCK SCL -> SCL
SDA -> SDI SDA -> SDA

A Fritzing file is located at docs/ClearAir.fzz.

Wiring diagram:

Setting up the software dependencies

These instructions are for Linux (x86_64).

  • Download and extract the Adafruit SAMD library to ~/.arduino15/packages/adafruit/hardware/samd/1.0.9
  • Download and extract the ARM compiler to ~/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/4.8.3-2014q1
  • Download and extract Bossac to ~/.arduino15/packages/adafruit/tools/bossac/1.6.1-arduino.
  • Download and extract CMSIS to ~/.arduino15/packages/adafruit/tools/CMSIS/4.0.0-atmel.

Note: The archives above can be extracted whenever you'd like, but the paths at the top of the Makefile must be adjusted accordingly.

Compiling & Uploading

  1. Create src/secrets.h with the following content:
    #define _SSID "your_ssid"
    #define _PASSPHRASE "passphrase"
    
  2. Edit src/main.h with appropriate IP & network settings
  3. Then:
    $ make
    $ make upload
    

Reading Air Quality

To read values from the device, run ./client.rb [HOST]. Ruby is needed to run this script.

From here other frontends/clients can be written tailored for your needs. Reading from the sensor is as simple as opening a TCP socket and reading the JSON value that is returned.

An example response is as such:

{
  "air_quality_index": 9,
  "air_quality_category": "Good",
  "pm25": 2.00,
  "temperature": 23.07,
  "humidity": 53.14,
  "pressure": 1001.74
}

Networking

The default port is 2424. Don't forget to add rules to allow communication on this port on any firewalls or gateways between the client and the server.

License

Copyright (C) 2021 Shane Tully

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

About

A minimalist, DIY PurpleAir clone

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages