All posts tagged Arduino

The Air Quality Egg uses the Grove dust sensor – a Shinyei Model PPD42NS

I wanted to see if the values I have been getting from the AQE could be verified by a simple test where I plugged the Dust Sensor directly into a Arduino and used the Arduino sketch from Seed Studios wiki – found here.

The setup looked like this :

IMG_0116

The shoe is there to hold the shield upright.

And the values I got out looks like this :

201308111911.jpg

They are in columns :

lopulseoccupancy – a count of how many times we counted a low on the output pin

ratio – a percentage

concentration – a approximation of the sensor sensitivity as based on the calibrated curve in the data sheet.

So in other words somewhere between 0.6 to 4 % – if I understand the AQE calculations then the RAW figure is in tenth of a percent.

——–

Btw. – read this to get a better understanding of the sensor – http://forums.parallax.com/archive/index.php/t-139538.html

It turn out that there is a resistor at the bottom of the sensor (can be seen if you look in to the plastic enclosure) – this heats up air to cause airflow into the chamber (the foil covered bit in the upper left hand corner). So this is the reason the sensor has to be positioned in a upright manner.

See these “raw” readings from my AQE dust sensor

201308041419.jpg

I measured the time between each rapidly rising flank to be approx 50 minutes.

This makes me a bit suspicious – can this really be representative of the dust in the air around the sensor?? It’s outside btw. – and I can not find any explanation for this sequence.

I had the first reply to my Dust Sensor problems today :

201308032226.jpg

Excellent – I have already replied back :

Thanks for the reply. I have reflowed the solder joints on the barrel jack – and restarted the egg – unfortunately it still reports zero when the barrel jack is used for the power supply. I was also fairly sure that this would not fix the problem – as I did run with both power sources plugged in for a while – this should have eliminated any floating GND problem at that stage as far as I can see?

So the only major difference now is the difference in DC voltage from the 2 power sources?

(Btw. I did find a cold solder joint on the dust interface board just after it arrived, and reflowed this.)

And my feed is : https://xively.com/feeds/103443

Trying to do a slightly more scientific test of how the dust sensor and it’s interface board works – based on what I’ve written about earlier, where the sensor reports sensible values if the remote egg is powered through the FTDI port, but reports zero if powered via the shield 7.5 volt input plug from the supplied PSU.

Unplugged dust sensor – power through FTDI port. Ie dust sensor interface board is working, but no sensor plugged into the interface board.

201308031133.jpg

4.9 volts from PSU to AQE shield – unplugged dust sensor same as above, but power taken from the FTDI port. Effectively same results as above

201308031138.jpg

4.9 volts from PSU to AQE shield – dust sensor attached. Ie power from external PSU (7.5v) – dust sensor reporting zero.

201308031142.jpg

Power from FTDI port, dust sensor attached. Same as above except for power supplied from FTDI port, dust sensor now reporting sensible values.
201308031149.jpg  

201307271739.jpg

201307271739.jpg

(Click on images for larger versions)

These are current readings from the Air Quality eggs dust sensor – the top graph is the “raw” values interpreted as resistance (ohms) – which is a bit funny as the dust sensor really outputs a PWM pulse.

The lower graph is corrected for a number of other factors.

IMG_0100

And this is the dust sensor itself. It takes measurements over a 30 second period, and counts all particles larger than a um in a internal volume of air that is apparently 283ml in size.

More information as I am trying to get a handle on the problem.

I now have a 100% repeatable test case – making it easier to find out what’s going on.

When I connected my laptop via the USB cable and the USB BUB to the FTDI plug on the eggs motherboard everything suddenly worked – and the dust sensor started reporting sensible values.

IMG_0099

(AQE plugged into the original PSU)

As soon as I unplug the USB cable and plug the power supply into the power socket the dust sensor starts reporting zero ohms. To be on the safe side I used 2 different power supplies with the same results.

The I plugged the USB cable in – and the sensor again reports sensible (non zero) values.

IMG_9173

(Air quality egg plugged into USB cable to FTDI plug on motherboard)

I can now leave the USB cable plugged in (so that the board does not reset itself) and plug/unplug the PSU. I have done this a large number of times. And it is 100% consistent and repeatable. As soon as I plug in the PSU the dust sensor reports zero. But all other sensors continue to report normal values. ……….. I measured the voltage on the i2c plug the dust sensor is plugged into, and with the PSU plugged in it reports 4.96V, with power from the USB port it reports 4.85V. This may possibly be significant – the only other difference I can think of is noise from the PSU – but I have no other really good theories at the moment.

Anyone with any good insights? For the time being I will run the remote egg from a USB power supply via the FTDI port – not terribly convenient, but it works.

After plugging in the new dust sensor I got sensible raw measurements, but R0 was zero – so after advice on this forum I reprogrammed the dust sensor interface board . This was made slightly harder by the board not having any programming headers in place.

But on running load.sh – everything bar the the first fuse setting seem to work. This first setting gives a error message :

“avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9311 avrdude: reading input file “0xff” avrdude: writing efuse (1 bytes):

Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.04s

avrdude: 1 bytes of efuse written avrdude: verifying efuse memory against 0xff: avrdude: load data efuse data from input file 0xff: avrdude: input file 0xff contains 1 bytes avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying … avrdude: verification error, first mismatch at byte 0x0000 0xff != 0x07 avrdude: verification error; content mismatch ” The dust sensor now reports 100 ohm for R0 – but zero for raw values.

Any suggestions for how to get it working again?

The Dust sensor arrived tonight for the Air Quality egg arrived today – and has now been installed, and the feed is working.

201307232214.jpg

(Click for larger image)

The measurements seem a bit wrong though – possibly the Dust_r0 of -1 is somewhat wrong.

Btw. I followed the instructions here for the physical installation. I will post pictures later.

I am now starting to see data from the first week after I updated the code for the AQE

201307132048.jpg

201307132048.jpg

201307132049.jpg

This looks a lot better than before the code updated.

Please note that there are gaps in the data – as the base AQE freezes at regular intervals and has to be restarted.

123419Next