Case Study: IoT Gas Leak Detection Device Development Using STM32 Learn how Adequate Infosoft developed an IIoT Gas Leak Detection System using STM32L4 for petrochemical plants. Featuring LoRaWAN, Edge AI, and Azure IoT Hub.

IoT Gas Leak Detection System Development Using STM32

This case study showcases how Adequate Infosoft developed an STM32-based Industrial Gas Leak Detection System and integrated it directly into a smart Building Management System (BMS) . By combining IoT sensors, embedded firmware, cloud connectivity, and real-time monitoring, we transformed a traditional BMS into an intelligent safety and automation platform. The project highlights our expertise in STM32 development, Industrial IoT solutions, smart BMS integration, and custom embedded system development services.

Learn how Adequate Infosoft developed an IIoT Gas Leak Detection System using STM32L4 for petrochemical plants. Featuring LoRaWAN, Edge AI, and Azure IoT Hub.

Client

PetroSafe Industries is a major petrochemical manufacturer with multiple refineries located throughout Europe and Asia. PetroSafe Industries experienced significant challenges related to the ability to monitor for gas leaks within their large-scale industrial settings.

Historically, PetroSafe Industries used traditional methods of monitoring for gas leaks through periodic inspections which were slow to complete, often created human errors causing them to miss a leak and did not provide real-time smoke monitoring.

They were looking for a way to obtain continuous monitoring (real-time), receive instant notification of a leak and to have predictive analytics with the ability to easily connect to their current industrial processes.

Our team designed and deployed a Smart Gas Leak Detection System based on STM32 microcontrollers, delivering an end-to-end solution from hardware design to cloud analytics and software applications.

Project Objectives

There were specific objectives for which the project was intended to address:

  • Real-time detection of hazardous gas (methane, propane, hydrogen sulfide and VOC) concentrations
  • Wireless, low-power devices communicating to cover extensive areas of an industrial complex
  • Predictive analytics and anomaly detection providing early warning signs, enabling timely interventions
  • Multi-modal software solutions (e.g., desktop, web and mobile) providing monitoring, alerting, and reporting of gas concentration levels
  • Integration of system with existing MES and SCADA systems for seamless operation workflows
  • A secure, scalable cloud based architecture solution capable of handling large number of sensor deployments
STM32-Based Smart Gas Leak Detection System for Petrochemical Plants

Technical Solution

PCB Design and Hardware Development

Primary Controller:

An STM32L4 family microcontroller (MCU) was used for its low power consumption, longevity in the industrial environment, and availability of various I/O options.

Sensors:

  • To detect hazardous gases, electrochemical gas sensor technology will be used.
  • Non-dispersive infrared (NDIR) gas sensor technology will be used to detect flammable gases.
  • Temperature and humidity sensors will be used to correct and calibrate all measurements based on the environmental conditions of the sensor.

PCB Development:

  • A multilayered PCB has been constructed as per industrial standards, including with EMI shields to prevent interference from heavy machinery.
  • The power management circuit has been designed for maximum battery life, including solar-assisted charging.

Enclosure:

Will be constructed with IP68-rated (totally protected from dust and against ingress of water and/or moisture) rugged materials with the ability to withstand exposure to dust, moisture, and chemicals.

Networking:

LED's, Buzzer, and local logging will provide redundant communications in the event of a network failure.

Embedded Firmware

Sensor Sampling & Calibration:

Firmware samples multiple gas sensors every 500ms, applies calibration algorithms, and performs local compensation for temperature and humidity.

Wireless Data Transmission:

  • LoRaWAN for long-distance industrial coverage
  • BLE Mesh for localized sensor networks inside manufacturing buildings

Edge Processing and Anomaly Detection:

  • The STM32L4 microcontroller (MCU) performs lightweight anomaly detection using rolling thresholds and machine learning techniques to detect potential gas concentration trends that deviate from expected values.
  • All critical events and summaries of the related measurement data are sent to the cloud in order to minimize the amount of data sent over the wireless link

FOTA Updates:

A secure, over-the-air update feature for firmware enables devices to receive firmware updates without requiring any user intervention.

Manufacturing & Assembly

  • Complete SMT and THT assembly for industrial-grade PCB
  • Sensor calibration under controlled lab conditions to ensure ppm-level accuracy
  • Ruggedized enclosure assembly with thermal and chemical resistance testing
  • Pre-deployment QA testing for battery life, sensor accuracy, and wireless connectivity

Back-End Architecture & Cloud

Cloud Computing Platform

Microsoft Azure (IoT Hub) to manage connected devices providing secure safe and reliable telemetry data

Data Pipeline:

  • MQTT broker supports device telemetry
  • High-resolution sensor data stored in time-series database (Azure Data Explorer)
  • Real-time anomaly detection pipeline built with Azure Function and Python Microservices

Predictive Analytics:

  • AI Models created from data associated with previous gas leak events used to help predict possible next gas leaks
  • Existing algorithms that calculate risk score will allow for early detection of possible future leaks

Security & Compliance:

  • All connections are protected with end-to-end transport layer security (TLS) encryption
  • Roles for each operator, engineer and administrator provide control via role-based access control (RBAC).
  • Complies with industrial standards for safety and cybersecurity (IEC 61508), (ISO 27001).

System Implementation & Oversight

  • On-Site Network : Combination of LoRaWAN and BLE mesh will provide total coverage of a large refinery
  • Device onboarding: No user interaction needed and secure authentication
  • Alerts and reports: Alerts for gas leaks, low battery, or offline devices sent via text message, email or mobile push notification
  • Improvement of system by utilizing Analytics via Cloud analytics to upgrade Edge AI models; modeling used to improve accuracy in gas leak identification.

Key Achievements

  • A fast way to detect hazardous gas leaks so that the response to such incidents can be faster and therefore contributes to a more safe operating environment for all the Workers in the Plant or Facility.
  • Predictive Maintenance has enabled predicted equipment failures to be approximately reduced by 20% in first 6-months of implementing preventive maintenance, thus contributing to less downtime.
  • Hundreds of STM32-based devices operate together on the Industrial Plant IoT install base with the option for future expandability.
  • When it comes to integration with other existing industrial applications, the RESTful APIs and SDKs provided are designed to enable seamless integration without disrupting existing workflows into other software based on either MES or SCADA platforms.
  • By using ruggedized devices and performing local processing of data and information, the requirement for maintenance has been considerably reduced while providing 'real-time' monitoring for operating condition purposes for the respective users.

Technical Challenges & Solutions

Harsh Industrial Environment:

We designed enclosures to endure chemicals, high temperatures, and dust. Additionally, EMI shielding was added to all PCBs so that sensors could remain accurate.

High Volume of Data Needs Processing:

The edge computing done on the STM32L4, made it possible to reduce the amount of information sent to the cloud and provide real-time analytics by eliminating bandwidth issues.

Wireless Coverage Issues Within Complex Structures:

Using BLE mesh combined with LoRaWAN allowed devices to have multiple paths to get data out of the facility, enabling devices to remain connected throughout the facility, even where there are areas with a lot of steel.

Calibration Drift:

Automatic routine recalibrations are built into the firmware and are triggered by environmental changes to ensure that the accuracy of the sensors does not degrade with time.

Conclusion

To summarize, this industrial IoT project highlights our capability to deliver full solutions using STM32 microcontrollers. The Smart Gas Leak Detection System for Petro-Safe Industries is an example of our ability to provide a complete solution from hardware and PCB design through edge firmware, cloud analytic and multi-platform software.

In addition to increasing safety in the workplace, this system also provides predictive insight to help maintain continuous operation and stay compliant with regulations.

By leveraging edge intelligence, reliable, wireless connectivity and cloud-based AI analytics, our solutions establish a new standard of safety and predictive maintenance in the industrial IoT space.

What Our Clients Say About Us

Client satisfaction is our ultimate goal. Here are some kind words of our precious clients they have used to express their satisfaction with our service.

Leadership That Leads Worldwide

With a physical presence in over 15 countries and a global footprint spanning 25+ countries, we are ready to serve you anywhere. Location, language, or culture is never a barrier, because our global team can work with you in your language. Our strong international team ensures seamless collaboration across borders We have a strong tech team, highly recognized in their domains, with extensive technical expertise.