Originally written by rawrdong
This is the first Instructable in the series: How to Make, Calibrate, and Test a Portable, Accurate, Low Cost, Open Source Air Particle Counter. The second installment, How to Build a Test Chamber for Air Particle Sensors, can be found here. The third installment, How to Build a Monodisperse Particle Generator for around $300, can be found here.
One of the most harmful airborne pollutants with respect to human health is particulate matter. Airborne particles with a diameter of less than 10 microns (PM10) pose an especially large risk: they can travel deeply into the respiratory system, causing a variety of cardiovascular and respiratory diseases.
Combustion (e.g. burning wood; automobiles) can generate particles less than 2.5 microns in diameter (PM2.5). Between 2.5 and 10 microns are particles such as dust, pollen, and mold. (More information about particulate matter can be found here.)
While there are many devices currently available on the market that attempt to measure particulate matter, we wanted to make something that issimultaneously accurate, small, portable, low cost, and open source.
We call our sensor the MyPart.
The plot shown is for a smoke test inside of our test chamber, where the concentration was allowed to decay naturally over ~2 hours. We see very good correlation against the MetOne HHPC-6 (a $5000 instrument), and also between the 3 MyPart prototypes.
Additional experiments were conducted with calibration particles of known sizes, as well as in outdoor ambient environments. For more in depth information about the tests we conducted, please seehttps://github.com/rutian/MyPart/wiki/Tests.
The overall size of the inner sensing chamber is 18mmx38mmx45mm. These dimensions include an onboard 400mAh battery. The components related to the sensing are completely separated from the outer casing, which allows various form factors to easily be explored, developed, and shared.
The MyPart sensor consumes ~2mA while sleeping, and ~70mA during sampling.
The total cost for the bill of materials is around $75. Granted, this doesn’t take into account the digital fabrication tools required to make the components (3D printer and CNC mill), or the time required to assemble a full device.
The BOM prices for electrical components are listed for quantities of 1 or 2. These prices drop dramatically when purchased in bulk. If you are making a small quantity of devices, many of the ICs (ADC/LDO/OP Amp/Humidity sensor) can be sampled from TI for free.
One major source of cost is the precertified microcontroller module (RFduino). The tradeoff is that for small volumes, the design and hand assembly of the PCB becomes much simpler.
All of the original design files/source code can be found here. We hope that the MyPart will give people the base from which to make and modify their own sensors, to set up sensing in their own communities, and to generate reliable air quality data. There are still many improvements that can be made to this sensor, but we hope that this project will act as a starting point for individuals and communities to actively engage with air quality.
How does optical particle counting work?
A laser and photodiode are arranged orthogonally such that the focal point of the laser is located directly above the photodiode. A small fan draws air through the system and across the photodiode. Particles in the air stream that intersect the path of the laser scatter light onto the photodiode; the resulting voltage signal from the photodiode is amplified by an operational amplifier circuit and sampled by a micro-controller. Peaks in the resulting waveform correspond to particles crossing the photodiode, and can be counted. The amplitude of the peaks can be used to roughly approximate the size of particles (higher peaks correspond to larger particles).
What does each part do?
Many of the features on the mechanical flow channel and case are designed to minimize the amount of ambient light leakage and promote 'smooth' airflow through the channel. In addition, the laser should be well aligned with the photodiode, and the overall size was iterated on heavily to maximize the packing density of the components. For more information, please seehttps://github.com/rutian/MyPart/wiki/Design-Rati...
Optical scattering: The quantity and direction of light scattered by a particle is dependent on the size, composition, and shape of the particle, as well as where it strikes the laser beam. Because of these factors, accurate sizing of particles tends to be difficult with optical scattering sensors. However, rough size cutoff bins can still be produced by using the amplitude of signal peaks.
The mechanical components were designed in Autodesk Inventor (free for anyone with a .edu email), the electrical schematic/layout was designed in Eagle, and the firmware was written using the Arduino IDE.
The mechanical components include ABS sheet stock for milling, self tapping plastic screws, and filament for 3D printing.
The more expensive items are the RFduino, laser, fan, and battery. Most of the ICs we used can be sampled from Texas Instruments if you have a .edu email. We sampled our op-amp, GPIO expander, low noise voltage regulator, humidity sensor, and the ADC from TI.
We got our circuits using the barebones quick turn service from Bay Area Circuits. However, a solder mask is highly recommended for easier soldering. Though it is possible, I would not recommend milling the board in house due to the high number of vias that may need to be manually through hole plated. A matte black soldermask would be ideal to absorb the most light, since the bottom of the PCB acts as the top of the air flow channel. For our sensor, we laser cut the PCB outline from black printer paper and used that as the 'soldermask' for the PCB.
In addition, another smaller PCB must be made to mate with the programming cable connector. We milled these boards in house.
The CNC parts include the top and bottom air flow channels, laser holder, and an eccentric cam lock to help with gluing the laser. The top air channel is milled from the 3/8in ABS, and all other parts are milled from the 1/4in ABS. The post-processed gcode for the Othermill can be found here. For postprocessing to other CNC machines, or tweaking with the toolpaths, the CAM files are in thisdirectory.
This includes a ‘light shield’ for the analog portion of the circuit, the main body of the case, the lid, and a small button. For desktop 3D printers, we recommend printing in PLA for minimum warping/splitting.
The prints may need some cleanup depending on the printer you are using; more details will be provided in the assembly instructions. We tested our device using black PLA for all of the case components. Other colors for the case and lid can be used, though they might need a coating of mirror spray/spray paint on the inside to be more opaque. Other colors have yet to be tested in our outdoor evaluations.
In this step, we will use the PCB to align and glue the laser assembly. This step should be easier if the board has yet to be soldered, though we did it after soldering. At the end of this step, the laser will be glued onto the laser holder with epoxy, and will need 24 hours to fully set.
Now that the laser is in place, we need to adjust its focus such that the focal point is directly above the photodiode. This can be done by screwing/unscrewing the front barrel of the laser. Bringing the two parts of the laser body closer to each other will move the focal distance farther away, and moving them farther apart will move the focal distance closer. (The thread pitch was measured to be roughly .35mm per turn.)
If we were to make another batch of sensors, we would probably design a jig to help with the alignment. For now, follow these steps to manually adjust the laser focus:
Power the laser with a power supply. Lower the voltage of the power supply until the laser light is very weak, and the point at which it is focused can be easily gauged by eye. For us, this voltage was 1.8 volts.
Put a piece of white printer paper perpendicular to the laser beam. The spot size changes as the piece of paper is moved closer or farther away from the laser.
Observe the spot size on the paper when it is positioned at the same distance before and after the hole for the photodiode. We want the spot size to be symmetric at these two positions. This will mean that the focus point is centered on the hole for the photodiode.
Undo the Cam lock, and screw/unscrew the front lens of the laser to adjust the focal length. Lock the laser back in place again.
Repeat steps 3-4 until the spot size is visually symmetric before and after the photodiode hole.
At this point, the laser is ready to be glued. We used 5 minute epoxy to glue the laser to the ABS laser holder.
A syringe is prefered for precisely dispense the epoxy. With the plunger removed, the two part epoxy can be dispensed into the syringe from the back and mixed using a thin rod. Alternatively, a toothpick (or similar) can be used to brush the epoxy onto the joint between the ABS and laser.
Wait 24 hours for epoxy to set.
After the epoxy has set, remove the laser assembly from the PCB.
Following the Eagle layout, solder all the components onto the board.
Some things to note:
A solder stencil is recommended, but we were able to solder each board by hand in 2-3 hours.
The photodiode should be soldered as quickly as possible since it is very heat sensitive.
The temperature/humidity sensor has no leads, and is difficult to solder. It was a little easier for us since there was no soldermask, and we could solder the pad of the device by heating up the trace leading up to it. Of the 3 sensors we made, all of them have fully functional temp/humidity sensors.
Solder the leads for the fan and laser. For the battery, solder temporary leads from the board so that power can be clipped on and off for testing. In the current PCB, the leads for the laser and fan are a little hard to get to, and may need some fiddling with tweezers.
Using the Arduino software, follow these instructions for installing the RFduino libraries.
Download the libraries for the I2C port expander, and the temperature/humidity sensor from the Github repo. A standard FTDI cable can be used to program the RFduino. However, a .1uF capacitor needs to be added inline to the DTR line. (reply #8) The official programmer from RFduino can also be used.
Connect the cables from the FTDI to the small FPC adapter to the FPC connector on the MyPart. The firmware can now be loaded through the Arduino IDE.
We now need to find the noise floor for the analog signal. This can be found by turning on the analog components and the laser, keeping the fan off, and taping the inlet and outlet of the sensor so there is no airflow. When the fan is on, any peaks above the noise floor will be considered a particle, and binned based on the height of the peak.
Solder temporary test leads to the test pins for analog ground, output of the transimpedance stage, and the final amplified output.
Since the lid of the MyPart can’t be put on while test wires are attached, put the sensor under a cardboard or opaque plastic box to block ambient light. If you can, add a lip to the bottom of the box for the wires to pass under while still preventing light entrance.
Attach the probes of a logic analyzer/oscilliscope to the test wires, and record the output.
The output of the first stage should be around 0.2 volts. If the output is substantially higher, light may be leaking in. The output of the last amplification stage should be near ground as well, since the signal has passed through a DC block. The noise floors for two of our three devices was around 0.2V. For the third device, the noise floor was around 0.4V. One very important potential improvement is upgrading the analog front end for the sensor so it is more consistent and more noise immune. This seems like it would be a very good starting point.
This stage one of the largest pain points. Some sort of a wire bundle or test probe jig would make this a great deal simpler. Ideally, the circuitboard will be inserted into the test jig, which will make all the test connections via pins and provide a light-isolated container. In this way you will not need to assemble the entire sensor before testing, nor solder on specific test leads, and the conditions will be controlled and repeatable.
When everything seems to work, the temporary leads for power can be removed. Clip off the JST connector from the battery, and solder the battery directly to the board.
The battery can be charged through the micro USB port.
At this point, the sensor should be able to give relative particle counts.
The code can be modified to map the values to the RGB LED, or broadcast over Bluetooth to a mobile phone.
To test and calibrate your sensor(s) against a reference instrument, we recommend building a test chamber to collect lots of data across a broad range of particle concentrations. The instructions for building a simple chamber from a ‘weather-tight’ storage bin can be found here.
Using this chamber, we can test with smoke, as well as calibration particles of a known size. For a more in depth description of the tests we conducted using this chamber, please see: https://github.com/rutian/MyPart/wiki/Tests.
Many potential improvements can be made to the sensor. Some highlights are below, and the full list can be found athttps://github.com/rutian/MyPart/wiki/Potential-Im...
Microcontroller IC on board rather than pre-certified module.