# MiCS-6814 + Raspberry PI 3B+

Hey there!

I’m working in a project to monitoring air quality using a Air Quality 5 click from Mikroelectronika (it has an MiCS-6814 sensor) and a Raspberry Pi 3B+.

I have used the Pimoroni library for enviroplus (https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-enviro-plus) and now I’m reading some values for Oxidising, Reducing and NH3 based in the Gas.py example in the library.

I have some questions about it and I would greatly appreciate if you could help me with that:

The code of the Gas.py example has lines to get the resistance value for each gas as follow:

``````try:
ox = (ox * 56000) / (3.3 - ox)
except ZeroDivisionError:
ox = 0
``````

and the same for other two gases. A question is that “56000” must be modified to get the right resistance values?

on the other hand, I’m reading the 3 resistance values (Ox, Red and NH3) and I’d like to convert that values to ppm for each gas but I can’t find the right expression to do it.

I’m confused if the resistance that I read in the example code is Rs, R0 or (Rs/R0) ratio.

I would highly appreciate if you can give me some information about it.

The project send data by MQTT to Ubidots bus it is working good.

Thank you so much,

Regards,

Cristian Medina
Bogotá, Colombia.

1 Like

Hello Cristian I am Rodrigo.

What a coincidence I am also working in a project with that same sensor in a raspi 4.

I have been trying these days to read the sensor with the pimoroni library but I’m not reading any value. I get an error: 0SError: [Errno 121] Remote I/0 error. I think that is due to the fact that the i2c address for the Air quality 5 is 0x48 instead of the enviro+ that has an i2c address of 0x49. Have you obtained that error? How can I solve it?

With respect to your doubts I can say that the value that you read is Rs. Ro is the resistance read with clean air done in the calibration. Then to transform the Rs/R0 to ppm. you have to use the graphs of the Datasheet. The idea is to calculate the equation of the line and then substitute the Rs/R0 and obtain ppm. There are some codes in github.

I hope it helped.
Looking forward to hearing from you.
Rodrigo.

I fixed it, apart from changing the address I also had to change the alternate address from the library to the default address, that is make it 0x48.

What values more or less do you obtain?

I obtain:
Ox: 65 kOhm
Red: 22kOhm
Nh3: 32kOhm.

The values are very low compared to what people usually obtain in clean air. I don’t know if having the mikroe sensor board instead of the enviro+ makes that big difference.

We could work together and share results if you want. My goal is measure the air of my city and calculate the air quality with data from this sensor. I’m looking therefore to have a high acurracy and I don’t know how could I obtain R0 because I would need air totally clean to observe high differences.

Write me if you want to share knowledge and ideas.
Thanks.

Hello Rodrigo,

sorry for my delay in the response. I am some confused with it too. I don’t know if you could solve your troubles about it.

now I have a code when I read de resistance values, I convert it to PPM and send it by MQTT to Ubidots to finally export it to a google sheet document.

But I think I’m reading bad the resistnce, I changed the “56000” in the library file for each variable but I get values very low.

Please let me know how we could work together in in if you are working in this project yet.

Thank you so much,

Hello, I have been working on this same mikroe sensor, I have had the same doubts that you have had, about the number “56000”, I do not really know why that number is, also the profits that they handle in the enviro + libraries for the ads and the mic6814, it has become clear to me that the result is that of Rs but I don’t know how to calculate precisely Ro, the question of the line is already a little simpler but how should I calibrate this sensor.
Cordial greetings and I look forward to helping each other.