AQE: Problems and tips

86 views
Skip to first unread message

Alan Senior

unread,
Nov 21, 2012, 3:13:30 PM11/21/12
to IoT Bristol
My Egg is up and running and reporting to Cosm and I can see the feed
(after some difficulty identifying it!), but only on the Cosm
website.

A few of the problems encountered were:

1. The NO2 and CO sensors both report a value of 0 which is clearly
wrong so it appears that at least one of the boards needs to be
flashed with new software. Checking voltages shows that the sensors
themselves appear to be correctly biased so it must be a software
issue. Humidity and temperature are reported.

2. My Egg is registered but there is a "Gotcha", the Egg serial number
is only recognised if the serial number is typed in using lower case
letters (a-f) and numbers. The colons are also needed of course. In
future the serial number should be provided with the Egg in the right
format!

3. My Egg appeared on the Air Quality website map (in Keynsham UK),
but only after a long delay of hours.

4. At the moment no environmental data is being shown on the Air
Quality website (http://airqualityegg.com/) though the text/location
stuff is there. This suggests that the Air Quality website is not
collecting the data from Cosm.

5. I cannot find any instructions on using or connecting up the Egg
and what the LED indicators signify, so it is not obvious when it is
working OK. Only techies are likely to figure things out by monitoring
the serial interface with special hardware...

Cheers,
Alan

Alan Senior

unread,
Nov 21, 2012, 6:09:19 PM11/21/12
to IoT Bristol
OK, an update. Full of techno babble I am afraid ;-)

I have flashed the sensor shield using a file from Damon's previous
post. Incidentally these links are slightly confusing because the two
main board download files are the same, and the source for both base
and remote boards appear to be both in just one zip/tar file (or have
I missed something?)

To program the sensor card it appears to be necessary to use the 6 pin
ISP port on the shield. I also used the free AVR Studio development
tools with ATtiny88 selected as the target to load the .hex file and
an ISP to USB adapter from Pololu. Note that the shield needs to be
plugged into the Nanode card to get power, even though the power cord
plugs into the shield!

The CO and NO2 raw values still report as 0 Ohms but I now get some
ppb numbers from the sensors. Yay! The 357250 ppb CO seems high
(2000-3000 is normal outside?) but as the sensor is not calibrated
that may be a reasonable number, or maybe I won't make it through the
night. I just need to pollute the atmosphere somehow to see if the
numbers change ;-)

The temperature reading also seems more sensible too at 18 deg.C in my
workshop, it was reading about 4 deg.C higher.

Humidity reached 103% today but it is the trend that is important. I
may fiddle with the calibration factors at some point.

The Base station serial interface is reporting lots of time-outs for
replies from Cosm but otherwise it seems to be working and getting the
some data sets through.

That all for tonight!

Alan

Tim Lovell

unread,
Nov 22, 2012, 3:12:22 PM11/22/12
to iotbr...@googlegroups.com
I found this blog post on Wicked Devices.

http://blog.wickeddevice.com/?p=385

"Some people have been trying to update their fielded Egg Shields and running into trouble with really small values being reported (like 0). One reason this could happen is a mistake made here at the “factory” during programming ...."

Any use? No kit here to try stuff on.

Tim

Alan Senior

unread,
Nov 22, 2012, 3:27:08 PM11/22/12
to IoT Bristol
Hi Tim,

Thanks for the link. Yes that may well be a solution to my 0 reading
for NO2 and CO. In the end I just re-flashed the sensor shield and it
gives no zero readings now so I assume I fixed it in a round about way
maybe.

Alan

Alan Senior

unread,
Nov 22, 2012, 4:14:09 PM11/22/12
to IoT Bristol
Hi,

Mmmm. The data reported by Cosm is not the data my Egg is sending!

My Egg thinks it is 18C (reported by serial output) in my workshop
which is about 1 degree high which is acceptable. Cosm however
reports it as 22C!

NO2 and CO readings reported by the serial link do change, however
Cosm seems to be stuck at a high value.

Humidity seems to be reported correctly on Cosm so at least something
works.

A simple investigation of the code indicates that a watchdog triggers
if the software hangs or falls over and this is triggering very
frequently so it reboots every few seconds...

I have run my own Pachube/Cosm software on another Arduino board with
Ethernet shield and that is running reliably so the internet link and
Cosm interface from my workshop work OK. I can only assume there is a
significant bug in the Egg Base station software. Since the code is
rather large I suspect that the variables are getting corrupted
somehow, possibly by a routine running off the end of an array
corrupting other varaibles. I only say this because I noticed this
is a fault with the standard Arduino Pachube example has when
additional sensors are added!

The Egg team have clearly put a lot of effort into the Egg project and
I think the hardware is OK, but the software is still in the Alpha
stage and needs fixing before deployment otherwise the team are going
to put a lot of effort into "fire fighting" customers problems.

It looks like almost every Egg on Cosm is not reporting correctly
except one in NYC, one in San Francisco and a lot in Portland, perhaps
we ought to talk to those guys ;-)

So sadly I have pulled the plug on my Egg and will await a software
release and some instructions.

Meanwhile I can only say encouraging words to "egg" the team on to fix
these teething problems.

Alan

Damon Rand

unread,
Nov 23, 2012, 5:11:31 AM11/23/12
to IoT Bristol
Hi all,

> Meanwhile I can only say encouraging words to "egg" the team on to fix
> these teething problems.

Very punny Alan! :-)

Yes, it seems the eggs in Portland are getting some nice results in,
so it appears to be possible to get them working. I've written to
Ed/Joe to ask if they know what sketches the Portland eggs are running
or if they can give us a contact there, will wait and see..

Cheers,
Damon.

Alan Senior

unread,
Mar 26, 2013, 6:19:35 PM3/26/13
to iotbr...@googlegroups.com, da...@smartstreetsbristol.com
Hi All,

I see there are some software updates available for the AQ Eggs. Looking on github reveals lots of different builds with little advice on which ones to use or any useful software version history information.

In the end I figured out I needed "AQEBase" for the main indoor board and "AQERemote" for the outdoor unit. From the date stamps these were updated on 18th March 2013. The AQEREmote software gets reported by the AQEBase unit as Firmware Version 3 or 4 depending on the parameters being sent.

The AQEBase now reports version v1.03 on boot up.

I have not flashed the sensor shield for the Remote unit, I last flashed it in January, but it looks like there was an update in February.

My Egg is now online, but not yet outside as I want to see if it keeps running.

Of course things are never as easy as you hope - in the process of updating the software I managed to blow the micro-controller.  I suspect this was due to a difference in voltage between the PC earth and the mains powered Egg... doh.  Anyway a serious bit of PCB surgery later and a new micro-controller has been fitted and it runs OK... sometimes you get lucky with hacks like this ;-)

One gotcha that caught me out was that the replacement micro-controller I used had an old copy of the Arduino boot loader on it and this did not work with the soft-restart() function used by the AQEBase application to recover from long reply delay times from Cosm.  You need a more up to date Arduino boot loader such as the optiboot.  So this is something to be aware of if you need to reflash the bootloader as well as the main AQE application code but most Egg users need not worry about this.

To monitor the operation of the AQEBase I have added a low cost Bluetooth transmitter (about £5 on eBay) so that an Android phone can be used to see the serial text stream.

It looks like some Eggs on Cosm are reporting large step changes ppb values which do not look real to me, I think these are indicative of a software bug in the maths routines somewhere (eg rollover of integer maths).

So my Egg is running, just in time for Easter!

TTFN,
Alan

Alan Senior

unread,
Apr 26, 2013, 6:36:54 AM4/26/13
to IoT Bristol
Hi all,

I've been looking into why I managed to "fry my egg" when
reprogramming.

The connection from the program adapter to the eggs onboard micro-
controller connects directly to the micro-controller pins, this is
normal but this does make the setup prone to problems when a program
cable is initially mated with a powered egg because unwanted currents
can flow while the connection is being made and the micro-controller
silicon cannot handle it. When fully plugged in there is a 0V return
so all is OK, but during mating the 0V may not be the first contact
that is made in the plug.

I had a look at the common mode voltage coming from the "wall wart"
PSU adapter that plugs into the mains and was supplied with the eggs,
these have switched mode converters inside which is typical these
days. These PSU adapters can suffer from a little common mode power
"leakage" due to parasitic effects and so then some common mode AC
voltage appears on the output. I tested mine and found it produced
about 30V AC common mode, which I noticed is enough to feel a "tingle"
when touching the PSU output and a nearby earth... Having programmed
100's of these micro-controllers before without problems I have no
doubt that this was what blew the micro-controller.

So I think it would be a good idea to connect the programming cable
fully BEFORE applying the power to the egg, or use a laptop that is
running off the internal battery (no mains to the laptop) to program
the egg.

TTFN,
Alan

Alan Senior

unread,
May 27, 2013, 6:31:36 PM5/27/13
to IoT Bristol

The AQE finally exhausted (eggs-hausted!) my patience a few weeks ago
- there are gaps in my AQE data and clearly a lot of rubbish readings
on CO and NO2 despite numerous time consuming software upgrades, and
the poor resolution (1C steps) on temperature is annoying...

Anyway I decided to build my own Air Monitor using cheap bits from
eBay and then to write my own software based on the available Arduino
libraries and examples off the web. A brief look at the data sheets
for the sensors makes it quickly obvious that the Egg team should not
have tried to generate ppb figures because the manufacturing
tolerances of these cheap sensors make the calculated ppb numbers from
a fixed software algorithm pretty meaningless, it would have been much
better output just the scaled raw numbers as trend indicators.

The Air Monitor has been running for a few weeks now with no data
outages and is producing sensible reliable data. Here are the CO
sensor feeds from the Egg and my own Air Monitor for comparison:

https://api.cosm.com/v2/feeds/87422/datastreams/CO_00-04-a3-27-c8-bb_1.png?width=850&height=350&colour=%23f15a24&duration=7day&legend=CO%20trend%20(ADC%20raw%20data)&title=CO%20Level&show_axis_labels=true&detailed_grid=true&scale=manual&min=0&max=65000&timezone=UTC

https://api.cosm.com/v2/feeds/128684/datastreams/CO_level.png?width=850&height=350&colour=%23f15a24&duration=7day&legend=CO%20trend%20(ADC%20raw%20data)&title=CO%20Level&show_axis_labels=true&detailed_grid=true&scale=manual&min=0&max=100&timezone=UTC

Occasionally there is a hint of correlation between the two but
generally the Egg data is really erratic.

I've also added barometric pressure and temperature with 0.1C
resolution (gives much smoother plots) to my Air Monitor, see these
links:

https://api.cosm.com/v2/feeds/128684/datastreams/Pressure.png?width=850&height=350&colour=%23f15a24&duration=5day&legend=Pressure%20trend&title=Pressure&show_axis_labels=true&detailed_grid=true&scale=manual&min=980&max=1030&timezone=UTC


https://api.cosm.com/v2/feeds/128684/datastreams/Temperature.png?width=850&height=350&colour=%23f15a24&duration=5day&legend=Temperature%20trend&title=Temperature&show_axis_labels=true&detailed_grid=true&scale=manual&min=0&max=30&timezone=UTC

I think I may end up cannibalising my Egg for the NO2 sensor... :-(

Incidentally I still think the AQE is a great idea, it is such a shame
that it has been rushed out to the market with so many software
bugs... if I had paid the full price for one I would have been egg-
ceptionally annoyed!

TTFN,
Alan


Steve Crawshaw

unread,
May 28, 2013, 3:36:09 AM5/28/13
to iotbr...@googlegroups.com
Interesting. It would be instructive to locate the CO sensor close to the roadside to see if morning and evening rush hour peaks are detected. I always thought that the NO2 sensors would not give good results at ambient concentrations. We use API M200A instruments to give ppb resolution and they are ~£8K a pop.

If you are interested in analysing the time series air quality data from the instrument there is a set of tools for this called openair run under the open source R statistical software. http://www.openair-project.org/

steve
--
You received this message because you are subscribed to the Google Groups "IoT Bristol" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iotbristol+...@googlegroups.com.
Visit this group at http://groups.google.com/group/iotbristol?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.


roup/iot
[http://www.sustainablebristol.com/wp-content/uploads/2013/03/Back-the-bid-banner-copy.jpg]<http://bristolgreencapital.org/back-the-bid.php>
"/>

______________________________________________________________________
Council services online: http://www.bristol.gov.uk/service

Keep up to date with the latest council news and sign up to our monthly email newsletter: http://www.bristol.gov.uk/ournews

Have your say on consultations and view our webcasts: http://www.bristol.gov.uk/consult

Alan Senior

unread,
May 28, 2013, 5:00:15 AM5/28/13
to iotbr...@googlegroups.com
Thanks Steve. That web link looks really really really useful! I will
download the manual and see how I can use the software.

I have a colleague who wanted to put an AQE at a school to show the
pollution peaks when parents drop off/pick up their children (!), but the
AQE has proved to be unsuitable due to the poor data output. So he's bought
a sensor from Alphasense, which is rather more affordable, and looks like it
should give better results - that is an on-going project...

My Air Monitor is incrementally evolving. I plan to make it battery operated
(1 week minimum) and log data to a cheap SD memory card. I have a nice
little light sensor with a lux level output to add and a Real Time Clock for
accurate datation when logging to the SD Card. I suspect that bureaucracy,
liability and theft problems etc etc etc will stop me from deploying it
anywhere really useful, but I may talk to the local council when I have a
thoroughly tested(!) prototype running.

Anyway thanks again.

Alan

Damon Rand

unread,
May 28, 2013, 6:06:29 AM5/28/13
to IoT Bristol
Hi Alan,

I share your frustration, it is a pity things have turned out so
messy. The latest Cosm graph removal has been particularly
frustrating, needing to hand code graphing links is not cool!

Regarding the data, I've been running comparison eggs for some time
now. The NO2 monitor is still highly problematic and I can't get it
stable but I can say that the CO monitor does works quite well
(excepting a scaling problem that remains, see below). You can see a
very good correlation between two eggs I have hanging out my window
here.

https://api.cosm.com/v2/feeds/104462/datastreams/CO_raw_00-04-a3-9f-a0-14_1.png?width=850&height=350&colour=%23f15a24&duration=7day&legend=CO%20trend%20(ADC%20raw%20data)&title=Home%20Egg%201&show_axis_labels=true&detailed_grid=true&scale=manual&min=80000&max=200000&timezone=UTC

https://api.cosm.com/v2/feeds/105402/datastreams/CO_raw_00-04-a3-27-d3-a9_1.png?width=850&height=350&colour=%23f15a24&duration=7day&legend=CO%20trend%20(ADC%20raw%20data)&title=Home%20Egg%202&show_axis_labels=true&detailed_grid=true&scale=manual&min=80000&max=200000&timezone=UTC

The positive take away message I have is that its looking pretty
certain the issues are software related meaning as long as egg team
people keep working on it we have a chance of getting a working system
eventually.

Damon.
> --
> You received this message because you are subscribed to the Google Groups "IoT Bristol" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to iotbristol+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/iotbristol?hl=en-GB.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Damon Rand
Head of Product Design
Clean Energy Prospector

tel: +44.2071930914
tel: +64.48890122
mobile: +44 7887682995
twitter: @ceprouk
skype: damonatceprouk
http://www.cleanenergyprospector.com

Alan Senior

unread,
May 28, 2013, 6:44:22 PM5/28/13
to IoT Bristol
Hi Damon,

Yes, you do seem to be getting some better results that I am. It looks
like yours Home Egg 2 has some issues as there are consistent steps in
readings between 90,000 and 100,000 that should not be there (for
example you never see a smooth slow transition through that range
which is very suspicious and indicative of a software bug). The
diurnal oscillations may be temperature sensitivity in the CO sensor,
so it would be worth seeing if there is a correlation with the
temperature sensor in the egg. The CO sensor output variation will be
an inversion of the temperature cycle waveform, e.g. the CO reading
will appear to drop as temperature increases and vice versa, but
really the CO sensor is reacting to the temperature rather than a
change in CO concentration).

As you say this will all get sorted in the end by software updates ...
and I am looking forward to a bug free version! The AQE has a lot of
potential for raising awareness of pollution which can only be a good
thing.

I was puzzled by a few regular spikes at 8AM (7AM UTC) on my own CO
Air Monitor indoor readings until I realised that the sensor detects
the butane and propane propellants in the antiperspirant aerosol used
by a certain household member! Cooking also registers due to the use
of a gas cooker. Burning toast (!) and grilling bacon causes big CO
spikes too, despite the fact that the kitchen and the workshop the
sensors are in being on different floors at opposite ends of the
house! Suddenly my private life is being exposed in sensor
readings ;-)

TTFN,
Alan
Reply all
Reply to author
Forward
0 new messages