Monitoring Serial Devices using HydraFerret

Enfield Cat's Blog: Arduino and other projects.


Introduction

A gas sensor with a serial interface

HydraFerret allows for up to 2 serial devices to report data to it. NB: This does not disable the console serial terminal. An example of a ze25 ozone sensor with a serial interface is on the right.

Some sensors made by the Winson company all default to a standard protocol which reports data approximatly every 0.9 seconds. These can be defined as as a "winsen" type although they meaure different gasses.

Configuration

Configuration:
serial
serial [0|1] <rx-pin> <tx-pin> [<speed> [<bits>]]
serial [0|1] [disable|pms5003|zh03b|ascii|nmea|winsen|mh-z19c]
    Set up serial port's I/O pins, speed and device type configuration

RPN variables:
    serial.<0-1>.vsta - OK / Warn / Critical / extreme status
  pms5003 and zh03b specific
    serial.<0-1>.coun  - count readings in last average
    serial.<0-1>.pm1   - pm1 ug/m3 estimate
    serial.<0-1>.pm25  - pm2.5 ug/m3 estimate
    serial.<0-1>.pm10  - pm10 ug/m3 estimate
  pms5003 specific
    serial.<0-1>.p003  - estimated count of particles >0.3um per 100ml
    serial.<0-1>.p005  - estimated count of particles >0.5um per 100ml
    serial.<0-1>.p010  - estimated count of particles >1.0um per 100ml
    serial.<0-1>.p025  - estimated count of particles >2.5um per 100ml
    serial.<0-1>.p050  - estimated count of particles >5.0um per 100ml
    serial.<0-1>.p100  - estimated count of particles >10um per 100ml
  nmea specific
    serial.<0-1>.lati  - latitude: positive = North, Negative = South
    serial.<0-1>.long  - longitude: positive = East, Negative = West
    serial.<0-1>.alt   - altitude in meters
  winsen specific
    serial.<0-1>.coun  - count of readings
    serial.<0-1>.val   - 5 minute average of readings
    serial.<0-1>.lasv  - most recent reading
    serial.<0-1>.max   - maximum expected reading value
    serial.<0-1>.unit  - indicator to unit of measure, 3=ppm, 4=ppb
    serial.<0-1>.type  - a numeric product ID

Alerting:
    {warning|critical|extreme} [serial <0-1> var <rpn-expression>]
PEN PAGE
PAGE HEALTH
815 / 1000

Notes:

Devices

NB: Winsen family of sensors is not fully tested, but is expected to work.

IDTypeDescription
ascii Text dumping interface. Just returns the text of data received.
mh-z19c Carbon dioxide measurement. Similar to other Winsen devices, but requires a read request rather than returning an automatic data feed.
nmea Return GPS positioning data. Depending on messages received some data such as co-ordinates are returned in variables.
pms5003 Particle sensor. The "5" refers to the generation of the sensor, so this is expected to work on newer pms6003 and pms7003 devices. The "3" refers to the smallest particale size expected to be detected: 0.3um. The additional VOC, temperature and humitity readings given by the pms5003st are not supported, so that model is not recommeded at this stage.
ze08
ze09
0x17Winsen type, CH2O
ze16b0x04Winsen type, Carbon monoxide: CO
ze25
ze27
0x2aWinsen type, Ozone: O3
zh03b Particle sensor. Similar to pms5003, but only returns ug/m3 estimates.
zp140x01Winsen type, Combustible gas: CH4
zph020x18Winsen type, pm2.5 particle



Thank you for visiting camelthorn.cloudHome