ostaquet / Arduino-MQ131-driver

Arduino driver for gas sensor MQ131 (Ozone / O3)
MIT License
64 stars 19 forks source link

Adjusting time to heat and frequency of sensor reads #26

Closed chazbevo closed 4 years ago

chazbevo commented 4 years ago

I was able to merge sketches for the DHT11 Temperature/Humidity sensor with your sketch for the MQ131 and display the results on an I2C OLED display. I have a question about calibration and sampling.

The sensors will be used in a closet-sized enclosure appox 2m x 3m x 5m used to sterilize work clothes. The sealed room will be filled with high concentrations of ozone for 20-30 minutes. I can control the temperature to around 25 Celcius, but have lesser control over the humidity levels.

Do I need to run the calibrate first so that the settings transfer over the ‘high.concentration’ sketch?

Also, the README.md showed a 80 second time to heat interval. I would like to have Ozone and Temp/Humidity read-outs renewed every 10-15 seconds. Can I leave the sensor heated during the entire 20-30 minute treatment time or is it necessary to turn off the heater circuit periodically?

Would timing changes be made in the ‘read_high_concentration’ sketch by adjusting the delay time in the loop? I'm not sure exactly where to adjust the heating time and sampling times. I'm almost there....thanks!

ostaquet commented 4 years ago

The calibration should be done only in fresh air to be sure you have a calibrated sensor at 0ppm. So, when it is calibrated, I suggest to keep the value in your program or in the EEPROM of the Arduino (you need to store the values received by getTimeToRead()and getR0(), store it on the EEPROM and set it in the driver during the setup()).

It is not a good idea to keep the heater powered all the time because the sensor is semiconductor gas sensor. Basically, the Rs (resistance of the sensor) is changing depending on the gas molecules burned at the surface.

If you keep the heater on all the time, you will never measure anything because the gas molecule will be burned continuously. To have a reliable reading, you have to wait between two samples that the heater is cold again.

As your sealed room has high concentration during 20-30 minutes, I suggest to take a sample every 5 minutes.