# Preliminary PCBs for Particulates

by donblair | | 3,542 views | 7 comments | 03 May 11:37

[Note -- a follow-up discussion around this technology actually works -- with some great commentary from the Public Lab community on ways of perhaps improving upon it -- is here]

### What I want to do

Make a simple, cheap interface between an inexpensive particulate matter sensors described here and here -- and a laptop, PC, or Raspberry Pi. This is based on Jeff Warren's suggestion in a comment thread that we might using the DigiSpark to make such a connection. Such a design would not be as nicely independent as the DustDuino or a Speck designs; but if one had a laptop (or Raspberry Pi) available to make the measurement, it might be a very inexpensive solution.

The idea is the device measures the signals coming out of the particulate matter sensor, and the laptop / Raspberry Pi can measure out the particle levels via the USB port:

A breakdown of the sensor innards of the type of device under consideration is depicted here (image is from Willie's great research note):

In the same comment thread referred to above, I wrote some words about how I think the sensor works. From what I can gather, the sensor readout provides a 'high' or 'low' voltage depending on whether a particle floating in the air chamber reflects some of an internal IR beam's light into a photodiode inside the device. Tracking the percentage of 'high' vs. 'low' signal, and using additional information (assumptions about the particle sizes necessary to reflect a certain amount of IR light into the photodiode, maybe?) the particulate matter concentration in the air can (apparently) be assessed.

### My attempt and results

Here's a design for a simple microcontroller interface between one of these simple, cheap particulate matter sensors, and a laptop / RPi / PC. I tried to make the board size as small as possible:

... the optimal arrangement of pins and components to make the PCB as tiny as possible ending up resulting in a 'P' shape -- where 'P' stands for 'Particulate matter' or 'Public', say!

I chose the 32u4 processor over the DigiSpark's ATTiny, because:

• The 32u4 allows for a regular serial interface, so that we can easily suck the values into a laptop or Raspberry Pi
• The 32u4 has more memory, so that we can add additional functionality down the line
• The 32u4 has on-board USB, so that we can program the mini-meter board easily (with the appropriate bootloader installed, it should show up as a 'Leonardo' in the Arduino IDE).

[I've also added some fuses and diodes -- inspired by the Adafruit Flora design, which uses the same processor -- so that powering the board improperly doesn't 'result in tears', as Lady Ada writes in her Flora description.]

The board itself is designed with a 'PCB USB plug' (Jeff's nice suggestion) -- the board shape and traces on the board allow for insertion into a USB port directly. This means, I think, that we need to ask for printed PCBs of a certain thickness -- 1.6 mm, I think. I've also placed a microUSB header on the bottom, in case folks would prefer to attach via a cable.

Other than a 'power' LED on the board, there are no other frills.

The device has D6 and D8 broken out for the two lines on the PM sensor; we also have A0, A1, and SDA + SCL, for additional measurements (e.g., I'm imagining we might want to measure temperature, or air velocity).

### Questions and next steps

• Could such a device be used easily with a Raspberry Pi via USB? I believe so ... will check.

I know i've a quick trigger finger on the "like button", but i am so jazzed about this.

Don, i failed to order your circuit boards, didn't I? I am so sorry. Please poke me again to do this and tell me how. Maybe we can order a few of these too.

Is this a question? Click here to post it to the Questions page.

• Ah, you didn't fail at all -- I just keep dithering about the final design, and have been hestitating to hit 'print' :) But I think this might be converging to a 'printable' design rapidly. And anyway -- it's only, like, \$4 for 3 of them, at OSH Park. I'll double-check the design tonight -- and shall we then shoot for Tuesday as FISI / FIPI day?

Is this a question? Click here to post it to the Questions page.

Don any further development on this? Do you think a tool like this could be useful in this situation: http://publiclab.org/notes/stevie/05-23-2014/mississippi-phosphates-better-air-for-alice

Looping in @geraldmc

Is this a question? Click here to post it to the Questions page.

cool. i have a bunch of shinyeis and i'm working my way through learning arduino, but would this be faster? don, can you bring these to barnraising?

Is this a question? Click here to post it to the Questions page.

Hi folks!

@stevie -- SORRY for the long delay in my response! It'd be great to set up a time to chat about this -- and bring in others who know more about how the tech works (seem to be a bunch of related threads on publiclab.org about it) ...

@eustatic -- Ah, great! I think what we'd be developing here would be about the same level of complexity, at least initially, as what you're probably doing right now. But maybe we can simplify things ... haven't looked at this in a while, and never made the actual boards, but it'd be great to shoot for having at least a rough prototype to play with at the Barnraising ... will try!

Hi, Don - @mathew and I spent a week and got some drivers written, including for the Shinyei -- how much would it be to order a few of these boards, pre-stuffed? Since we've used the standard Firmata program for Arduino, it should work out of the box, I believe. Although, there seems to be some kind of Firmata-similar code out there for the DigiSpark, too... i didn't look enough into it, though.

Is this a question? Click here to post it to the Questions page.

I think this should now be possible with webjack-firmata and one of these nice cheap "Arduino Nano" third-party boards you can now get on Amazon:

These take the cheaper "ch341" usb chips, so you need the extra driver here:

USB Chip driver: http://www.wch-ic.com/download/list.asp?id=126

They are available here:

* USB CH341/CH340 WINDOWS98/ME/2000/XP/Server 2003/VISTA/, Server 2008/Win7/Win8 32/64 --- http://www.5v.ru/zip/ch341ser.zip
* USB CH341/CH340 LINUX --- http://www.5v.ru/zip/ch341ser_linux.zip
* USB CH341/CH340 MAC OS32,MAC OS64 --- http://www.5v.ru/zip/ch341ser_mac.zip