Skip to content

Raspberry Pi Air Quality Station

Jason edited this page Mar 28, 2018 · 28 revisions

Introduction

For this project we will be following a blog post for a Raspberry Pi Air Quality Station from rigacci.org. However we will be taking a slight detour from the original part of the blog, so here is what we will be using.

I will be following the blog post line by line for the majority of the tutorial and will try my best to stick with the blog post to avoid confusion, however i will be writing notes in each section as a filler if there were things that i thought were missing.

For the wiring diagrams, i will be using fritzing and will be adding one sensor module at a time to finally work our way to the completed wiring diagram like so.

Basic Software Setup

To open up the configuration for the raspberry pi, run the following in the command line

sudo raspi-config

I was not able to install the following packages for the installation portion, however i did not find it to be necessary for what we were trying to accomplish with the air quality station.

TODO: put packages that were not able to install

DS3231 RTC

Software Setup

The documentation in the wiki was sufficient to properly install the RTC, although i skipped the AirPi software portion for now as i wanted to focus on getting the RTC working first.

Hardware Setup

As the blog mentioned, the RTC we purchased did had a recharging circuit and the battery we used was a CR2032 which is non-rechargeable. The surface-mount resistor was removed as shown in the diagram (200 ohm resistor).

Continue on with rest of the hardware test as stated in the blog.

Here is how your setup should look like with the RTC connected, note only 5V/VCC, GND, SCL, and SDA are needed to be connected.

So as to why we needed a RTC, the raspberry pi does not have a built-in RTC like your computer. Reason why is because it is so that the manufacturer can save money. The raspberry pi instead asks a server when it boots up to keep track of time, however this relies on internet connection. Since we were dealing with timestamps we thought it was necessary to use a RTC which will keep track of time for the raspberry pi.

CCS811 CO2/VOC

So this sensor was not used in the blog post, however i was able to complete the setup by following the documentation provided by Adafruit. If you ever buy parts from adafruit or sparkfun, they normally provide great documentation. I was able to get the sensor working fine by following the guide.

PMS5003

The guide for setting up the PMS5003 was not enough to get the sensor running, so for this sensor i will be explaining the steps i did. This includes both the hardware and software portion of the sensor.

Hardware Setup

So in the blog he completely left out on how he actually hooked up the sensor to his board as the PMS5003 uses some type of female 8 pin connector that i was not able to find a male connector for.

I contacted the blog writer on how he connected the sensor and here is his reply.

Following his advice, I cut the connector off the cable and spliced each wire to the end of a jumper wire. Then i soldered the spliced wire to ensure connectivity and finished it off with heat shrink tubing to protect the splice. The end result looks like this.

Here is a guide on how to hand splice wires together.

For wiring the sensor to the raspberry pi 3, refer to these two pictures. One is for the sensor pin to raspberry pi and the other is for pin numbering.

Software Setup

Unlike the other sensors that we will be using, the PMS5003 communicates via serial line rather than i2c. The communication protocol for the sensor is a 32 byte frame, where the first two bytes are fixed start characters used to signal the beginning of the frame.

Useful Diagrams

Raspberry Pi 2 Model B GPIO Header