Enviro+ / Ohms to PPM

Hi there,

have my Enviro+ up and running and set up a custom .py to read values and send them to MQTT. From there on I further use the values in openHAB (Smarthome).

My question is about the Enviro+’ MICS6814 sensor. Right now it reads…

  • 566 kOhm redu
  • 25k kOhm oxid
  • 369 kOhm NH3

Is there a chance to convert these resistances to PPM? I’ve stumbled upon a data-sheet (https://www.mouser.fi/datasheet/2/18/1143_Datasheet-MiCS-6814-rev-8-1144828.pdf) where there are diagrams for RS/R0 over PPM, but the RED sensor diagram only reaches to 10.00 kOhm on Y-axis.

Many thanks in advance!

The gas sensors seem to be totally dependent on air temperature, pressure and humidity so I can’t see how anything accurate can be read from them. I have two boards. On in my garage near Manchester current reads as follows:

This is in my lounge in Tenerife:

Ignore the flat section where my RPI crashed.

Hi @nophead, thanks for your reply.

I don’t have any issues with sensor data, just wanted to know if someone here managed to convert the Ohm’s to PPM.

Have a nice & KR!

@nophead what did you use to graph the data from the Enviro+?

It is code I wrote myself and published here: https://github.com/nophead/EnviroPlusWeb


Nice! It will be this week’s project to see if I can make it play with luftdatden.py

I’ve managed to convert the ohms readings from the gas sensors to ppm using the following algorithms.

red_in_ppm = math.pow(10, -1.25 * math.log10(red_rs/red_r0) + 0.64)

oxi_in_ppm = math.pow(10, math.log10(oxi_rs/oxi_r0) - 0.8129)

nh3_in_ppm = math.pow(10, -1.8 * math.log10(nh3_rs/nh3_r0) - 0.163)

Where each respective rs/r0 is the current reading in ohms divided by the baseline air reading in ohms. They therefore require an r0 calibration measurement to be made upon startup and after a 100 minute warmup period.
They’re embedded in the code here: https://github.com/roscoe81/enviro-monitor

That code also includes some temperature, humidity and air pressure compensation of the gas sensors.

Hope that’s of value to others on this thread.

Dear Roscoe,

I appreciate if you could help me:

I’m developing a project based in the gas.py example of the enviroplus library. I’d like to know if the resistance value that the code gives is the Rs, R0 or Rs/R0 ratio.

on the other hand, could you advise me about the calibration you mentioned, I’d like to get measurements in ppm.

Thank you so much,

Hi Christian. That code will give you Rs. You can get R0 by measuring Rs in clean air and then Rs/R0 can be applied to the formulae to get approximate ppm values. I found it best to take an R0 measurement after the 100 minute sensor warmup period has been completed and you need to check that the air is clean at that time. Because of the need for clean air and the fact that each sensor responds to multiple gases, the ppm readings are just an approximation and won’t be highly accurate but their much more useful that just reporting Rs. My code on GitHub at https://github.com/roscoe81/enviro-monitor/blob/master/Northcliff_AQI_Monitor_Gen.py can show you how I did it. I’m still working on improving the gan sensor calibration algorithms.

Really love your programs Roscoe! I made some modifications to get a more thorough ‘Gases’ webpage on a free Adafruit IO account by adding a 5th ‘package’. See my page at IO - Adafruit
Happy to share the code if you’d like (but haven’t got confidence to do so on GitHub directly - I’ve never used it!).
I was wondering why your example ‘Basic’ packages were so bare? Maybe there has been a change at Adfruit’s end as you are now allowed 10 Feeds and up to 5 dashboards on a free account, and that opens up more possibilities.

Thanks for the feedback @ExperiMentor and I’m glad that you’ve found the code useful. Nice work on your Adafruit IO changes. I limited the basic package options because I understood that there was a limit of 5 feeds with the free version of Adafruit IO at the time I wrote the code. Glad that it’s now increased to ten!

Hi Ross,

I try your code (GitHub - roscoe81/enviro-monitor: An environment monitor based on a Raspberry Pi Zero W, a Pimoroni Enviro+ and a Plantower air quality sensor to monitor, display and report on air particles, gases, temperature, humidity, noise and air pressure.) but I have a pb with Astral and Python.
What version (Python and astral) do you use?

Thank a lot for your work.


Hi Julien,

I’m using Python 3.7.3 and Astral 2.1

Hi Ross,

Thank a lot, I upgrade my Raspbian Stretch to Buster.

Best Regards.


Hi Ross,

Thanks you, this works perfectly with Buster.


I haved an error when I activated sound :

Traceback (most recent call last):

  • File “/home/pi/enviro-monitor-master/Northcliff_AQI_Monitor_Gen.py”, line 2102, in *
  • noise_stream = sd.InputStream(samplerate=noise_sample_rate, channels=1, blocksize = noise_block_size, device = “dmic_sv”, callback=process_noise_frames)*
  • File “/usr/local/lib/python3.7/dist-packages/sounddevice.py”, line 1382, in init*
  • *_remove_self(locals()))
  • File “/usr/local/lib/python3.7/dist-packages/sounddevice.py”, line 778, in init*
  • extra_settings, samplerate)*
  • File “/usr/local/lib/python3.7/dist-packages/sounddevice.py”, line 2570, in _get_stream_parameters*
  • device = _get_device_id(device, kind, raise_on_error=True)*
  • File “/usr/local/lib/python3.7/dist-packages/sounddevice.py”, line 2706, in _get_device_id*
  • 'No ’ + kind + ’ device matching ’ + repr(id_or_query_string))*
    *ValueError: No input device matching ‘dmic_sv’

I just change line 2102 “dmic_sv” by “adau7002” and it’s works !!

Thank a lot.