Methane Sensor¶
Written by Grace Lo & Alina Wang
The methane recording procedure was developed and tested on the Figaro NGM2611-E13 Methane Sensor Module. It is pre-calibrated at controlled humidity and temperature and outputs continuous analog results, ideal for detecting changes. The NGM2611-E13 has been used in previous research, including the original flux chamber prototype. As such, it has a known calibration method and is readily deployable. The data is provided in raw values to reduce compuation on the device and give users the autonomy to post-process as they see fit. It is important to note that the sensor requires approximately 4-6 minutes of warm-up time to stabilize readings after a 90-day period of inactivation (see technical information of the TGS2611-E00. The flux chamber accounts for this by beginning the sequence with airing out the chamber for an extended period of time, which gives time for the sensor elements to warm-up and prepare for measurements. Current lab testing (in absense of varying methane concentrations) has shown values ranging from 300 to 500.
Pin Connections¶

Pin connections from the methane sensor → Pico are as follows:
- VIN (5V) → VBUS (pin 40)
- VOUT → ADC0 (pin 31)
- VREF → ADC_VREF (pin 35)
- VH- → GND
- GND → GND
Code¶
All code is in the CornellFluxChamber Github repository. The code for interfacing with the methane sensor is incorporated into flux_chamber.c
.
Includes¶
The first lines of code in the C source file include header files. Don't forget to link these in the CMakeLists.txt file!
The following files are required to interface with the methane sensor and enable the specified GPIO pin to read continuous analog values instead of binary digital values.
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/adc.h"
Initializations¶
The C source file initializes the analog-to-digital (ADC) converter, making sure to select 1 of 3 ADC inputs (GPIO 26, GPIO 27, or GPIO 28).
adc_init();
adc_gpio_init(26);
adc_select_input(0);
Read¶
The methane sensor module is read using adc_read()
and directly written to the file.