Plotting Air Quality Egg data using R

I recently got an Air Quality Egg. The Air Quality Egg is a open source hardware project to measure air quality hyper-locally. My egg is located on the balcony of my flat in Brixton, London. The Air Quality Egg device has sensors which read NO2, CO, humidity & temperature and posts the data to Cosm. You can view readings and simple graphs on the Cosm feed page.

Air Quality Egg on the balcony of my flat

Air Quality Egg on the balcony of my flat

Plotting sensor data using R

I wanted to see the trends in the data so I wrote a script in R to curl the data from the Cosm API and plot it using GGPlot.

Here is the script:

Here are some example graphs of NO2 over a single day and several days. (Note I don’t have the latest sensor updates so the readings may be a bit off)

Plot of NO2 for a single day

Plot of NO2 for a single day

Plot of NO2 for a 4 day period

Plot of NO2 for a 4 day period


  1. chilecker · May 26, 2013

    hi , how i adquired a Egg?

  2. Peter de Vries · June 14, 2013

    I would suggest to get a Smart Citizen kit instead. They have more sensors, it is self-powered using a solar panel (included in the kit) and it is going viral now worldwide. I expect the Smart Citizen kit will have much more users worldwide in the coming months. Get a Smart Citizen kit at or

  3. Tim Chatterton · September 4, 2013

    As an air pollution expert I really wouldn’t believe that data! I had dismissed those devices a while ago as being pretty much a complete joke – now seeing your data it looks very much like a random number generator.

    Is that really suggesting a trend of 400ppb – the legal average is 21ppb! Just because statistics can get a wibbly line out of it doesn’t make that level of scatter credible.

    Please note – I have worked in air pollution science and policy for over 17 years – this comment is made in the best intentions (but I have just come back from a working dinner)

    Very happy to discuss this further but I am seriously concerned with the credibility of the data you have presented and would hate anyone to have any faith in it.

    • Jason Neylon · September 4, 2013

      Sadly enough I have to agree with you. I thought its an interesting project but the NO2 readings are all over the place and totally out of the range reported by I am not sure if my device is detective or all unit suffer from similar problems but it does seem pretty useless.

      • Tim Chatterton · September 4, 2013

        Its not a defective device, the science behind them is wrong – they just aren’t capable of working at the low concentrations involved in ambient air pollution (they may be more suitable for exceedingly high concentrations in some industrial applications) However at least the egg is very cheap, compared to the just ‘cheap’ similar equipment being sold to local authorities on the basis that cheapness is a reasonable trade for accuracy/reliability. We have tried for a number of years to either get comparison data for these and ‘proper’ chemi-luminescent monitors, or to actually get lent the monitor to do a comparison of our own, but strangely the manufacturers never seem that interested!

    • Art S. · May 3, 2014

      Hello Mr. Chatterton,

      I am considering purchasing either an AQE or as another posted linked above, the Citizen Sensor setup, which at least appears to have more documentation and efforts to calibrate their sensors.

      I know it is unrealistic to try and achieve lab-grade data sensitivity and precision; however, as an AQE post suggests, might there be some value in analyzing trends of collective data, even if individual eggs can not be considered to be particularly accurate?

      Given your expertise and concerns over data quality, do you have any other suggestions for what an average citizen, looking to do low cost data collection can do? I would very much like to be involved, and while I am sure it is possible to build a slightly higher quality measurement station what are the realistic costs associated with this (Any sensor suggestion?), and how would be integrate this data in a useful way without the networks built up from these DIY projects like AQE?

      Just looking for your input!


  4. Tim Chatterton · September 4, 2013

    However, as you have got this far, I would suggest for your own entertainment to send a copy of your data to the manufacturers and ask them to explain it, and then politely ask for your money back! I would be very interested in seeing copies of any correspondence, and could also provide a professional opinion to support your claim!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s