Connecting a particulate matter sensor to your PC or Mac

I’ve written before about what particulate matter sensors are and how they work. Many of these sensors come with a tiny 8-pin connector. With some luck, you even find an English data sheet. But you might just end up with a Chinese one. It might look like this:

pmsensor-cover

Luckily, most signals have english names:

datasheet

Ok, that’s all we need to know to connect this thing to a PC. You can see that the supply voltage is 5V and the I/O voltage is 3.3V. That’s perfect for most use cases. You also see that there is some kind of serial interface RX/TX and a SET and RESET input.

What do you need? The only thing you need is a USB to Serial (TTL) adapter. The come in different variants and might look like this:

usbser1 usbser2

usbser3

Before buying check 2 things: The adapter should offer 5V AND 3.3V power outputs (for this project we only need 5V, but you might need the 3.3V for other projects) and have a DTR output (we will use this to turn the sensor on and off).

Now connect the sensor to the adapter as follows:

 VCC pin 1  5V
 GND pin 2 GND
 TX pin 4  RX
 RESET  pin 6  DTR

Note that the pin numbers are for the specific sensor shown above. Check the data sheet of your sensor, the pins might be different!

Why isn’t RX not connected? All the dust sensors I’ve seen do not use this signal at all. If it isn’t used, there is no need to connect it (but you can do if you like).

Finally this will look like this:

dust-sensor-interface

You can now connect this to you PC or Mac and read data from the sensor. We will show in another article how to do this.

Measuring air quality

When people think about comfort in their apartment, most people think first about temperature. But another important factor is air quality. I don’t have to tell you that smells from cooking aren’t always the best. There are much more particles in the air that impact the quality. These particles are generally named “Particulate matter”. The EPA defines PM as follows:

“Particulate matter, or PM, is the term for particles found in the air, including dust, dirt, soot, smoke, and liquid droplets. Particles can be suspended in the air for long periods of time. Some particles are large or dark enough to be seen as soot or smoke. Others are so small that individually they can only be detected with an electron microscope. ”

Today, most measurements you find are PM2.5 measurements. This measures particles smaller than 2.5µm. Roughly one out of every three people in the United States is at a higher risk of experiencing PM2.5 related health effects.

Do you know the PM2.5 values in your living environment? Most likely not, but it is relatively easy and cheap to do do these measurements today. While calibrated sensors is still very expensive, for home-use uncalibrated sensors do a good job to give you a rough idea about possible problems.

These sensors work as follows:

dust-sensor

A light sends light into an air flow. Small particles will reflect the light. A receiver than measures these reflections. Seems very simple – right? It really is. The cheapest sensors are available for less than $20 on Chinese shopping sites. They use LEDs as a light source. Laser-based devices are a bit more expensive ($50 and up), but they can detect smaller particles.

Let’s have a look about a laser-based sensor like this:

P7180912-web

The fan creates an continuos air flow through the device. Looking into the device you see the air channel and the detector.

P7180899-web

The detector looks like this:


What else is inside?

This is the simple PCB. It is based on a small microcontroller and some external components.

The good thing about these (more expensive) sensors is that they already do the hard work for you. They have a serial output that already sends the PM1.0, PM2.5 and PM10 values.

You can use a simple USB-to-Serial converter and read the data directly from your PC. How to connect this sensor to the adapter is shown here.

References