Building a mains-powered gas monitor box for a UK boiler room: which rules apply?
Mostly a lurker, I do backend work for an energy services firm. One of our UK clients wants us to monitor a plant room with two gas boilers: room temperature, a gas sensor, and a flag if the boiler lockout relay trips. Data goes to Hermetry, we already use it for their heat meters.
My prototype: ESP32, MQ-4 methane sensor, DS18B20, an HLK-PM01 230V-to-5V module soldered onto the same perfboard, all in an ABS box with a cable gland and a 3-pin plug. It works on my desk.
Before I ship anything to the UK I want to know: what UK rules apply to self-made mains equipment like this? Can I just plug it in, or does someone have to certify it? And I noticed this Hermetry Safe sub-forum, is that the product we should be using for the gas part?
On Safe: I found no doc page on what it adds, so I can’t tell you. Alarm rules on the device profile cover the “tell someone” part, that’s what we use.
The HLK modules are fine at home in my experience, I have a few running for years.
Fine until one fails. On perfboard you won’t have proper creepage between the 230V side and the ESP32, and no fuse on the input I’m guessing?
No fuse, no. And yes the mains traces are maybe 3 mm from the 5V side.
Why build the mains part at all? Use a plug-in 5V adapter and only build the low-voltage box.
Facility side: the client’s insurer will ask about anything permanently wired in a plant room, and their maintenance contractor will want to know who installed it.
Kevin’s right, and that’s the first thing I’d change. I run a plant and we’ve had two contractors bring in homemade boxes like this. Both went back.
Roughly how it works in the UK. Putting electrical equipment on the market falls under the Electrical Equipment (Safety) Regulations 2016, so it needs UKCA or CE marking with your technical file behind it. You’d be the manufacturer, which is not where you want to be for one box. If it’s hard-wired into the plant room, the installation is BS 7671 work for a competent electrician, usually off a fused connection unit.
So keep the only mains part off the shelf. A UKCA/CE-marked DIN-rail PSU (a Mean Well HDR-15-5 or similar) installed by their electrician, or even a marked plug-in adapter. Your box is then 5V only and you can build it however you like.
Gas is the bigger problem. An MQ-4 is not a gas detector in any safety sense. It drifts with humidity, needs burn-in, and no insurer will accept it. Use a certified fixed detector (for natural gas in a boiler room, look for EN 60079-29-1) and wire its volt-free alarm relay to an ESP32 input with a pull-up. The detector does the safety job and shuts the gas valve if it’s specified for that. Your ESP32 reports gas_alarm true/false and the room temperature, and an alarm rule on the profile handles notifications. The boiler lockout relay goes in the same way on a second input.
That makes the build much simpler. Revised design: Mean Well DIN-rail PSU fitted by the client’s electrician, my box is 5V only, the MQ-4 is gone, and the certified detector they already had (turns out there was one, nobody had wired its relay to anything) feeds an input. Telemetry is gas_alarm and lockout as booleans plus temp_c, with a Critical alarm rule on gas_alarm == true. Much less for me to worry about.
- You must be logged in to reply to this topic.
Join the conversation
Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

