1 / 2
Methane Sensor Zigbee Device — image 1
1 / 2

Methane Sensor Zigbee Device

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

The Methane Sensor is a Zigbee device that watches the air for natural gas with an SGX INIR2-ME5% methane sensor.

Rating
0 / 5
Likes
0
Downloads
0
Makes
0
Views
3
Reviews
0

Updated at source:

Model information

Category
Electronics
License
Creative Commons — Attribution — Noncommercial

The Methane Sensor is a Zigbee device that watches the air for natural gas with an SGX Sensortech INIR2-ME5% infrared methane sensor. It reports the methane concentration as a percentage of the lower explosive limit (%LEL) and a Red / Amber / Green level to the coordinator, and shows the same level on three LEDs. The two thresholds behind the level are set from Zigbee2MQTT or Home Assistant and kept on the device. It is meant for a kitchen with a gas stove, mounted high on a wall near the stove, and it has no sounder of its own: alarms are raised by the home automation it reports to.

Warning: This is a hobby device, not a listed gas alarm. It has no sounder, and it depends on the Zigbee network and the home automation behind it to raise an alarm. Where a gas alarm is required, install a listed alarm as well.

Bill of Materials

The Methane Sensor Zigbee Device consists of the following parts:

  • 1x: Seeed Studio XIAO ESP32-C6 (without pin headers, it is soldered flat onto the PCB using its castellated edge pads)

  • 1x: SGX Sensortech INIR2-ME5% Methane Sensor (factory calibrated NDIR sensor, 0-5 %vol = 0-100 %LEL, 20 mm can with five 1.5 mm pins; it is pushed into the receptacles on the PCB and must never be soldered)

  • 5x: Pin Receptacle for 1.14-1.65 mm pins, solder mount, no tail (Mill-Max 9372 series, 3.0 mm head, 3.05 mm long; buy a few spares)

  • 1x: Linear Voltage Regulator 3.3V 600mA (SMD, SOT-23-5)

  • 2x: Ceramic Capacitor 10µF 16V X5R (SMD, 0805)

  • 2x: Thick Film Resistor 2.7kΩ 1% 1/8W (SMD, 0805)

  • 1x: Thick Film Resistor 330Ω 1% 1/8W (SMD, 0805)

  • 1x: LED (Red, 5mm, Diffused, Low Current)

  • 1x: LED (Yellow/Amber, 5mm, Diffused)

  • 1x: LED (Green, 5mm, Diffused)

  • 4x: M2.2x13mm Flathead Screw

  • 2x: 3D Printed Parts

    • Methane_Base.3mf

    • Methane_Cover.3mf / Methane_Cover_Handles.3mf (wall mount version)

  • 1x: Custom PCB

    • Methane_Sensor_Gerbers.zip

  • 1x: USB-C Power Adapter (5V, 1A or more) with a USB-C cable (2m or shorter)

Before assembling the device, make sure you have all the required parts, including the 3D-printed parts and the custom PCB.

For more information on ordering a custom PCB, see Order Custom PCB. The board is 60 x 34 mm with four M2 mounting holes (2.2 mm), 3.5 mm in from each corner, the same outline as the Carbon Dioxide Sensor board.

The INIR2-ME5% is the one expensive part of the device. Check its price and stock before ordering the rest; the receptacles are the only other part that is specific to it.

Assembly Instructions

Here are the device assembly instructions:

  • Carrier Board: Solder each component onto the Custom PCB according to the Methane Sensor Assembly.pdf diagram. The PCB components are:

    • R1, R2 Thick Film Resistors (2.7kΩ, 0805, marked 2701): RC0805FR-072K7L

    • R3 Thick Film Resistor (330Ω, 0805, marked 3300): RC0805FR-07330RL

    • C1, C2 Ceramic Capacitors (10µF, 0805): CC0805KRX5R7BB106

    • U2 Linear Voltage Regulator (3.3V, SOT-23-5): AP2112K-3.3TRG1

    • D1 Red LED: WP7113LSURDK

    • D2 Amber LED: WP7113SYD

    • D3 Green LED: 151051VS04000

    • S1 Pin Receptacles (5x): 9372-0-15-15-23-27-10-0

    • XIAO ESP32-C6

    • INIR2-ME5% Methane Sensor (pushed into S1, not soldered)

First, solder the five 0805 parts (R1-R3, C1, C2) and U2 onto the top side of the Custom PCB: tin one pad, slide the part in while the solder is molten, then solder the other end (the other four legs for U2). The resistors carry their value code on top; the capacitors are unmarked. All six sit in the strip along the top edge of the board, between the resistors' row and the right mounting hole; nothing but copper may sit inside the 20 mm circle printed around S1, because the sensor can rests only 0.3 mm above the board. Next, place the XIAO ESP32-C6 flat on the top side with its USB-C connector over the left edge of the board, so that the connector face ends flush with the board edge, and solder its 14 castellated edge pads (the PCB pads reach past the module edge and under its holes, so each joint can be soldered along the castellation or through the hole from the top). Then solder the LEDs: the cover carries a tube above each LED position, so set the cover over the board, push each LED up its tube until its flange stops (its dome is then flush with the cover, on about 11 mm of lead) and solder it in that position. Solder the five receptacles last.

  • S1 Pin Receptacles: Drop each receptacle into one of the five holes inside the circle from the top side, head up, so that its 3 mm head rests flat on the pad and its shell sticks out about 1 mm below the board. Hold the heads down with a strip of tape, turn the board over and solder each shell where it leaves the hole, feeding solder until the hole is filled. Check from the top that every head lies flat: a receptacle that stands at an angle will fight the sensor pins.

  • Warning: The following components require a specific orientation. Detailed instructions on how to position them on the board are provided in Methane Sensor Board Polarity.pdf.

    • D1-D3 LEDs (short leg in the square pad, the upper one of each pair)

    • XIAO ESP32-C6 (flat on the board, USB-C over the left edge, its D0 pad at the pad marked D0)

    • U2 Voltage Regulator (three legs toward the left, two legs toward C2 on the right)

    • INIR2-ME5% Methane Sensor (pin 1, TXD, at the dot marked 1 above the circle; the five pins form an irregular pattern and fit the receptacles in one position only)

  • INIR2-ME5% Methane Sensor: Fit the sensor only after all soldering is done and the board has cooled. Hold it by its can, never by the pins and never on the white mesh on top, turn it so that its pin 1 (TXD, printed next to the pin on the sensor's underside and next to the receptacle on the board) points at the dot marked 1, lower all five pins into the receptacles and press down evenly on the rim of the can until it rests on the receptacle heads. The pins slide in with firm, even pressure; if the sensor does not go in, lift it off, check the orientation and try again rather than forcing it. The sensor stays on the board; pull it only with the device unplugged, straight up and by the can.

The sensor must never be soldered, heated or dropped: SGX voids its warranty for soldered pins, and the infrared source inside does not like shocks. Keep the board away from solvent vapours and silicone sprays once the sensor is fitted.

  • Enclosure: Set the Carrier Board, with the sensor fitted, onto the four standoffs of Methane_Base.3mf. Lower Methane_Cover.3mf (or Methane_Cover_Handles.3mf) straight down over it, so that the collar under the air window slips over the top of the sensor can, the LEDs enter their tubes and the USB-C connector sits in the slot in the end wall, and fasten it from below with the four M2.2x13mm Flathead Screw through the countersunk holes in the base.

The screws cut their own thread in the printed plastic: drive them until the head seats and no further.

Print Methane_Base.3mf as modelled and the covers upside down, with the top plate on the print bed, so that the walls, bosses, collar and LED tubes print without supports. The base has 5.8 mm standoffs; which leave room for the sensor pins, which reach about 3 mm below the board. The cover is 6 mm taller than the CO2 one for the 17 mm sensor can; it has a 16 mm round air window over the can's gas inlet, a collar that locates the can under it, and three vent slots in the short wall opposite the USB-C connector, the top wall when the device hangs on a wall with the cable down, where lighter-than-air gas collects first.

  • Power on the device by plugging the USB-C Power Adapter into the XIAO ESP32-C6 through the slot in the cover.

The sensor needs about a minute after power-up before its readings count and up to 45 minutes before they are fully accurate; the amber LED blinks during the first minute. Keep the air window clear and never poke anything through it: the sensor's mesh sits right under it.

Figure 1 (Device)

Figure 2 (Device)

Device Software

  • Flash Device Software: Flash the prebuilt firmware in the Methane_Sensor_Binaries.zip archive to the XIAO ESP32-C6 with esptool (pip install esptool). Connect the XIAO with the USB-C cable and run the following command from inside the folder (on Windows the port is a COM port):

python -m esptool --chip esp32c6 --port /dev/ttyACM0 --baud 460800 --before default-reset --after hard-reset write-flash @flash_args

Extract all files from the Methane_Sensor_Binaries.zip archive to a local folder and rename all *.bin.data files to *.bin.

If esptool cannot connect, hold the XIAO's BOOT button while plugging in the cable, then run the command again. The XIAO ESP32-C6 can be flashed before or after it is soldered to the Carrier Board.

  • Zigbee2MQTT: Use the Methane_Sensor.mjs external converter in Zigbee2MQTT.

  • Home Assistant (ZHA): Use the Methane_Sensor.py quirk (quirks v2) in the Zigbee Home Automation integration. Copy the file into the custom quirks folder set with custom_quirks_path in the zha section of configuration.yaml, restart Home Assistant, and then pair the device.

Rename both Methane_Sensor.mjs.txt to Methane_Sensor.mjs and Methane_Sensor.py.txt to Methane_Sensor.py.

The quirk is written for Home Assistant 2026.8 or later. In Home Assistant the entities are named Methane, Gas, Level, Amber threshold, Red threshold, Automatic zero and Forced zero, whether the device is connected through ZHA or through Zigbee2MQTT. In the Zigbee2MQTT device page the values appear as methane, gas, level, threshold_amber, threshold_red, zero_automatic and zero_forced.

Device Usage

  • Connect Device to Zigbee Network: After flashing the software, power on the device to start the connection process. In Zigbee2MQTT, select Permit Join to allow the device to connect to the Zigbee network. The XIAO's built-in LED blinks until the connection completes, then turns off. If you need to reconnect the device, open the cover and press and hold the BOOT button for more than 3 seconds; this also restores the default settings.

  • Placement: Natural gas is lighter than air, so mount the device high: on the wall with its top within 30 cm (12 in) of the ceiling, between 1 and 3 m (3 to 10 ft) sideways from the stove, and away from doorways, windows and the air stream of vents and range hoods, which would dilute the gas before it reaches the sensor. This follows the placement rules of NFPA 715 for natural gas detectors. Route the USB-C cable down to the outlet; a 2 m cable is fine.

  • Warm-Up: For the first minute after power-up the amber LED blinks and the level reads Warmup while the sensor's infrared source settles. The reading keeps improving for about 45 minutes as the sensor reaches room temperature.

  • Readings: The device reports the Methane concentration in %LEL (percent of the lower explosive limit; 100 %LEL is 5 % methane by volume, and 1 %LEL is 500 ppm), a Gas alarm that is on while the level is Red, and a Level (Green, Amber, Red, Warmup or Fault), on change and at least once a minute. The green, amber and red LEDs show the level. Clean indoor air reads 0 %LEL; a burner that is turned on without lighting shows up within half a minute.

  • Thresholds: Set the Amber threshold and the Red threshold (in %LEL, 1 to 50) from Zigbee2MQTT or Home Assistant. The level turns Amber at or above the amber threshold and Red at or above the red threshold, and drops back only 1 %LEL below each threshold so that it does not flicker. The device keeps the thresholds across power cycles and firmware updates; the defaults are 5 and 10 %LEL. Residential gas alarms built to UL 1484 trip at 10 %LEL or less, which is where the default red threshold sits.

  • Zero: The sensor is factory calibrated and keeps its span for years, but its zero point drifts slightly with air pressure and temperature. With Automatic zero on (the default) the device takes the lowest minute average of the last 24 hours as clean air and subtracts it from the readings, as long as that offset stays below 2.5 %LEL; it never changes the sensor's own calibration, and it is safe because a kitchen never holds methane for a whole day. Switch it off where that assumption fails and zero by hand instead: put the powered device into clean air for at least 5 minutes and switch Forced zero on; the device zeroes the sensor and the switch turns itself off again. A forced zero also restarts the automatic zero's 24-hour window.

  • Fault: A blinking red LED and the level Fault mean the device gets no valid frames from the sensor for 10 seconds, or the sensor reports a fault of its own. The device log on the USB-C port names the cause. The sensor sends nothing points to the sensor's power or seating: check that it sits flat on the receptacles with its pin 1 at the dot and that all five receptacles are soldered; the message also says whether the sensor's analog output is present or at 0 V, which tells a seated but unpowered sensor from a silent one. The sensor sends no valid frame shows the bytes received and means the sensor's serial settings differ from the factory setting the firmware expects (38400 baud, 8 data bits, 1 stop bit, no parity), for example after the sensor was reconfigured with SGX's evaluation software. The sensor reports an error names the part of the sensor that fails. The level returns to Warmup and then Green by itself once valid frames arrive again.

  • Identify: Identify from Zigbee2MQTT or Home Assistant chases the three LEDs for the requested time.

The device is a Zigbee router: it relays traffic for other devices and should stay plugged in.

Tags