More Pickle Jr. monitors using the PPD42

It’s been a while and school intervened and I did not get to post to the blog. Since then there have been a bunch of questions and so first I want to show a few more Pickle Jr. PM Monitors I have built. I used laser cut acrylic at the local TechShop (love the place!) to make the PPD42 and the Arduino board fit together, rather than cut the box as I previously did with the Dremel and rotary cutters. So here they are:

42R RF Photon 20160515_153521

The one the left is a 42R i.e. with the sensitivity resistor added but without the fan (more on this later). The one in the center is 42RF i.e. with the resistor and a fan. Unlike the fan I added before. I mounted this fan on the opening of the PPD42. The last one (red) is a 42R with a Particle Photon. I showed the 42R Red at the SolidCon 2015 last year.

Here is another view that shows that there are three different boards in each Pickle.

42R RF Photon side 20160515_153822

The 42R on the left has an Arduino Uno, the 42RF has an Arduino Ethernet and the 42R Red has the Particle Photon.

So now on to how to connect the 10K resistor. I’ll describe this using the 42R Red. This is the smallest one I have built since the Photon is smaller than an Arduino Uno, the size is slightly larger than the PPD42 itself! The black tabs are the acrylic from the other pieces showing thru the red acrylic. It all fits together without any glue!

42R Photon 20160515_154422

Now lets open the box by removing the front face,

So now you can see that the 10K resistor is connected between A4 on the Photon, which is simply Pin5 on the PPD42 and GND. The 42R has only one cable and that is a USB cable for power. The PPD42 gets power from the VIN on the Photon and since there is no fan that is all that is needed. The Photon has wifi on board and so connected to the Photon Cloud.

Hope you liked these, I’ll return later this week and post some more results.


This entry was posted in Uncategorized. Bookmark the permalink.

27 Responses to More Pickle Jr. monitors using the PPD42

  1. stefano says:

    Thanks a lot for the pictures about the 10k resistor..

  2. crx091081gb says:

    Great article, how much difference does the fan make?

    • A.J. says:

      For the T2, the fan made a big difference. For the PPD42NS, the fan helps ONLY up to a certain speed and the placement is also important. This is a bummer because then the results from one build to another are sensitive. But the good news is that even without the fan, the modified PPD42NS correlates well with the Dylos and AES. I’ll post some experiments on the fan speed this summer if I can complete the runs.

  3. Alex says:

    Hello AJ. Good to still read from your news! (1.5 years after!)

    – what’s the gain to connect this resistance btw GND and P5? Do you have comparative chart?
    – What is for you the best and cheaper dust sensor today? SD011, PMS3003, PMS5003,…?
    – Did you heard about the AQICN comparative project ( Maybe you can help them if you’ve time/product.

    • Alex says:

      – Also, do you know this modification trick on the PPD42 ( Take the raw TP4 output, but unfortunately their chart are illegible…So what’s opinion? Have you charts?

      • A.J. says:

        Hi Alex,

        Yes TP4 will give the output prior to the thresholding on the PPD42NS. However, the amount of data produced is a lot. I have made one where the Arduino reads every 116 usec, but then that data needs to be offloaded quickly. I like this idea and will see if I can reduce the data that is produced.

    • A.J. says:

      The gain is that the sensor becomes more sensitive even without a fan. Whereas previously there were mainly zeros for many levels of PM, now there is data and so the correlation is much better. Re: other dust sensors, I like the SDS011 so far, but it is large and power hungry. For its simplicity and cost I still like the PPD42NS!

  4. J says:

    greetings, I want to ask you a question. I did your project using a raspy and get more or less the same results as I can change ug / m3 to mg / m3 in programming

    • A.J. says:

      The results from using a Raspberry Pi or an Arduino or Photon should be similar. I usually dont use an R-Pi for real time data collection as the Arduino is must better at it (IMHO only!).

  5. Alex says:


    I tried to add 10k resistor between PIN5 and GND of the sensor and PM25 reading went negative. Any reason for this?

    • A.J. says:

      Alex, the reading cannot go negative. the low pulse occupancy is the time that the pulse is low *divided* by the total time for the measurement. So regardless of the threshold, the LPO cannot go negative and neither then can the # or particles. What formula are you using ?

      • Alex says:

        Hello AJ,

        I am using the following formulas for PM10 and PM25:

        float countPM25 = ratio1 * ratio1 * .1809 + 3.8987 * ratio1 + 2.5003;
        float countPM10 = 1.1 * pow(ratio2, 3) – 3.8 * pow(ratio2, 2) + 520 * ratio2 + 0.62;

        When I connect the 10k resistor (PIN5 – R10K – GND) I got many negative readings changed the formula to the above which was proposed by Hammill:

      • A.J. says:

        I would ignore the 2.5 and 0.62 parameters. But you should not get any negative numbers at all.

      • Alex says:

        Now, the readings do make much more sense though there is still a log of noise. I am collecting reading every 30 secs and I think this time frame has to be changed to something reasonable like 3 minutes.

      • A.J. says:

        Collecting every 30 seconds makes sense, they you can always smooth it out later in your stat package. For example, I use TempoIQ and Plotly and TempoIQ can provide all the transformations of the data including rollups.

  6. Lakshmanan C says:

    Hi AJ!
    I’m trying to make the PPD42NS work with my Particle Photon… Connecting channels P1 & P2, I started getting a lot of 0’s for PM1 and PM2.5… When I just had the PM1, I used to get concentration around 150-4000… Average concentration of 800… Now after connecting P2 to one of my Digital Pins, I get mostly 0’s for both. Then I tried to add a 10K resistor as you mentioned on different discussions… Then PM1 was slightly acceptable around concentration of 1000 – 3000… PM2.5 goes to 28736545, 32653723… You mentioned you were doing a calibration to make these reading more meaningful… And I looked for it all around and found nothing… While its only mentioned everywhere to connect 10K resistor between Ground and PPD’s Pin5. I don’t understand why you’re connecting the 10K resistor between Ground and A4… and then A4 to PPD42’s Pin5. From the pictures you’ve provided, your particle photon’s Digital Pins 2 & 3 are collecting data from channels P1 & P2. What role does the A4 play here?

    • A.J. says:

      I am using interrupts to capture the time when the low pulse occurs. D2 is capturing the interrupts from P2 and D3 is capturing the interrupts from P1. Since there are two inputs you cannot use a blocking read like pulsein(). The use of A4 is simply to capture the threshold voltage that P2 has been set to fire at. Since we have used a 10K resistor in the network consisting of 2 82K resistors in series, the voltage should be approx 9/(9+82)*5 = 0.49. So verifying that A4 is reading a steady 0.49v or so says that the threshold is what we expect it to be. Hope this helps.

  7. helios says:

    Hi, I’m designing a case for a PPD42 and a number of other sensors (gas, geiger-counter) and learning a bit about fluid dynamics… My PPD42 hasn’t arrived yet but I’d like to continue designing the case; Regarding light shielding: Do you know if the PIN-diode is sensitive only for IR radiation or the entire light spectrum?
    Also I’ve not entirely understood the effect of air speed within the sensor. As far as I understood the analysis from Tracy Allen, the voltage of the refracted light is summed up. So if a number of particles pass faster, it actually results in a lower voltage. But since more particles follow, a higher air speed should just result in a smoother sensor rate rather than higher sensitivity. Is my assumption correct?

    • A.J. says:

      From my understanding: as the particle passes thru the chamber, the light from the LED gets scattered and enters the receiver. When the lights hits the receiver, the voltage is pulled low for the duration that the light is scattered. So the more the number of particles, the more the time that the voltage is low. So counting all the time that the voltage is low results in the low pulse occupancy. But when there are few particles. a longer time is needed to get a good result (hours ?). Instead if a fan is added, that speeds up the number of particles and you get a “better” i.e. more sensitive reading. As to whether the *time* that the particle spends scattering goes down, yes I do think that is true as well. I found that at fast fan speeds, the LPO actually went down instead of up. I have not found a way to cancel that effect yet. Will do some more experiments on the fan speed soon. Hope this helps.

      • helios says:

        Could it be because of the LF filtering? “The output of section b feeds into a first order lowpass filter, R7 and C4. This section attenuates frequencies above 4Hz. The result of the combined high-pass C3:R6 and low-pass C4:R7 suggests that frequencies around 6 Hz are the least attenuated, and that pulses of a certain length and frequency are more apt to pass through to the output.”

        So if the particles pass the light beam faster than in 1/6th of a second, the signal would get attenuated.

  8. Upnishad says:

    Hi AJ – great articles. I am in Bangalore India and I am using PPD42NS with sample code from:
    However I keep getting (shockingly) the following numbers :
    These numbers are way high – is this expected or I am missing something ?

    • A.J. says:

      The numbers don’t seem that high. The last number is the number of particles per 1/100 of a cubic foot. so the number is not high. In fact depending on where you are in Bangalore, the numbers are low. I had installed a sensor in Bangalore 2 years ago and the numbers were substantially higher.

  9. Dan BENDAVID says:

    Hi All hereby my sketch. I ve got a lot of negative results ( with the Resistance providing 0.47V).
    Hence i ve used the alternative formula….. What is wrong here ?

    valP1 = digitalRead(P1_PIN);
    valP2 = digitalRead(P2_PIN);

    if(valP1 == LOW && triggerP1 == false){
    triggerP1 = true;
    triggerOnP1 = micros();

    if (valP1 == HIGH && triggerP1 == true){
    triggerOffP1 = micros();
    pulseLengthP1 = triggerOffP1 – triggerOnP1;
    durationP1 = durationP1 + pulseLengthP1;
    triggerP1 = false;

    if(valP2 == LOW && triggerP2 == false){
    triggerP2 = true;
    triggerOnP2 = micros();

    if (valP2 == HIGH && triggerP2 == true){
    triggerOffP2 = micros();
    pulseLengthP2 = triggerOffP2 – triggerOnP2;
    durationP2 = durationP2 + pulseLengthP2;
    triggerP2 = false;

    if ((millis() – starttime) > sampletime_ms) {

    ratioP1 = durationP1/(sampletime_ms*10.0); // Integer percentage 0=>100
    ratioP2 = durationP2/(sampletime_ms*10.0);

    countP1 = 1.1*pow(ratioP1,3)-3.8*pow(ratioP1,2)+520*ratioP1+0.62;
    countP2 = 1.1*pow(ratioP2,3)-3.8*pow(ratioP2,2)+520*ratioP2+0.62;

    // Alternative Formula for PM25
    float PM25 = ratioP2 * ratioP2 * .1809 + 3.8987 * ratioP2;

    float PM10count = countP2;
    float PM25count = countP1 – countP2;

    // first, PM10 count to mass concentration conversion
    double r10 = 2.6*pow(10,-6);
    double pi = 3.14159;
    double vol10 = (4/3)*pi*pow(r10,3);
    double density = 1.65*pow(10,12);
    double mass10 = density*vol10;
    double K = 3531.5;
    float concLarge = (PM10count)*K*mass10;

    // next, PM2.5 count to mass concentration conversion
    double r25 = 0.44*pow(10,-6);
    double vol25 = (4/3)*pi*pow(r25,3);
    double mass25 = density*vol25;
    float concSmall = (PM25count)*K*mass25;

  10. julius pinero says:

    Hi Aj, the one in the center, 42RF i.e. with the resistor and a fan did u place the fan in the middlepart of the sensor where you usually block it?

  11. julius pinero says:

    how was the data with the one in the center is 42RF i.e. with the resistor and a fan compared to your previouse fan mod in the ppd42ns where you block the middle part then placed the fan in the bottom part

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s