Is anyone successfully using the MICS6814 Breakout?
I’ve got it hooked up to a NodeMCU/ESP2866 (after many hours of stumbling around with code - thank god for Chris’s Arduino port of IOExpander)
However, my resistances don’t seem right compared to what others are reporting on their Enviro+
The breakout says 3-5v compatible, not sure how that works, doesn’t the sensor heaters require specific voltages? I have it on 3.3v currently.
My current reported resistances (using the formula r = (r * 56000/)(vadc - r) which I assume is correct as the PCB seems to have 3 56K resistors for the reading circuitry:
Which seems to be reversed for what others report where Oxidising is typically the lowest and Reducing the highest. That would tie in with the sensor spec sheet.
Both my Oxidising and Reducing are outside the ranges the Spec Sheets says you should see at 23c 50% Hum, which is roughly what my room is at.
At the end of the day it won’t matter if the sensor is still sensitive to gas and I start to calculate a ratio to R0.
I’m currently running it with a BME280 to get some data to run regressions analysis to compensate for Temp/Hum/Baro based on the great work that @Roscoe27 has done.
Still need to get my head around that and how best to get calibration values with ESPHome/Home Assistant.
But first I wanted to check my sensor is running right.
The breakout says 3-5v compatible, not sure how that works, doesn’t the sensor heaters require specific voltages? I have it on 3.3v currently.
So the breakout board is 3-5v compatible, different microcontrollers/SBCs run at different voltages. The breakouts have a voltage regulator so it can be used with either, but it is probably running at 3v3.
My current reported resistances (using the formula r = (r * 56000/)(vadc - r)
At a glance at the library, it seems to already do that calculation before returning it to you?
Ahh cool, good to know about the voltage regulator.
I’m not using the Python library as I have it connected to an ESP2866 which is best done in C++
However I translated as best I could, and all the heavy lifting had been done by the port over of the IOExpander library (for the Microcontroller/ADC on the breakout).
But yes, I used whatever was in the Python library in my C++ one.
So I have just had a big dip in the Oxidising Sensor and the other sensors showed nothing so one might assume this was gas that triggered it.
However shouldn’t the Oxidising Sensor resistance increase in the presence of gas?
The Reducing and NH3 would decrease resistance in the presence of gas.
One scenario that fits here is that the Oxidising and Reducing sensors are actually ‘swapped’.
Then also my observations are in line with the sensor spec sheet.
You’ll see in my code above that I have the Pin Numbers for the MS51 IO Expander taken from the Python MICS6814 library (both the MICS6814 library itself and from the MICS6814 ‘example’ in the IO Expander Github repo). Are we sure these are correct?
I can’t compare to the Enviro+ implementation of the MICS6814 as that uses a different ADC.
Ah, sorry, I didn’t catch that you’d rolled your own library. Honestly, I’ve no idea, and you might be better off pinging Pimoroni’s support email (support[at]pimoroni[.com]) or opening an issue on their Github, unfortunately the staff aren’t very active here. It’s hard to tell what orientation the sensor is in and where it connects to the uC because the orientation dot seems to be on the back which is, uh, an interesting approach.
Here’s a schematic for the breakout - indeed it looks like RED and OX pins have been swapped in our library, I’ll get that fixed. Thanks for letting us know! :)
I’ve just started using Arduino, and I’ve been trying to get the Pimoroni MICS6814 breakout working with an ESP8266 (Wemos D1 MINI). I’ve tried all the libraries for this sensor in the Arduino IDE, and a couple of others I found on GitHub, but with no success - I only ever see sensor readings of -1.0.
It looks like you had some success? Please could you point me to the IO expander port you mention? Could I simply use your ported library above?
Here is the Arduino port for the IOExpander that the MICS6814 uses:
I must admit I didn’t do much with this though it is still churning out raw numbers.
Need to get around to using R0 values to get a ratio to calculate PPM and also factor in Temp/Hum/Pressure offsets as well. I did try some regression analysis to calculate those but it wasn’t entirely successful.
I’m using ESPHome but i’m happy to send over the libs I cobbled together, shouldn’t be too difficult to adapt to Arduino.
Thanks a lot. I’ll take anything you’ve got, and perhaps we can try working on this together (although it has been a couple of decades since I wrote much C++)? I’ve been adapting an AirGradient sensor, and have extended it with a BME280 so have the pressure, temperature and humidity values available to apply offsets.
Hi, sorry, real life got in the way and I haven’t had time to look at this since @paulrickwood provided me with his files and info. I hope to get back to it at some point though. And I’ll be sure to post here when I’ve got something working.
I’m trying to get this Pimoroni sensor working with an ESP32 in Home Assistant. Do you mind sharing your code? I will certainly contibute back if I have something useful to add.
Unfortunately I have never worked with Arduino.
You can probably adapt what I have or there seems to be some Grove/Seed MICS6814 Arduino libraries out there you could also adapt to this implementation.
I only cobbled this together from the work of others… I don’t really know what I am doing and it is a steep learning curve for me!
I patched Chris’ IO Expander library to add support for the MIC6814 (and opened a PR against the original repo). I’ve included examples for both ESPHome (this example includes control of the heater and RGB LED) and Arduino sketch in the repo.