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 are 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 when energizing the sensor after a period of inactivation, the resistance drops significantly causing high voltage readings. However after a moment of recovery, it will stabilize and be ready for data collection. Current lab testing (in absense of varying methane concentrations) has shown values ranging from 25 to 310, with the output generally hovering at approximately 20 to 40.
Pin Connections¶
Breadboarding best practices should be followed.

Pin connections from the methane sensor → Pico are as follows:
- VIN (5V) → VBUS (pin 40)
- VOUT → ADC0 (pin 31)
- VREF → ADC_VREF (pin 35)
- 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/gpio.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.
An example of the data logging to a CSV file is provided below:

Note that our current lab setup does not have the proper equipment to artificially test methane levels.