Showing posts with label MQ-4. Show all posts
Showing posts with label MQ-4. Show all posts

13 July 2025

Upgrades to the Greenhouse Gas Monitor

๐Ÿ”˜Our "Greenhouse Gas Monitoring System" measures the concentrations ( in parts per million, ppm ) of two potent greenhouse gases present in the atmosphere, Carbon Dioxide and Methane. The last upgrade added a webserver and embedded webpage ( ๐Ÿ“…see 01.12.2024 ). 
The upgrade described here has replaced the original AJAX/HTTP webserver with a 'Websockets' server also incorporating a redesigned webpage, having more features and an attractive appearance; ( image below, click to enlarge ).
Webpage: gas-sensors-v2.html
The new features include displaying the WiFi signal level ๐Ÿ“ถto assist in choosing the location of the sensors, time-stamp provided by an NTP server, and a bar-chart ๐Ÿ“Šshowing the recent history of the gas concentration measurements, updated in real-time every ๐Ÿ•ž15 seconds.
Extensive use of graphics and images has contributed to the modern appearance of the new page design. The page's background image shows the outdoor unit which contains the two sensors; seen exposed to the atmosphere along the lower edge. The 'emojis' * which were included in the page design show some of the causes and consequences of these gases.๐Ÿ”˜

NTP = Network Time Protocol.
* Emojis appear similar to images and icons but are characters from the UTF-8 character set.

01 December 2024

Webserver for the Greenhouse Gas Sensors

๐Ÿ”˜ Carbon Dioxide, CO2, and Methane, CH4, are present in the atmosphere in part due to burning fossil fuels ๐Ÿญ, and farming ๐Ÿ‚( particularly livestock ). They are potent 'greenhouse' gases as they have a significant impact on global warming, which drives climate change.

A new WiFi version of the Greenhouse Gas Monitoring System, ( ๐Ÿ“…28.07.2022, 5.01.2023 & 18.02.2024 ) has been completed, incorporating a web ๐Ÿ•ธ server having an embedded webpage. The firmware and webpage were developed along very similar lines to that used recently with the "Solarometer" ๐Ÿ”…( ๐Ÿ“…13.10.2024 ); the latter using html and CSS *.
However, as the outdoor location of the gas sensors, ( type MQ-4 for CH4, type MQ-135 for CO2 ), will always be within the coverage area of an existing WiFi network access point, ( AP ), the system has been configured as a station ( STA ) on that network, and assigned the IP address 192.168.1.49.
Webpage opened in a smart phone's browser

The concentration ( parts per million, ppm ) measurements๐Ÿ“ are updated in real-time ๐Ÿ•”, and can be quickly viewed on a mobile device's๐Ÿ– browser, saving time over logging in to cloud ☁ based repositories, if historical data are not required.

Another way is to use the new SpacerLabs custom App "Greenhouse_Gas_Viewer v1.nn", for Android devices.

Displaying ppm measurements using the App
In this case the webpage itself ( /root directory ) is not displayed. Only the sub-directories ( /CH4ppm & /CO2ppm ), which are the place-holders for the CH4 and CO2 concentration data, are read by the App and the data held therein displayed.๐Ÿ”˜

* CSS = Cascading Style Sheets - used to add style attributes to an html document.

18 February 2024

๐ŸญGreenhouse Gas Monitor - Real Time Data

ThingSpeak Embedded Plot        ๐Ÿ”˜The SpacerLabs "Greenhouse Gas Monitoring System" ๐ŸŸฉ was described on 28.07.2022 & 05.01.2023 ๐Ÿ—“. Periodically since then it has been used to measure the outdoor concentrations of two potent green-house gases, Methane and Carbon Dioxide, in close proximity to "Spacerowa Laboratories" at 3m above ground level.  Methane ( CH4 ) and Carbon Dioxide ( CO2 ) concentration data in parts per million are now downloaded here every 15 minutes from the SpacerLabs Greenhouse Gas Monitor channel on ThingSpeak cloud ☁ for IoT sensor projects.

It has been noticed that increased concentration of methane coincides with wet weather conditions and vice-versa. According to NASA data, atmospheric concentration of CO2 was 416ppm in 2021, and CH4 was 1.8922ppm in 2020.
Lower left MQ-4 sensor, lower right MQ-135 sensor
The image above shows the outdoor part of the system with the two gas sensors, MQ-4 ( methane ) and MQ-135 ( carbon dioxide ), mounted in a weather-proof junction box,  ( cover removed ).
The blue trim-pot on each sensor breakout board can be used to set a concentration threshold level to trigger an alarm ⏰ and illuminate ๐Ÿ’ก a LED ( just visible in the image ). Although active, the alarm condition is currently not being extended back to the micro-controller situated indoors for processing. ๐Ÿ”ฒ
 

28 July 2022

Greenhouse Gas Monitoring System

Methane, CH4, and Carbon Dioxide, CO2, are two prominent "greenhouse" gases which have an impact on global warming.
A Methane sensor, type MQ-4, and a Carbon Dioxide sensor, type MQ-135, together with an ESP32 microcontroller are being used to measure the concentration ( in parts per million/billion ppm/ppb ) of these gases in the atmosphere. Measurements are sent every 15 minutes to cloud hosted repositories, ( "thingspeak.com" and "ubidots.com" ), for display and analysis.
Prototype system during development, left MQ-4, right MQ-135
Only the sensors are deployed outdoors, in a protective enclosure. The microcontroller is situated indoors for reliable WiFi connectivity and convenience when uploading the software.
Sensors deployed outdoors
A channel having public access is available for viewing the data on ThingSpeak. Search for channels belonging to user ID "spacerlabs". Select "Greenhouse Gas Monitor".