Air quality sensors?

Started by sanzoghenzo, March 01, 2015, 07:58:10 PM

Previous topic - Next topic

sanzoghenzo

Hi all,
I'm using my olinuxio A20 as a server, mainly a music server, but I'm tinkering with node-red to do some home automation.
Some time ago I bought an Inexpensive temperature and humidity monitod, a DHT22, that I was able to use with an arduino, but I'm still not able to get it working with the A20. I tried the DTH22 driver for the A13 found in this forum but I had no luck.
Anyway, in the meantime, I thought about adding also some other sensors to monitor the air quality of the room, and since I don't want to spend too much time on this (as I'm doing with the DHT22) I'm asking you if anybody already did it, and which sensors used succesfully.
Thanks for the attention!

kyrk.5

Do you have an idea what exactly you want to measure? O2 level? CO2 level? Dust level? Or something different. Olimex is having some gas sensors in they webshop. I tried one of those, it is a simple analog voltage. I never tried to convert it to an exact ppm value. Also some of the sensors need a special measurement cycle.

sanzoghenzo

Hi,
thanks for the answer.
I would like to track mostly CO2 and VOCs.
The problem I have with the DHT22 is that its a 1 pin digital sensor and I'm not able to get the right timing/readings from it, and I would like to avoid it with those sensors.
How did you connect your analog sensor to the A20 board? A long time ago I checked and I couldn't seem to find anything that didn't involve an external ADC...

kyrk.5

Hello,

I never tried the DTH22 before, but as far as I can tell from the internet, it is like the one wire protocol but a little bit easier.
Also I do not know the A20, mostly I am using PIC32. Since there are plenty of analog inputs, connecting an analog sensor was not a problem.

Anyway, using a simple analog sensor might be looking easier and faster, but the accuracy and precision will not be the same as a digital one. So it might be worth to invest time into the digital sensor to understand the root cause of the problem.

From my point of view, you are facing two problems:
- connecting an analog sensor to your A20 board
- timing problem with the DTH22

Since I do not know the A20 board, I am not familiar what are there the possibilities regarding reading an analog signal.
Regarding the timing problem, there maybe I can help. The SHT11 digital humidity and temperature sensor, have also a digital interface but on two wires. This is even more easier to drive, the timing is not so critical since you have to generate also the clock. Maybe you can consider to try this sensor. Actually it is like an I2C sensor but there is a twist in the protocol. Also there exist from the same manufacturer an I2C compatible one i think.
Back to the DTH22. What is your exact problem with the timing? What kind of measurement possibilities do you have? Logic analyser, ossci?



sanzoghenzo

Thanks for taking your time to help me!
I my previous finding the only analog input of the A20 i LRADC1, but has only 6bit resolution and 2V max. So, If I have to use an analog sensor, I also have to buy an ADC to have some more accuracy. But maybe someone has already tried some digital sensors or a good combination of ADC and analog sensors with the A20 and could share his knowledge!
I tried the DHT22 with an usb AVR using the arduino DHTlib without any problem.
I tried also using the dht22-sun5i kernel driver, but it doesn't work. It's a bit old and for A13, and when I got my head around to adapt it to the kernel I'm using, it threw debug messages stating that the timing of the first 0 level signal is too short (around line 98 of dht22-sun5i.c) and then shows incorrect temp and humidity values.
I started trying to move the driver to a standalone program using a20gpiolib, but I never finished because of other projects I had lying around :)
Unfortunately I don't have measurement tools suited for the task, and I don't plan to get it anytime soon...
thanks again for you help
regards from Italy