Open AWE Magazine menu
Subscribe Login

Home / Articles and Press Releases / Press Release / Implementing a Combustible Gas Detector Network with NevadaNano MPS™

CATEGORIES

  • Latest Issue
  • Air Quality
  • Chromatography
  • Construction
  • Climate Change
  • Emissions
  • Environmental & Monitoring Technology
  • Gas Detection
  • Health and Safety Awareness
  • Humidity & Temperature
  • Laboratory Testing
  • Land Remediation
  • Marine Pollution
  • Noise Monitoring
  • Regulations & Legislations
  • Sludge and Biosolids
  • Soil Analysis
  • Spectroscopy
  • Weather Monitoring
  • Water Analysis
  • Water Monitoring

MORE

  • Press Releases
  • Events
  • Videos
  • Magazines

COMPANY

  • About
  • Advertising
  • Newsletter
  • Contact
HSI White logo
Open AWE Magazine menu
Subscribe

Home / Articles and Press Releases / Press Release / Implementing a Combustible Gas Detector Network with NevadaNano MPS™

CATEGORIES

  • Latest Issue
  • Air Quality
  • Chromatography
  • Construction
  • Climate Change
  • Emissions
  • Environmental & Monitoring Technology
  • Gas Detection
  • Health and Safety Awareness
  • Humidity & Temperature
  • Laboratory Testing
  • Land Remediation
  • Marine Pollution
  • Noise Monitoring
  • Regulations & Legislations
  • Sludge and Biosolids
  • Soil Analysis
  • Spectroscopy
  • Weather Monitoring
  • Water Analysis
  • Water Monitoring

MORE

  • Press Releases
  • Events
  • Videos
  • Magazines

COMPANY

  • About
  • Advertising
  • Newsletter
  • Contact

CATEGORIES

  • Heat and Flame
  • Press Release|Gas Detection
  • Article
  • Press Release
  • Air Quality
  • Chromatography
  • Construction
  • Climate Change
  • Emissions
  • Environmental & Monitoring Technology
  • Gas Detection
  • Health and Safety Awareness
  • Humidity & Temperature
  • Laboratory Testing
  • Land Remediation
  • Marine Pollution
  • Noise Monitoring
  • Personal Protective Equipment
  • Regulations & Legislations
  • Sludge and Biosolids
  • Soil Analysis
  • Spectroscopy
  • Weather Monitoring
  • Water Analysis
  • Water Monitoring
  • Wellbeing at work

Press Release

Implementing a Combustible Gas Detector Network with NevadaNano MPS™

By Gary Marks

| Read Bio

Published: September 15th, 2020

Share this article

Over the past few years, there has been an ever-increasing number of Internet of Things projects being launched around the world.  The large majority of these come in two camps. 

Using microphones and speakers with machine learning to mimic audio or sound activity and the other camp uses motion sensors to monitor movement activity such as people monitoring or autonomous vehicles.  The next frontier so to speak could very well be an increasing number of projects based on what is in the air around us that are largely invisible.  For example, a single flammable gas detector might uncover an abnormal level of methane gas, a networked system of methane sensors could pinpoint the leak, compute the magnitude of the gas escaping, likely path over time, all together enabling responders to prioritize a plan of action.

This application demonstrates the use of Message Queueing Transport Telemetry, MQTT, a popular lightweight IoT protocol, with the NevadaNano MPS™ Flammable Gas Sensor. It was developed around their Flammable Gas Sensor Evaluation Unit and Raspberry Pi. The version of MQTT used for this application is 3.1.1, which while not the latest version is the most common version in use at this time.

There are three primary elements in the demonstration: A client application that runs on a Raspberry Pi board that interfaces with two MPS flammable sensors, an MQTT server, which was implemented on a second Raspberry Pi, and a command/monitor client that runs on a Linux workstation.  Both client applications are written in Python, using the Paho-MQTT library from the Eclipse Foundation. The MQTT server used for these applications is the Mosquitto server, also from Eclipse.

The two clients are configured in a command/response paradigm, where the workstation client issues commands and requests data from the sensor client. The sensor client application acts essentially as a command/data request server. The flammable sensor client application incorporates a NevadaNano UART utility directly with calls from within the Python code.

Configuration

The configuration of the MQTT demonstration consists of two Raspberry Pi boards and a Linux workstation. One Raspberry Pi is used for an MQTT server and one is used for the MQTT client that manages the interface with two MPS flammable sensors. A Linux workstation application is used for the second client, which provides remote command/request monitoring of the sensors. The following diagram, Figure 1, shows the logical layout of the two clients and the server.

Figure 1

As an IoT protocol, MQTT allows clients and servers to be anywhere on the Internet. However in this case, all three elements shown in Figure 1, the two clients and one server, were run on a local network to test the applications. As shown in Figure 1, both clients subscribe to topics and both publish to topics.

MQTT Server

There is no particular significance to the fact that a Raspberry Pi board was chosen to host the MQTT server. Mosquitto, the MQTT server used for this application, can be installed on any system running Windows, macOS, or Linux. Small boards like Raspberry Pi or Beagle Bone are just handy for filling this type of role. It should also be noted that there are alternative MQTT servers that can be installed locally or used from the Cloud. Mosquitto is a light-weight convenient option that is provided by the same organization that provides the Python MQTT library used by the client applications described here.

MPS Sensor Interface Client

The MPS Sensor Interface Client was deployed on another Raspberry Pi. First, the flammable gas sensors must be connected to the Raspberry Pi through the sensors’ UART interfaces. Then the sensor control code supplied as a download from Nevada Nanotech must be set up as it is an integral part of the MQTT client application. Finally the MQTT Python client application must be installed and configured.

UART Interface Configuration

The Nevada Nanotech MPS Flammable Gas Sensor Evaluation Unit comes with an MPS flammable gas sensor, an interface board, and USB cable. For the MPS Gas Sensor Interface Client application two sensors with an interface board for each are used. The interface board has a connector for a direct UART connection to the sensor as well as a USB connector, which gets translated into a UART connection to the sensor. For the MQTT demonstration two interface boards with sensors have been connected to a Raspberry Pi board. Figure 2 below shows two MPS sensors connected with USB to a Raspberry Pi 3B board.

 

Figure 2

MQTT Python Configuration

Python virtual environments was employed for the development and testing of this MQTT application. While it is not required, it is a convenient way to isolate a Python environment and its packages from any other Python projects implemented on the same platform. Then from within the virtual environment, the Paho-MQTT library was installed. Version 1.3.1 was used for this MQTT application.

Command/Monitor Client

An Ubuntu Linux workstation was used for the Command/Monitor Client. Again, a python virtual environment was setup in the same way that it was done for the MPS Sensor Interface Client on Raspberry Pi. And then the same version of Paho-MQTT used for the MPS Sensor Interface client, 1.3.1, was installed.

Applications

The MPS Sensor Interface Client Application and the Command/Monitor Client Application subscribe and publish to two categories of topics: Commands and Command Responses. The paradigm is command/response where the Command/Monitor Client publishes commands for which the MPS Sensor Interface Client subscribes. Conversely, the MPS Gas Sensor Interface Client publishes command responses for which the Command/Monitor Client subscribes.

MPS Sensor Interface Client Application

There are three files, config.py, MPS_commands.py, and MPS_mqtt_client.py.

Config.Py

As the name suggests, the config.py file contains configuration information for the application. The information contained in it is specific for every configuration/installation of the application. The information is contained in a separate file because it is the most likely to be changed.

MPS_commands.Py

The MPS_commands.py contains symbolic references to command strings and command keys. The information is contained in a separate file because it is used by both applications.

MPS_mqtt_client.Py

The MPS_mqtt_client.py file contains all of the executable python code for the application. It contains two class definitions and the main entry point of the application. The two classes are MPS and MPS_CommandProcessor.

The MPS class deals with the interface to an MPS sensor and contains all the command functions. The MPS_CommandProcessor class deals with the MQTT protocol portion of the application. It connects to the server, subscribes to the commands topic and processes incoming commands in an endless loop.

The application requires two command-line parameters, the first is the sensor name and the second is the ttyUSB port number. The sensor name will be MSPpi0 or MPSpi1 and the port number will be 0 or 1. The sensor name is used to fill in the middle level of the topic names.

For the full demonstration of the MQTT applications, two instantiations of the MPS Sensor Client are used. Recall that there are two MPS Flammable sensors connected to the MSP sensor interface Raspberry Pi. There needs to be separate independent processing for each sensor. While there are multiple ways to implement this, the simplest is to just let the Raspberry Pi Linux handle it for us. The application as written handles one sensor. We can simply start two instantiations of the application where each uses a different ttyUSBx port.

Command/Monitor Client Application

There are three files, config.py, MPS_commands.py, and MPS_mqtt_remote_monitor.py.

Config.Py

The config.py file contains configuration information just as the one for the MPS Sensor Client. Again, the information contained in it is specific for every configuration/installation of the application. It’s a separate file because it is the most likely to be changed. Just as the config.py for the MPS Sensor Client,

MPS_commands.Py

The MPS_commands.py file is identical to the one for the MPS Sensor Client. In fact, it needs to be.

MPS_mqtt_remote_monitor.Py

The MPS_mqtt_remote_monitor.py file contains all of the executable python code for the application. It subscribes to the “commandreturns” of both sensors and publishes on the “commands” topics of both sensors.

This is the overview of creating a network of flammable gas detectors based on NevadaNano’s LEL gas detector and the MQTT protocol.  Contact [email protected] to download the full application note to get started on your own industrial gas detector system.

Original Article: https://nevadanano.com/2020/09/08/combustible-gas-detector-network-mps-and-mqtt-protocol/

 

Share this article

ABOUT THE AUTHOR

Gary Marks

Gary Marks, co-founder and CEO of iP Solutions Corp., has 25+ years’ experience in development of IoT, sensors, and embedded systems technology.

He has applied his development expertise in markets that include gas detection, agriculture, public water systems, energy efficiency and smart grid applications.

POPULAR POSTS BY Gary Marks

Press Release

Implementing a Combustible Gas Detector Network with NevadaNano MPS™

Get email updates

Sign up for the AWE newsletter

Keep up-to-date through the power of email and receive the latest environmental monitoring product information and newsletter emails from AWE - Monitoring and Analysing the Impact of Industry on the Environment

"*" indicates required fields

Country
*
This field is for validation purposes and should be left unchanged.

FEATURED ARTICLES

Press Release

Blackline Safety and NevadaNano Reach Milestone in Deployment of Industry-First Sensors

Press Release

The Benefits of Using Refurbished Parts in Your Lab

Advertisement

SOCIAL MEDIA

AWE on Facebook

https://www.facebook.com/AWEIMagazine/

Advertisement

SOCIAL MEDIA

AWE on Twitter

Retweet on Twitter AWE International Magazine Retweeted
Avatar Avantes @avanteshq ·
1 Feb

Meet the next-generation spectrometer, the #Pacto!
This versatile and powerful device, available in three configurations, is sure to revolutionize the world of #spectroscopy.

Click the link to discover the Pacto: https://www.avantes.com/news/pacto-spectrometer-release/

https://www.youtube.com/watch?v=AZJXb-ZN4WY

Reply on Twitter 1620703609657909248 Retweet on Twitter 1620703609657909248 1 Like on Twitter 1620703609657909248 2 Twitter 1620703609657909248

Advertisement

SUBSCRIBE

Stay up to date with our newsletter

    • Keep up-to-date with Europe’s largest audited environmental monitoring magazine

 

    • Delivering the latest information on new products and emerging technologies related to industrial environmental monitoring.

 

This field is for validation purposes and should be left unchanged.

Subscribe

SUBSCRIBE TO AWE MAGAZINE

5 reasons to subscribe to our digital and print package

  • Stay up to date from anywhere in the world, with instant access to the latest issue straight from your phone, tablet or laptop.
  • Trust that you’re getting the best content from our range of internationally accredited authors.
  • Get full access to our archives and see how the environmental monitoring landscape has evolved with us over the years.
  • Enjoy our monthly newsletter curated with up-to-the-minute news and a selection of editor’s top picks.
  • Hot off the press and straight to your door – look forward to your own glossy copy of AWE, delivered five times a year
Subscribe View Subscription levels

STAY SAFE & INFORMED

Subscribe to the latest environmental monitoring articles, news, products and regulations

Find out more

Stay up to date with our newsletter

  • This field is for validation purposes and should be left unchanged.

ABOUT

  • About AWE
  • Advertise
  • Contact Us

YOUR ACCOUNT

Sign In Register Account Subscribe to AWE

RESOURCES

Request Media Pack

CONNECT

ACCREDITATIONS

Copyright Bay Publishing 2023. All Rights reserved.

Designed & Built by:
  • Terms & Conditions
  • Privacy Policy
  • Cookie Policy
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT