Close

Ozone and NO2 sensors

A project log for Street Sense

Portable electronic device to measure air and noise pollution

mike-teachmanMike Teachman 02/13/2019 at 22:162 Comments

With the I2S microphone and particulate sensors working well, the next step is integrating the ozone and NO2 sensors.  These sensors are manufactured by Spec Sensor and are used in the Array of Things project in Chicago.  Spec Sensor published a report showing that the Spec Sensor units perform well in side-by-side tests against calibrated industrial-grade sensors.  The credibility of these sensors appears promising. 

I chose the analog module versions for both the ozone and NO2 sensors.  The modules include all the difficult analog amplification and biasing circuitry.  I have little of that skillset - it was an easy decision to purchase units that include the analog sub-circuits.

Each sensor has an analog output, 0-3.0V range, that is proportional to the measurement of gas concentration.  This analog output will be converted to digital using an analog-to-digital converter (ADC) device that will connect to the ESP32 using an I2C bus.  In my parts stock I have the ADS1015 ADC by Texas Instruments.  It has 12-bit resolution and can operate with a 3.3V supply.  I like using ADCs having an I2C communication interface as it allows the ADC to be located in immediate proximity to the sensors  This allows short analog signals runs, thereby reducing coupled noise.  The ESP32 has some built-in ADCs, but reports are not flattering on the performance.  I might use these ESP32 ADCs for non-critical operations like reading battery voltage.

Each sensor module has 3 outputs that can be measured.  Vgas, Vref, and Vtemp.  Vgas is the important one - the analog reading which represents the gas concentration.  It wasn't too clear on how the other two outputs are used.  I contacted the company and got a prompt response.  Spec Sensor indicated that good results can be achieved using only the Vgas output.  The other two outputs are high impedance outputs which are somewhat difficult to use with ADCs.  

I expanded the breadboard prototype to include the two gas sensors and the ADC.  The gas sensors and ADC are shown in the left side of the photo below.  The V03 schematic is up-to-date with these new devices.

The ADS1015 device is quite popular and there is a MicroPython driver available.  Unfortunately, the driver needed some small modifications as the I2C implementation on the Loboris MicroPython port introduces breaking changes compared to the mainline of MicroPython.  It's frustrating when a fork of a project does not maintain backwards compatibility with key interfaces like I2C.  

Two new co-routines were added to the Street Sense MicroPython code to manage the two sensors.  The raw sensor values are displayed on the OLED display and are logged to the SD Card.

What about results?   I observed that the gas values are not as stable as I expected.  I modified the driver configuration to select a slower sampling rate and the values become more stable.  But, still not what I need for the final unit.

From my long 25 year career in measurement at Schneider Electric Victoria I knew that this stage of the project would be toughest to crack.  This is just the first step in what will be an iterative design.  I fully expect to try out a few ADCs, add filter capacitors, and who knows what else -- to get a stable and accurate digital representation that fully exploits the accuracy of these gas sensors.  Perhaps I'll need to seek some help from my ex-colleagues who are unbelievable world-class experts in analog design?

One area that needs work is ADC resolution.  The ADS1015 devices have 12 bits of resolution.  That is good enough for some prototyping, but my calculations show that 12 bits is inadequate for the resolution of the Spec Sensor devices.

The Spec Sensor devices have a resolution better than 20 ppb (ppb = parts-per-billion).  The datasheet of each sensor indicates a formula to calculate V/ppm.  V/ppm is needed to determine the ADC resolution that is needed.  Each sensor is has a factory accuracy constant called a "sensitivity code" that is used in the formula.  For example, the sensitivity code on the NO2 sensor is -22.32, shown below:

Using the manufacturer's formulas I calculated the analog voltage change resulting from a 20ppb change in gas concentration.

The ozone sensor voltage changes by 0.4358 mV for each 20ppb, while the NO2 sensor voltage changes by 0.2228 mV for each 20ppb change.

Looking at the NO2 sensor.  The output range is 0-3V.  The minimum number of ADC steps needs to be 3000 mV/0.2228 mV = 13464 steps.  It is quick to determine that a 12 bit ADC with 4096 steps is not capable of delivering this resolution.

I did some Digikey hunting for an appropriate I2C based ADC and found the ADS1219 device, a 4-channel, 24-Bit resolution ADC.  The price point is below $10 per single unit.  The Applications section of the datasheet even calls out "Gas Detectors" and the device includes buffers that allow connection to high-impedance sources (like the Vref or Vtemp outputs from the gas sensors).  Promising...

The ADC parts were ordered at 8am this morning with delivery estimated for 5pm tomorrow.  Digikey = great customer service (at least in all my experiences ...)

Undoubtedly, lots more to come on this topic !

Discussions

Mike Teachman wrote 02/01/2021 at 03:07 point

Hey!  thanks for the interest in the project.

I don't have a working system with the Spec Sensor projects.  The readings coming from both the NO2 or O3 sensors are unstable.  It is not surprising with my prototype hardware which is built using stripboard.   Sometime this year I plan to make a much improved prototype, built with a custom PCB.  Then I can follow the manufacturers recommended practices for layout.  That should get the device towards a stable reading.

I can see that the Spec Sensor readings change with temperature and humidity.  To be accurate, the readings will need to be compensated for temperature and humidity.  

The whole project is pretty much on hold as the facility that I use for testing and custom PCB fabrication is mostly closed due to covid.

Do you have a HD project for your device?  If so, I'd like to follow it, to learn from your work.

cheers,

Mike

  Are you sure? yes | no

Salman Faris wrote 01/29/2021 at 05:34 point

Thanks for the writeup, I also planning to integrate the Spec CO sensor, did you completed sensor setup and got the stable value you required? Please let me know. Thanks. 

  Are you sure? yes | no