Hazardous Gas Detector Test Station

Metanate's client was producing a test station to verify the correct operation of industrial gas detection safety devices, by exposing them to test gas samples. This was to be available in two configurations:

  • An autonomous single-detector test station, for use on point-of-entry to hazardous areas.
  • A PC-controlled multi-detector diagnostic station, used for detector calibration and periodic maintenance.

Metanate was commissioned to design and develop the test station firmware, together with a test program to verify correct operation. Working in close cooperation with the customer's engineering staff, Metanate produced a detailed design specification and a project plan. These documents allowed internal project management to track the project and produce accurate progress reporting to the customer.

The software was coded in C, extensively documented using doxygen and static program analysis was used with a view to eventual MISRA-C:2004 compliance.

The system architecture of the autonomous test station is shown below. The diagnostic station omits the Interface Unit section, since it is controlled by the attached PC, and has multiple test 'pods' to allow several gas detectors to be tested at once.

Gas Station Architecture

The two processors (Microchip PIC32) run FreeRTOS (a lightweight multi process real-time operating system), and intercommunicate over an SPI bus.

The Control processor has the central coordinating role: upon detecting the insertion of a gas detector into its test pod it:

  • Determines the detector type and its fitted gas sensors' capabilities, by interogating it over a Modbus interface.
  • Constructs an appropriate test sequence, with the aid of a configuration database, and applies it:
    • Primes the detector for testing.
    • Pumps an appropriate sequence of gases through the pod to trigger all the gas sensors.
    • Monitors gas flow to check for blockage or cylinder exhaustion.
    • Reads back the test status from the detector.
    • Signals test progress and outcome via the Interface Unit or control PC.

Interaction with the detector under test is via Modbus, and control of valves and pumps uses I2C, SPI and general purpose I/O control lines.

The Control processor also provides file storage for the configuration database and audit and detector logs, and a USB HID interface for the control PC.

The Interface processor provides an icon-based user interface on an LCD display. This allows visual monitoring of detector test progress, and configuration of gas cylinder types and test settings. It can also archive stored logs, either onto an inserted USB flash drive or over a network to a web server.

Following development of the firmware, the Metanate engineers worked with the customer's team to commission the prototype hardware and carry out system tests to verify correct operation with the gas detectors developed by the client.