Skip to content

CALIBRATION & detection range

Dr. Takeyuki Ueda edited this page Jan 22, 2019 · 3 revisions

Untested functions

I'm afraid following functions are not tested due to lack of necessary devices and apparatus for test. I'll really appreciate if some kindly person who has necessary stuffs try following functions and tell me the result as a issue report, thank you!

Usage as command

Both Python2 & Python3 are supported.

pi@raspberrypi:~ $ python -m mh_z19 -h
usage: __main__.py [-h] [--abc_on | --abc_off]
                   [--span_point_calibration SPAN_POINT_CALIBRATION]
                   [--zero_point_calibration] [--detection_range_5000]
                   [--detection_range_2000]

return CO2 concentration as object as {"co2": 416}

optional arguments:
  -h, --help            show this help message and exit
  --abc_on              Set ABC functionality on model B as ON.
  --abc_off             Set ABC functionality on model B as OFF.
  --span_point_calibration SPAN_POINT_CALIBRATION
                        Call calibration function with SPAN point
  --zero_point_calibration
                        Call calibration function with ZERO point
  --detection_range_5000
                        Set detection range as 5000
  --detection_range_2000
                        Set detection range as 2000

Without option, mh_z19 measure CO2 concentration and return as JSON string. When one of the above options are specified, measurement doesn't take place, instead just take place a setting about calibration or range acordingly. Just one option is abailable, it will be failed if multi option is set.

Use as python module.

Following functions are available:

abc_on()

The command 0x79 ON/OFF Auto Calibration on the Software Section on the DataSheet. This function set ABC as ON.

abc_off()

The command 0x79 ON/OFF Auto Calibration on the Software Section on the DataSheet. This function set ABC as OFF.

span_point_calibration(span)

The command 0x88 Calibrate Span Point (SPAN) on the Software Section on the DataSheet.

xero_point_calibration()

The command 0x87 Calibrate Span Point (ZERO) on the Software Section on the DataSheet.

detection_range_5000()

The command 0x99 Detection range setting on the Software Section on the DataSheet. This function set range as 5000.

detection_range_2000()

The command 0x99 Detection range setting on the Software Section on the DataSheet. This function set range as 2000.

checksum(array)

Compute the Checksum for the array of int value and return as packed value for unsigned char

You can’t perform that action at this time.