Public Lab Research note


Preliminary PCBs for Particulates

by donblair | May 03, 2014 11:37 03 May 11:37 | #10405 | #10405

[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:

miniMeter.png

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

ShinyeiPPD42NS_Insides_Labeled_600.jpg

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:

mini-meter-revd-osh-front.png

... 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 did this Help out by offering feedback!


People who did this (0)

None yet. Be the first to post one!


7 Comments

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.

Reply to this comment...


  • 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.

Reply to this comment...


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.

Reply to this comment...


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.

Reply to this comment...


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!

Reply to this comment...


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.

Reply to this comment...


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:

$7.59 each: https://www.amazon.com/Solu-Atmega328-Arduino-compatible-Beginners-Download/dp/B00SISJSPE/

$22 for 5: https://www.amazon.com/XCSOURCE-ATmega328P-Controller-Arduino-TE359/dp/B015MGHH6Q/

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 http://doityourselfchristmas.com/forums/showthread.php?14690-CH340-USB-RS232-Driver

This could be nice because you can just read in the data via the audio jack on a webpage, even from a smartphone (see the demo on the webjack repository here: https://github.com/publiclab/webjack#plotting)

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

Reply to this comment...


Login to comment.