Embedded Systems & Product Development Consultancy · London, UK
An air-quality monitor for power stations, from architecture to site acceptance
An energy-sector equipment manufacturer needed an air-quality monitor for permanent installation in power stations: networked, calibratable without opening the enclosure, and able to ride through power interruptions on its own battery. We led the system architecture and electronics, wrote the firmware and the PC tools, and supported the product through factory and site acceptance.
At a glance
- Industry: Industrial & Energy
- Client: An energy-sector equipment manufacturer
- Location: Dorset, United Kingdom
- Our role: Technical lead; system architecture, electronics oversight and design review, firmware, PC software and production test
- Platform: NXP i.MX RT1064 (Arm Cortex-M7), ESP32 Wi-Fi co-processor, u-blox LTE modem
- Key technologies: FreeRTOS, lwIP, LVGL, MQTT with JSON, LTE, 4–20 mA, RS-485, USB-C Power Delivery, LiFePO4 battery management, C#/.NET, Python
- Services: Embedded software & firmware · Electronics & PCB design · Architecture & technical advisory · Production readiness
- Outcome: Passed factory and site acceptance; installed and in service at a regulated power station in Canada
The challenge
Measuring air quality inside a power station is not a lab exercise. The monitor runs around the clock, has to keep working through supply interruptions, reports over the plant network and must be checked and recalibrated by site engineers without being taken apart. On a regulated site, every requirement also has to be demonstrated and documented before the equipment is accepted.
The specification asked for:
- Continuous sampling from gas, pressure and dew-point sensors and from 4–20 mA industrial sensor loops, with time-stamped local logging.
- Wired Ethernet as the main network link, with Wi-Fi or LTE cellular data where cabling wasn’t practical.
- Uninterrupted operation through supply loss, from a battery that is safe and long-lived in a warm industrial environment.
- A 5-inch touchscreen for live readings, alarms and configuration at the device.
- Relay outputs to drive a solenoid valve and to switch alarm and control circuits.
- Remote monitoring, configuration and calibration from a PC on the site network, and telemetry to a central server.
- A design ready for factory and site acceptance, and adaptable later for hazardous areas.
Our role
We were technical lead across hardware and software. We defined the system architecture, led the hardware engineer and the PCB layout engineer through the schematic and a six-layer layout with design reviews at each stage, and were the main contributor to the firmware, the PC application and the production test jig.
System architecture
The design is built around an NXP i.MX RT1064: a 600 MHz Cortex-M7 with 4 MB of on-chip flash and 1 MB of on-chip RAM. That is enough to run networking, a touchscreen interface and sensor processing on one chip without moving to embedded Linux. Staying on an RTOS gave fast start-up, deterministic sensor timing, and a smaller system to secure and maintain over the product’s life.
- Sensing: gas, pressure and dew-point sensors, 4–20 mA current-loop inputs for industrial transmitters, and RS-485 for external instruments.
- Networking: 10/100 Ethernet through an RMII PHY on the RT1064’s Ethernet controller, an ESP32 as a Wi-Fi co-processor on a high-speed serial link, and a u-blox LTE modem for cellular data where there is no plant network.
- Display: a 5-inch capacitive touchscreen with an LVGL interface, driven over the parallel RGB interface, with frame buffers in external SDRAM.
- Outputs: a solenoid relay for valve drive, and isolated relays for alarm and control outputs.
- Power: a USB-C Power Delivery sink, a LiFePO4 battery with a dedicated battery management system for charging, cell protection and state of charge, and a power path that moves to battery without resetting the system.
- Storage: local data logging, so no measurements are lost while the network is down.
Firmware
The firmware runs on FreeRTOS, built with MCUXpresso. Sensor acquisition, networking, the user interface, logging and power management run as separate tasks connected by message queues, so a slow network or a busy screen never delays a sample.
- A tuned network stack. The default lwIP configuration limited throughput and dropped packets under sustained load. We placed DMA descriptors and buffer pools in non-cacheable memory with correct Cortex-M7 cache maintenance, resized the buffer pools and TCP window for the real traffic, and enabled hardware checksum offload. The result was markedly higher throughput and stable connections under load.
- The touchscreen interface. Built with LVGL: live readings, trends, alarms and configuration, with double-buffered rendering so the display stays responsive while sensors and network are busy.
- Server connection. The device publishes measurements and status as JSON over MQTT, and receives configuration commands the same way, over Ethernet, Wi-Fi or LTE.
- Power events. Supply loss is detected early; the system switches to battery, keeps measuring, reports its battery state over the network and flushes data before an orderly shutdown if the battery runs low.
Electronics and PCB
The main board is a six-layer design in Altium. We set the stack-up for solid reference planes under the high-speed signals, impedance-controlled differential pairs for Ethernet and USB, and a length-matched SDRAM bus.
- Sensor inputs kept away from the switching regulators and the radio, with their own return paths.
- ESD and surge protection on every external connector, and common-mode filtering on Ethernet and RS-485.
- Relay outputs isolated from the control electronics.
- Test points and programming access for the production jig, and placement planned for assembly.
- Component choices reviewed for availability, lifecycle and cost, with alternates identified.
PC software and production test
A C#/.NET desktop application, built in Visual Studio, lets the client’s engineers monitor every unit on the network in real time, change configuration remotely and calibrate devices. The calibration workflow applies reference values, calculates the coefficients and writes them to the device, keeping a record of each calibration.
For production, a Python-driven test jig checks every assembled board: power rails, interfaces, sensors, network and display, with a pass or fail result recorded against its serial number.
Factory and site acceptance
We supported factory acceptance testing with the client, then site acceptance at a regulated power station in Canada, where the monitors were installed. That meant traceable test records, documented configuration and calibration, and evidence for each requirement in the specification.
Towards a hazardous-area version
The client also planned a version of the monitor for hazardous areas. We started that work: assessing the design against IEC 60079-11 for Ex ib IIA T4 protection and working out what had to change, including energy limitation on the battery and supply paths, limits on stored capacitance and inductance, component derating, segregation distances and surface temperature. We took the intrinsically safe design to an agreed stage and handed it over to the client’s team, with the analysis and design notes, to complete.
Results
- Monitors passed factory and site acceptance and were installed at a regulated power station in Canada, where the system is now in service.
- One RTOS platform handles sensing, Ethernet, Wi-Fi and LTE, MQTT telemetry, a touchscreen interface, relay outputs and battery backup.
- A tuned network stack with higher throughput and stable connections under load.
- A calibration and configuration tool for the client’s engineers, and a production test jig for volume builds.
- Groundwork for an intrinsically safe version, handed over with its analysis and design notes.
- Design files, source code and documentation handed over in full.
Building equipment for industrial or energy sites?
Tell us what it has to measure, control or survive.
An engineer will read it and reply within one business day.
Latest from the blog
Ultra Low Power Microcontrollers: STM32L5 Series
March 7, 2020