Today is daylight savings.  Unfortunately, the RTC doesn’t know this and now the time is off by one hour.

Good better best The Leaf Spa needs to accommodate Daylight Savings.  How I’ll do this is TBD.

 

A Different CO2 Sensor

I recently received two Winsen MH-Z19 NDIR CO2 sensors I ordered from Alibaba.

I am exploring a different CO2 sensor because:

  • The cost is less (I paid $22 for one).
  • The interface to the micro controller does not rely on the UART.  As noted in diy_bloke’s Instructable: The MH-Z19 has 3 ways of reading the CO2 concentration. It has a Tx/Rx UART, It has an analog output and it has a PWM input.  I’m hoping this will make it possible to use with microPython on the esp8266 enabled board.

The data sheet is located here.  Here is an image of the layout:

NewImage

NewImage

According to the diagram, the pins 2 and 3 are for UART readings and pin 9 is for PWM readings.

Testing the Board

I used the information provided in this stack exchange to write an Arduino sketch (GitHub location).  Here are results from running the sketch within my work area:

Test 1
th: 166
tl: 838
2000ppm Concentration limit: 328
5000ppm Concentration limit: 820
—————————————
Test 2
th: 166888
tl: 830489
2000ppm Concentration limit: 331
5000ppm Concentration limit: 829
—————————————
Test 1
th: 166
tl: 838
2000ppm Concentration limit: 328
5000ppm Concentration limit: 820
—————————————
Test 2
th: 167489
tl: 829888
2000ppm Concentration limit: 333
5000ppm Concentration limit: 833

I then ran the tests with the sensor inside the Leaf Spa:

NewImage

Drat…i forgot to capture the results.  Tests 1 and 2 were within error range of each other.  The results were ~ 150ppm lower than the MH-Z16 sensor.  BUT I have not calibrated the MH-Z19.  I want to do that when I get back from vacation.  Note: the MH-Z19 can be read through PWM, however calibration happens through the UART.  Not a big deal…but does point out that not all functionality can be handled through digital i/o. 

My thoughts based on this initial investigation of the MH-Z19 is it is “the best” choice to be the CO2 sensor for the Leaf Spa because:

  • less expensive than the MH-Z16 with enough accuracy.
  • does not need UART to read CO2 data.
  • it is an NDIR CO2 sensor, so it is measuring CO2 instead of estimating – which is what the CCS-811as a VOC sensor does (see wminark’s comment on this blog post).
  • It is more readily available than the CCS-811.  I put an order in for a few CCS-811’s on Digikey months ago…the current estimate is a few weeks from now.  However, that date has changed before.  Perhaps if I was buying in the bulk amounts a cell phone manufacturer needs…but at the small quantities I need, I don’t feel comfortable with my ability to source the CCS-811.

Learning about the MH-Z19 was awesomely fun and useful.  I am excited to try the Leaf Spa firmware using micro python and the ESP8266…!

 

Advertisements