New particulate sensors

New sensors for air particulate sensing

While ordering more Shinyei PPD42NS particle sensors off of aliexpress, I noticed a bunch of other particle sensors that I hadn’t seen before. It would appear measuring air quality is becoming more popular! I even found a full-on portable air quality monitor, but it appears it’s not wifi-connected, and apparantly has no documentation (common for Chinese goods). It’s by a company called Plantower out of China.

plantower.png

There’s also this, which I think is by Plantower too, the SDS011, the SM-PWM-01 (which is another ripoff of the Shinyei PPD42NS), the INSAN CP-15-A3 all in Chinese, and the PMS3003.

Of course there’s the Shinyei PPD42NS and it’s first ripoff, the Samyoung DSM501A, which have been out for a while.

Read more

Calibratin' air quality monitors

Calibrating air quality sensors

I’ve been working with the Shiyei PPD42NS sensor, and the cheaper (by %50) Samyoung DSM501A. My goal is to have a portable sensor that will keep track of the particulate matter you are breathing, and warn you if you hit dangerous levels.

The first step is making sure the sensors are accurate enough for this purpose. I bought a Dylos DC1100 Pro air quality monitor, which uses a laser and a fan to measure particles in the air. It puts out a number that is number of 1-micron or larger particles per 0.01 ft3 (and a number for 5-micron or larger).

Procedure

calib-setup.jpg

Read more

Python machine vision

Python machine vision LCD OCR

I just finished getting a camera through a usb adapter visible in python, and now I’m getting the machine vision set up. I found someone who already did all the hard stuff. I used this LCD numbers image since it had the same font as the display on the Dylos air quality monitor. I had to adjust the perspective to make it flat for the machine vision training though, so I used gimp to do that. Then I realized there was a 0 with a line under it, so I replaced that with another 0 from lines below. After that, I started training the program, but it was seeing 4s and 1s. I had to change the threshhold for detection from

thresh = cv2.adaptiveThreshold(blur,255,1,1,11,2)

to this

thresh = cv2.adaptiveThreshold(blur,255,0,1,25,-2)

The docs describe this function a bit, although I can’t get the cv2.CV_ADAPTIVE_THRESH_MEAN_C to print, so I’m not entirely sure which adaptive_method I’m using (I think I changed it from gaussian, 1, to linear, 0). I empirically found the higher block size and lower constant seem to work best for this image. After that, it works well.

Read more

Camera and easyCAP usb

Camera troubles

I’m setting up a calibration platform for particle sensors, and I need a camera to capture the data from the Dylos sensor, because it only outputs data over serial once per minute, and I need once per second. So I need to capture an image of the number output on the display, process it and extract the data. Unfortunately, I don’t have any webcams lying around the house, and I’m not about to go spend $20 for one when I have another camera here. It’s a small camera, probably the same as in your laptop and webcams. (I was going to use it as a remote security webcam, but then I found out it’s much harder to interface a camera with a microcontroller than I thought.) So I hooked it up to an easyCAP I have with a patch cable, and tried to interface it with Python on a Windows laptop, which became very difficult. Eventually, I was able to get it working with this tip. The steps I had to take to get it working were:

The cd that came with easyCAP is here if anyone needs it.

With linux, this is easier because you can call mplayer with subprocess.

Read more

Air quality and your health

Summary

The quality of the air we breathe is not something we often think about, because most of the air we breathe is clear (over short distances), so we don’t notice the pollution. However, modern-day technologies like cars, trucks, power plants, and factories, are polluting our air. It’s only going to get worse with increasing populations and consumption of energy, while we’re still using the same technologies. To protect and optimize your health, it’s best to monitor your air quality and purify it when necessary.

Do you clear your throat a lot? Cough often? Have congested nasal passages and sinuses, manifesting headaches and pain? Chest pain, feeling tired a lot, dry/sore throat all the time, get sick a lot? If you don’t, surely you know someone who does, unless you’re lucky enough to live in a clean-air area, which is probably not near a densely-populated area. Many health problems can arise from poor air quality:

  • chest pain, headaches, nausea, allergies, eye irritation
  • weakened athletic performance, increased fatigue, reduced resistance to infection
  • respiratory problems: coughing, sore and/or dry throat, shortness of breath, emphysema, bronchitis, asthma
  • mucus and sinus problems: post-nasal drip, sinus headaches and congestion,
  • death: heart attacks and arrythmia, cancer, strokes

It usually sneaks up on people (like slowly heating up the water to boil a frog), but in cases with spikes of high amounts of particles, can cause death within days to weeks. Air pollution is getting more and more attention; the World Health Organization recently declared that 1 in 8 deaths is linked to air pollution, and “that air pollution is now the world’s largest single environmental health risk.” Chronic exposure will give you cancer (the small particles have lots of surface area and free radicals that damage your body), and take off 1-3 years of your life. Other impacts range from premature births to serious respiratory disorders, even when the particle levels are very low.

Read more