Public Lab Research note

Smart sensor board for electrochemical gas sensors (intro)

by kensanfran | November 02, 2014 09:38 02 Nov 09:38 | #11315 | #11315

kensanfran was awarded the Empiricism Barnstar by neilh20 for their work in this research note.

A smarter way to use electrochemical gas sensors

Perhaps the most promising near-term technology for accurately detecting many atmospheric pollutant gases within modest cost, power, and size constraints is the electrochemical sensor cell. Recent "echem" sensors from Alphasense in particular (-A4 and -B4 models, for example see CO-B4 datasheet) provide:

  • impressively low noise and sensitivity down to the very low ppb range
  • low cross-sensitivities to other gas species
  • ridiculously linear response across a wide detection range
  • 1% gain accuracy from the factory
  • built-in temperature compensation mechanism that provides an offset error signal on a fourth "Aux" pin

All for less than $100 per unit in volume. Sounds fantastic, right? These are specs that usually match up with a $$$$ benchtop gas analyzer. Except...

How do you get a good signal out of this thing?

And here's the rub. It turns out to be somewhat tricky to actually achieve those specs in a real-world circuit. Not impossible, but it takes a fair amount of analog-type thinking and careful design considerations to make sure various noise and calibration error sources don't creep in and ruin all those sparkly numbers on the sensor's datasheet. I'll get into error budgets and noise sources in future Research Notes, but it's not hard to imagine that any attempt to measure parts per billion of anything requires a perhaps fanatical attention to these sorts of details.

And the sensors turn out to have something of their own personalities as well. Depending on their deployed environment, they may drift in gain and offset over time and temperature, and since they are typically gel-filled electrolytes exposed to air, they can dry out or become more saturated depending on moisture content in atmosphere. Oh well, here we are in the real world, what happened to that shiny datasheet again?

But can't I just buy a circuit board?

Alphasense ISB board with sensor underneath -- photo by Ken McGary

Well, yes, you can. Alphasense sells a high-performance analog board called the ISB (Individual Sensor Board, ~$150USD) that takes full advantage of the B4 sensors. I've been evaluating one here for a while now and it's clearly a well-designed circuit. For example, it includes cleverly placed pin sockets on the blank backside to keep the sensor's noise-sensitive high-impedance lines as short as possible. If you're doing heavy-duty research in the low-ppb regions, you may want some of these in your toolbox.

* An early test recording with the CO-B4/ISB combination shows the ability to sense small changes in carbon monoxide concentration due to heating and ventilation system cycling and other house activities - graph by Ken McGary *

Alphasense also makes a line of 2- to 4-sensor "AFE" boards for their smaller and not quite so sensitive (or expensive) A4 sensors. I'm sure these work great, too, though I haven't tried them.

However, both of these boards have a number of idiosynchrocies for the DIYer and citizen scientist:

  • they are all analog-only, and still require at least good 12-bit if not 16-bit or better analog conversion for use in a digital system
  • the ISB requires an oddball 6V +/- 0.1V power supply
  • ISB and AFE boards are specifically customized and tuned at the factory for each particular sensor model's bias and gain requirements, and must be returned to the factory ($$) for mods or recalibration

To my knowledge (and I've been looking) there aren't any other ready-made board options out there for Alphasense or any other brand of echem sensor. The basic circuit required is a classic potentiostat arrangement, which is nothing much new under the sun -- "clamp" a cell's voltage (keep both "Working" and "Reference" electrodes at the same potential) by controlling the current on a third "Counter" electrode. The current required to keep the cell's specifically-formulated chemistry in balance indicates the amount of reduction or oxidation and thus the level of sensed gas. There are a handful of app notes floating around from several vendors about how to do this properly, and Analog Devices among others does sell an evaluation circuit that is meant for echem cells, however these have similar quirks to the Alphasense units and are tricky to integrate into DIY systems.

Nature Nerds (and Texas Instruments) to the rescue!

I've been collaborating for over a year now with another Nature Nerd Shaun Houlihan (who created some very helpful prototypes) and Peter Sand and Elliot Dicus with Manylabs (who are providing much-appreciated software and other development support) and a handful of other Nature Nerds to try and understand some of the problems with and advantages of these sensors. Shaun actually showed up at his very first Nerds for Nature meeting last year with his initial prototype echem board already in hand -- a cute little PIC-based gizmo with built-in bluetooth link that is still an inspiration for future echem form factors.

* Shaun's PIC-based, BLE-enabled echem sensor board -- photo by Shaun Houlihan *

However, a desire to have the Analog Front End chip on a more generally accessible platform like Arduino or Raspberry Pi led to a second prototype by Shaun in collaboration with our growing Air Quality group, a keep-it-simple breakout board with just the AFE, a fancy yet reasonably-priced 12/16-bit A/D converter (the ADS1115 from TI), and a few supporting parts. This proved remarkably handy in getting some confidence in the performance of the AFE part, and our ability to extract useful sensor data from it (more about this clever TI chip in the next Research Note).

hedlab_air_sensor_pcb_pic_on_keyboard_cropblur.jpg * Shaun's echem AFE breakout board -- photo by Ken McGary *

I've also been doing my own sensor circuit homework and have iterated through a few CAD versions of this new design. The main design goal was to integrate a complete smart sensor system in one small module, with all of the circuitry on one side of the board and the sensor on the other. Why dedicate all of that silicon to one little sensor?

Well, the limitation of the breakout board approach comes down to one word, really, calibration. Since so many sensor and circuit subtleties can affect data quality, it became clear that what was really needed was a complete processor and datalogger system dedicated to each individual sensor. When these are integrated into commercial embedded systems, they are cocooned in an environment that provides for the very specific calibration requirements the application demands. For us folks building a system from scratch, well, that's no help at all. Again, there's a lot more detail to delve into here, so stay tuned.

echem_32_4_15_2014_front1.png * An earlier concept for the smart echem board used an Atmel 32u4 processor with built-in USB port -- CAD image by Ken McGary *

So that's the background, I'll show some initial real world data and detailed info on the circuit and project in upcoming Research Notes. We are about to deploy a few dozen of these as part of a community air quality monitoring project in Louisville, KY, and before long we'll have a small batch available for purchase and are looking for savvy citizen scientists and resourceful researchers and motivated makers to help us give the design a thorough shakedown. And of course I hope to see all kinds of amazing applications being shared here on Public Lab as we bring this project up to speed and some of you start tinkering with them.

Thanks for reading, Ken


Hey fantastic to have a calibrated gas sensor as the starting point. It is essential to the definition of "quality" in any air quality measurement - doing the hardwork to translate the output of a raw sensor to a defined scale. In this blog Kensanfran is discussing the detail of how to do it. I wrote about the value of calibrated scales here - (in the context of air quality and the discussion on the use of uncalibrated AQE sensors)!msg/airqualityegg/9a0GoVzRjLo/fO2lgMYFwOkJ Nice one kensanfran

Reply to this comment...

Nice work! Looks like a clean and well-designed module.
FYI, you can find some more open-source info at with some layouts for low-noise potentiostats, with integrated 18bit (mcp3424) ADCs that can be easily hacked and implemented in any arduino/raspberryPI/beagleboard, etc... environment. I can't recall if files made it into the repo for download; but they are still publicly availabe upon request. Cheers!

Reply to this comment...

Hi Neil,

Thanks for your nice comments. Yes, I think the general issue of data quality from citizen science sensors is finally starting to get the attention it deserves. I am encouraged reading about the latest discussions at the Creative Commons meeting and related blog post on this topic, some good ideas there about certification methods and so on.

I learned early on in my engineering career that if you don't provide a way for a system to be properly calibrated when you design it, then it will never be properly calibrated. So another part of my exercise has been building up various DIY calibration rigs using pre-mixed cal gases and valves and flow sensors and mass flow controllers and so on. I'm still refining and developing and will also be discussing these systems here in future research notes and would love to get feedback from others on how to improve things.

The general idea is to have the calibration rig talk to the sensor board to perform various auto-calibration routines. Yes, the Alphasense sensors are calibrated to within 1% at the factory, but as I mentioned it's never that simple. For example the AFE chip's TIA feedback resistors have a tolerance of 5%. Ooops! So that's another thing to do, figure out how to precisely characterize the board itself and collect metadata that can (mostly) subtract these errors back out of the signal. I have a general plan for all of this but there are still details to sort out.

Reply to this comment...

I just posted a second Research Note on this project which covers basic board information and some initial real-world field data.

Reply to this comment...

Hi @kensanfran

On the threat below you mentioned:

"So another part of my exercise has been building up various DIY calibration rigs using pre-mixed cal gases and valves and flow sensors and mass flow controllers and so on. I'm still refining and developing and will also be discussing these systems here in future research notes and would love to get feedback from others on how to improve things."

Do you have any references you can share on the topic? We are trying to start a project documenting DIY Calibration Methods for AQM Electrochemical sensors and MOS, and we are trying to collect as much references as possible


Is this a question? Click here to post it to the Questions page.

Reply to this comment...


Sorry just noticed this post. I've been collecting my links and references on this DIY gas sensor calibration page of my wiki. I'm also tinkering with some DIY zero air generator ideas, as often the biggest problem is sorting out a sensor baseline that drifts with temperature and so on. Don't need fancy gases for that, but does require some thought and more prototyping before I have much more useful to say about all of that.

I'm curious if you have a public collection of this stuff going already? I'll post again here when I have any major updates.

Thanks, Ken

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

Login to comment.