Our products, Nanode, wireless, MCUs, electronics and more

Air Quality Egg: Shield Firmware Update

Posted: April 22nd, 2013 | Author: | Filed under: AQE | Tags: , , | Comments Off

Based on my research findings (described in my last post), I spent some time digging into the Egg Shield hardware and firmware and I made some significant updates in hopes of improving results. I’m currently running an overnight experiment of the latest firmware, which I pushed out on GitHub (also for the Ozone and VOC add-ons). I also put load scripts out there to help ease the update process. I wanted to give an update on what I found and what I did.

Constant Heater Voltage

There was an observable random “spiking” phenomenon associated with the dynamic heater voltage control algorithm. I still don’t know the root cause of that, but I know that if I take that algorithm out, the associated phenomenon goes away, so the current version of the firmware sets the voltage at start-up and leaves it alone. I determined the settings for each heater experimentally by trying a setting, measuring H+ and H- and calculating the heater power, until I hit the datasheet targets.

Range Selection Algorithm / Fixed Point Math Rewrite

I was concerned about the frequent reports of apparent overflow conditions occurring. I looked into how to make better use of our range selection capability and rewrote it to select the range that yields results that are closest to the mid-range voltage. I believe this algorithm should provide more stable / continuous results than the original algorithm. In particular, I expect that it will be more immune to overflow conditions.

NO2 Hardware Bug – Workaround

In re-writing the Range Selection Algorithm, I was astonished to find an undiscovered hardware bug in the Egg Shield. I kept trying different settings on the range selection divider for NO2, but no matter what I did, two of the range settings always yielded the same analog-to-digital conversion result. I dug in and traced it back to the schematic (after hours of assuming I must be doing something wrong in software).

It turns out there is a node named “/NO2_R2_SEL” and a separate node named “/R2_SEL.” Those were meant to be the same node, but the tools don’t know that, so they never got connected in the layout. The effect is that it’s impossible to select a low-side resistance of R1 + R2 = 24.2 kΩ for NO2. <face-palm!> The firmware didn’t know about that bug either, so its model of the world didn’t agree with reality when it chose that range. This inconsistency was almost certainly also contributing to the instability in the NO2 readings we’ve been seeing. Anyway, the firmware agrees with the hardware now. I think it will be less accurate than it could have been were it not for the hardware bug, but I think this will be much better than what we had going on.

What To Do Next

I’ll follow up with a post tomorrow night with my overnight results. If you’re ambitious and know what you’re doing, the software and binaries for the firmware updates above is already out on GitHub and you can go ahead and re-flash your Egg Shield to hopefully start getting better results right away. As a reminder, Joe Saavedra also made a nice tutorial on how you can use an Arduino (or a Nanode) to reprogram a Sensor Shield. I plan to do a video to demonstrate that process as well in the next couple weeks. As always, if you’re uncomfortable reprogramming the hardware for yourself and  you are willing to pay for the round-trip shipping, I am willing to personally reprogram your hardware at no additional cost.


AQE: Enhanced RGB User Feedback

Posted: February 4th, 2013 | Author: | Filed under: AQE, Software | Tags: , , | Comments Off

Over the weekend I worked on making the color expressions of the Air Quality Egg more… well, expressive. The update is on Git-Hub so feel free to update your software (howto videos) for the Remote and Base units. This is the 1.03 version of both baselines (version number gets printed to the serial console).

As the Eggs have been reaching their destinations, feedback from users indicated that the setup process had some significant holes in diagnostic feedback. The most important of these was that the outcome of the pairing interval was invisible to the end user; the only way you knew that pairing succeeded was that the system started working a couple minutes later. If the system didn’t start working, you were left scratching your head and trying again. So I added an acknowledgement to the pairing behavior, and now there’s clear feedback about the outcome of the pairing interval: after the yellow pulses that signify pairing in progress, three magenta blinks indicate “pairing was not acknowledged” and three cyan (light blue) blinks indicate “pairing was acknowledged.”

The second feedback notable feedback confusion was related to Cosm provisioning. The previous behavior was to indicate solid green when provisioning succeeded, but *only the first time* after that you would never see green again. So now, if provisioning has previously succeeded, you get three green blinks.

In summary, the colors the Egg expresses now come in three “flavors”:

  • Pulsing colors are used to indicate normal activity and progress (I know some people find this annoying, but I’m erring on the side of more feedback)
  • Blinking colors are used to signify status
  • Solid colors are used to indicate conditions that result in a restart
  • Blinking/Solid green, blue, and cyan are used as “positive” indicators
  • Blinking/Solid red and magenta are used as “negative” indicators

The following flowchart describes the feedback behavior of the 1.03 baseline.

Egg Color Patterns


Air Quality Egg Sensor Shield – HowTo

Posted: December 6th, 2012 | Author: | Filed under: AQE, Nanode | Tags: , , | 1 Comment »

This one is for everyone who only got an Air Quality Egg Egg  Sensor Shield. I wanted to write it as a way of aggregating a bunch of information that is scattered across the interwebs presently. I’m also going to write it from the perspective of a Nanode as the host processor as that’s what I’m most familiar with and that’s what I wrote some code for. Here is the basic idea of how to get up and running quickly.

  1. Send us your MAC address (e.g. 00:04:a1:3c:11:22) from your Nanode to support AT wickeddevice DOT com (you know the drill). We need to register your device with Cosm to fold it into the Air Quality Egg network. If you run the sketch below and look at the serial data output, the MAC address gets printed out for your convenience.
  2. We will respond by email and let you know you’re hooked up on the back end.
  3. Download the software from Git Hub.
  4. Copy everything from the libraries folder to your arduino libraries folder.
  5. Load the AQEBaseSensor sketch onto your Nanode.
  6. Go to http://airqualityegg.com and type in your MAC address .
  7. Enjoy your data!

For people who got full-up Air Quality Eggs, we will have basically done everything up to step 6 for you (with different sketches). I’m completely swamped through December at least… it would be totally amazing if someone from the Air Quality Egg community could port this sketch to Arduino/Wiznet… I think it should be a relatively straightforward exercise.