Wiki

Technical reference for system integrators and engineers.

Gas Sensors

Methane and carbon monoxide measurement for underground mining, read over Modbus RTU and reported alongside position.

Gas sensing is specific to the Smart Lamp Locator and to underground mining use cases. No other device model in the line carries it.

Sensor options

Which sensors are fitted is recorded in the SL_CONFIG characteristic (0x8308) at manufacture, and it determines which keys appear in messages. Pressure and temperature are packaged with the gas options rather than being independent:

SL_CONFIGFittedKeys reported
0none
1methaneMethane, MethaneALM
2COCO, COALM
3methane + COall four
4methane + pressure + temperatureMethane, MethaneALM, Pressure, LocatorTemp
5CO + pressure + temperatureCO, COALM, Pressure, LocatorTemp
Read SL_CONFIG rather than inferring capability from traffic. An absent key means no sensor fitted, which is not the same as a zero reading — and the two call for opposite responses.

Value encoding

The two gases are scaled differently and neither carries its unit in the message:

KeyFormatUnit
Methanedecimal, two placespercent by volume
COinteger, no decimalsppm
Pressureintegerpascals
LocatorTempdecimal, one placedegrees Celsius

A reading is not always a number

When a sensor does not answer, the device emits the JSON string "-.--" where the numeric value would be:
"Methane": 1.35     sensor answering
"Methane": "-.--"   sensor not answering
A parser that assumes a numeric type fails on exactly the messages that matter most. Check the type before converting, and treat the string form as no reading rather than as zero.

Substituting zero would be worse than failing: zero is a perfectly plausible gas concentration, so a silent sensor would look like clean air.

Status words

MethaneALM and COALM are the sensor's raw status word, passed through from the Modbus RTU register unchanged. It is not a boolean, and it is split by byte:

Status word — 16 bits sensor health high byte — bits 15–8 unused bits 7–1 exceeded bit 0 Decoding value & 1 → threshold exceeded value >> 8 → sensor health code A warming-up or uncalibrated sensor carries a non-zero high byte while its threshold state is perfectly normal — which is why comparing the whole word to 1 does not work.
Test bit 0 for the alarm and read the high byte for sensor health. The two are independent facts.

Health codes

High byteMeaning
0OK
1Zero point not set
2Not calibrated
3Low sensitivity
4Malfunction
16Warming up

A status word of 0x1100 is the not-ready state that accompanies a "-.--" reading. Health and threshold being separate is what lets an operator distinguish the air is dangerous from the instrument cannot currently tell you — and those call for different responses.

How alarms reach the server

Gas readings appear in two places, and they are not redundant:

TopicCarriesWhen
/RTLSthe reading — Methane, COroutine position reporting
/OutSosreading and status words and SOSan alarm has been raised
The alarm status words appear only on /OutSos. A routine position message carries the concentration but not MethaneALM or COALM. A backend watching only /RTLS sees gas levels rise but never sees the device declare a threshold breach.

The alarm message is a position report with the readings attached, so an operator receives where, what and how bad as one message rather than having to correlate a position with a separate alarm. See MQTT for the full payload.

Reaching the sensors

The gas sensors are not parts on the RTLS module's own board. They belong to the cap lamp controller, and their readings reach the module over the internal Modbus RTU bus — the lamp writes them into the module's registers, and the module forwards them to the server:

Modbus registerBecomes
1Methane
2MethaneALM
3CO — or LocatorTemp, depending on the fitted option
4COALM
9, 10Pressure — high and low words

Two consequences follow from that topology. The fitted-option matrix is a manufacturing choice rather than a firmware one, because it describes what is wired to the lamp. And the status word is passed through exactly as the sensor reports it rather than being reduced to a flag — the module is a courier here, not an interpreter.

Register 3 is dual-purpose. It carries CO concentration on a CO build and temperature on a methane-pressure-temperature build, so a decoder must know SL_CONFIG before reading it. Alarm thresholds live on the bus too, at registers 5 and 6, and are not forwarded to MQTT — read them over Modbus if an integration needs to know what the trip points are.

The Smart Lamp Locator page covers the surrounding behaviour — SOS, acknowledgement and two-way messaging to the lamp display.

Related

  • Modbus RTU — the bus these readings arrive on, with the full register map.
  • Smart Lamp Locator — the only device that carries these sensors.
  • MQTT — payloads for /RTLS and /OutSos.
  • Sensor TLV Protocol — the record envelope used by the other sensors on the line.