Getting the Pi running

To set up the Pi, hook it up to an HDMI-compatible TV, a keyboard, and a mouse. They keyboard and mouse must be attached with a USB hub and an OTG USB cable–an adapter that converts the full-size USB cable to a micro-USB male end.

Configuring the operating system is  straightforward, with a series of dialogs to help users configure the settings.

Only four small customizations are required:

  1. Setting the time to local time,
  2. Installing VNC
  3. Changing the system password
  4. Getting the wifi running

Setting the local time is required to get the Pi to report pollution data accurately, and VNC is used to control the Pi from a remote computer. It is software that ‘projects’ the Pi’s desktop onto your desktop, and allows you to control it as if it were in front of you, with a keyboard and mouse.¹

Both VNC and the time are set within the System Preference dialog, which is under the Raspberry icon at the top left.

Click on the Raspberry, then Preferences, then Raspberry Pi Configuration
It would be a good idea to change your password.
Enabling VNC will let you use the software RealVNC to connect remotely to your Pi.
Set your timezone.

 

Next, you will need to connect to your wifi, which is very straightforward, though confusingly named. When the Pi asks for your “shared key”, enter your wifi password, if any.

After you’ve enabled VNC on the Pi, it’s easy to connect to it with RealVNC. You will need ‘client’ and ‘server’ software, on your home computer and the Pi respectively, but it’s no harder to use than GMail.

 

 

 


¹ There are other ways to do this, using the terminal and SSH. They are agonizing.

 

Assembling the air quality monitor

We wanted our air quality monitors (AQMs) to be weatherproof, so I used cheap, dollar-store tupperware enclosures with snap-tight lids. Each was $1.50 CAD.

The SDS011 can be connected to a short hose for enclosed use. I used some hose I had around the house from making beer.

The tupperware needs three holes: one for the intake, one for the air outlet, and one for the power cable. I burned small holes in the sides of the case with a heated screwdriver, pushed the cables through, and sealed the holes with caulking.

The Raspberry Pi Zero W

The air sensor connects via USB to a computer. For indoor use, hooking the sensor up to any computer would be good enough for spot readings, but our plan was to put the computers outside. We decided to use a tiny and very cheap computer called the Raspberry Pi Zero W.

Image from [1]
Raspberry Pis are bare-bones computers that cost between $10 and $50, but do not include screens, storage, or any peripherals—not even an electrical cable to power them with.[1] They do, however, run a full operating system, which makes them quite easy to use compared to the alternatives we considered for this device (notably Arduino).

We settled on the second-cheapest Raspberry Pi because we have very simple computing requirements. Though the Pi Zero W is very slow compared to any other modern computer, it is certainly capable of doing the computations we need. We did not use the cheapest Raspberry Pi, the Pi Zero (without a W), because we wanted our computers to be able to report wirelessly.

We were forced to purchase the Pi Zero Ws in kits, which included a case, a power supply, and a MicroSD card, because the computers alone are rationed out at one per customer. Unfortunately, this drove the price of each Pi up from an advertised price of $13  to $65 (CAD, including tax and shipping).

The Pi Zero W (which I’m going to call “the Pi” from now on) runs Raspbian, a free operating system, which can be installed using a utility called NOOBS. Raspbian comes with the free programming language Python preinstalled. We used Python to collect and manipulate the measurements from the SDS011 air-quality sensor.

Setting up the Pi is fairly straightforward if you have the cables and peripherals—but to do it over a graphical interface, you’ll need quite a few of those, including:

  • A MicroSD card writer
  • A USB hub
    • And a USB keyboard and mouse
  • A mini-HDMI to HDMI adapter
  • An HDMI cable
  • A USB OTG cable
  • A somewhat beefy USB power adapter

In addition, you’ll need a MicroSD card. These peripherals add considerably to the cost of the $13 Raspberry Pi if you don’t have them in a drawer somewhere.

There is excellent help available on the internet, particularly Reddit, to get you to the point where you can boot the operating system.


1. New product! Raspberry Pi Zero W joins the family – Raspberry Pi. Available at: https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/. (Accessed: 30th May 2018)

The SDS011

After looking over many options for an air-quality sensor, I settled on the SDS011. It costs about $25, and can be ordered on many Chinese retail sites, such as AliExpress.

Footnote 1.

The SDS011 is well reviewed, and “developed by inovafit, a spin-off from the university of Jinan”[2][sic].  It reports the concentration of ultra-fine (2.5 micron) and fine (10 micron) airborne pollution in μg /m3, which are standard measures called PM2.5 and PM10, respectively.

There are several other sensors, but the SDS011 had the benefit of being well reviewed and capable of being connected over USB. I found that soldering joints and using breadboards were very difficult and unreliable.

The sensor has problems, though. The documentation is sparse, and it does not come with a program to make it function and record the data. These have to be written (or downloaded). The specifications are also written in poor English.

Finally, I found it hard to believe that a $25 sensor would do a good job—that it would be accurate, reliable, and consistent with other sensors. I was glad to be mistaken about these concerns.


 

1. sds011-large.png (500×419). Available at: http://aqicn.org/aqicn/view/images/sensors/sds011-large.png. (Accessed: 30th May 2018)

2. The World Air Quality Index. The SDS011 Air Quality Sensor experiment. aqicn.org Available at: http://aqicn.org/sensor/sds011/. (Accessed: 30th May 2018)

 

A low-cost outdoor air-pollution monitor

My friend Mohammad Samani and I have been working on a low-cost, open-source, air-pollution monitor. Our goal is to make sensors that can be deployed across communities that would report their data back to a central server so that pollution can be mapped and graphed.

Our goal is to make the device easy to use, capable of producing high-quality data, and cheap—recognizing that these three goals are in often tension.

After considering some possibilities, we based our design around the following equipment:

  • The Raspberry Pi Zero W
  • A cheap sensor, the SDS011
  • And various bits of around-the house hardware like Tupperware, hot glue, and hoses