Outsourcing the problem of controlling mains AC devices - Page 1
Forum section: electronics / projects

author: dkonigs
author_rank: Regular Contributor
timestamp: August 22, 2025, 09:48:25 pm
content: So this post is kinda more of a vent than a question, but if anyone wants to add to it or offer helpful options I'm all ears.I'm currently working on an embedded device that has one annoying requirement. It has to be able to toggle power to a pair of mains AC outlets. This is because an important part of its functionality is turning on/off certain things that are typically controlled that way.Now I would love nothing more than to make this function someone else's problem. Its not that toggling mains AC is difficult, but rather that its always going to be a bit of a liability concern. Especially as a product I distribute for other people to use. The rest of the device has no trouble running off DC, but this one bit of necessary functionality is the issue. Unfortunately, no matter how much I research this, and how many creative solutions I find, there's nothing out there that actually ticks all the boxes for making this function "someone else's responsibility".Nearly every product I've found for solving this problem is either too expensive, too unwieldy, too complex to integrate, or completely lacks any sort of NRTL certification (UL, TUV, Intertek, etc.). Quite often its a combination of several of these factors, especially the last one. And if I'm going to bundle this widget with my product, it is my understanding that the last one matters. If I'm going to expect the user to buy the widget separately, then it needs to be something available as a widely available commodity product (of which none of these are).Ultimately I think I'm just going to have to forge ahead and handle the AC mains outlet switching within my own product, and do whatever due diligence I can to ensure its designed correctly and that I'm sufficiently protected in case something goes wrong. I'm currently proceeding down this path.That being said, I would like to share a number of the products I've discovered along this journey. That way everyone else can see what's available, what I've already looked at, and maybe think of more options to investigate.IoT Power Relay IIhttps://www.digital-loggers.com/iot2.htmlOnly has US outlets and ratingsFull power strip with only a single control signal, making it unwieldy for my application (as I'd need two)Has a mark that says "Safety CPI Tested", though I'm not sure what that meansNo NRTL certification claims or markingsAUDIOPHONICS Trigger Slave Power Supply Devicehttps://www.audiophonics.fr/en/diy-kits-and-boards/audiophonics-trigger-12v-230v-slave-power-supply-device-p-10661.htmlThe most convenient option overall, in terms of form factor and connectionsComes in multiple versions, but is essentially just a relay-in-a-boxNo product claims or markings beyond the top labelNo NRTL certification claims or markingsVOCOMO Trigger Power Adapter TSDhttps://www.vocomo.de/en/Trigger-Power-Adapter-TSD-V2.htmlHas a big European plug, thus needing large adapters for international use.Comes in multiple versions, but is essentially just a relay-in-a-boxAppears to actually be a modified version of another product, and retains the plastic shell from that other product. (That other product, a single-outlet surge protector, actually has an Intertek GS mark. However, this one does not.)Has a "CE" mark on the label, but this by itself probably doesn't mean much.No NRTL certification claims or markingsNow as an aside, my product does also have the unique ability to also speak to relay/dimmer devices designed for the DMX512 protocol. You'd think this would open up many more options, but it really doesn't. All of the product-ized DMX512 relay/dimmer devices are either too big, too expensive, lack NRTL certification, or some combination of the above.

author: dkonigs
author_rank: Regular Contributor
timestamp: August 22, 2025, 11:10:09 pm
content: Quote from: edavid on August 22, 2025, 10:34:04 pmRF-based solutions probably are the closest thing to a real "productized widget" for solving this problem. There are even some where the certification is totally believable, such as with the Shelly smart plugs.But it never feels like a good option, for several reasons:Consistent and repeatable timing is important for my application. For home automation, as long as the thing turns on/off within a second or two, its fine. For me, yes I want the time from "send trigger signal" to "power flips" to be fast and repeatable.There's no "common international standard" so you'd have a different plug for each country, often sold as a different product. Having a wide variety of per-country variations is a level of complexity I'd rather avoid.Integrating an RF transmitter into the base unit adds its own level of complexity in terms of which standards/protocols you use, whether you run into different certification issues, whether there's per-country variation, etc.Configuration suddenly becomes a point of pain for the users, as they'd need to go through some sort of pairing and setup process that might differ from place to place.

author: themadhippy
author_rank: Super Contributor
timestamp: August 22, 2025, 11:12:25 pm
content: might be worth a look at how MK cram it all into there intelligent socket,yea its for 240v land,and expensive,but might give you some clueshttps://www.cef.co.uk/catalogue/products/5179413-13a-dp-1-gang-intelligent-switched-socket-whiteAs for dmx,to officaly be accepted ya needs to cram a 5 pin xlr in there

author: brucehoult
author_rank: Super Contributor
timestamp: August 22, 2025, 11:20:29 pm
content: In the early 2010s I built a system using an Arduino Uno to sense room temperature using a thermistor and run a PID algorithm to control a 2400W oil column heater, a big fan pointing at the heater (I turned it on when the heater was running at high duty cycle), a dehumidifier, and (just because I could) my home hot water cylinder.I used Jaycar plugs controlled by 433 MHz radio, at first by electrically faking button presses on the provided remote control and later with a $2 Aliexpress 433 MHz transmitter.https://www.jaycar.co.nz/remote-controlled-3-outlet-mains-controller/p/MS6147This worked well, with the main problem being that there is no ACK, and once every few thousand commands there would be some interference causing the thing to not be turned on or off when it should. To deal with this I transmitted the current setting every 30 seconds.In the last few months I've bene doing a similar thing around the AC input and outputs of a Pecron E3600LFP battery / solar controller / AC charger / inverter.I'm using TP-Link "Tapo" P110 WIFI-controlled switches. There is a Python module to control them and also to query the current state, current Watts, and total Wh since midnight. It's actually just HTTP queries, so easy to do from anything with a network connection, which these days extends down to $1 ESP32s -- in the early 2010s anything with WIFI automatically cost US$50!https://www.jaycar.co.nz/tp-link-p100-smart-plug-wifi-4-pack/p/LA4202These are working out extremely well, at NZ$21 / US$12 each.As for setup: there is a nice easy consumer-friendly pairing process using thr Tapo smartphone app. You then write down the IP number displayed in the app and put it into your custom program / equipment.

author: dkonigs
author_rank: Regular Contributor
timestamp: August 23, 2025, 12:00:18 am
content: Quote from: themadhippy on August 22, 2025, 11:12:25 pmIf that product was designed to be controlled via something other than their infrastructure solution, and if it was half the price, and if it was usable internationally... then it would be interesting. Otherwise it really doesn't help.I'm not looking to build something like this myself. I'm looking at if its possible to avoid building something like this myself.Quote from: brucehoult on August 22, 2025, 11:20:29 pmThis has a similar problems as one of the earlier suggestions, most notably:Its a country-specific outlet, and I need an international solution (or a family of products to choose from)It requires dismantling a piece of an existing product and integrating it into mine, which likely has its own entire set of undesirable issues.Quote from: brucehoult on August 22, 2025, 11:20:29 pmWiFi is also probably a no-go for this. They'd depend on infrastructure, apps, maybe cloud services. I want my solution to work completely standalone without any user-site-specific setup processes. A smart-plug that worked over something like BT/BLE might work (pairing problems aside), but most of those only use BLE to help the app configure WiFi. Of course custom firmware could change this, but at some point it really isn't "someone else's product" anymore.

author: brucehoult
author_rank: Super Contributor
timestamp: August 23, 2025, 12:17:20 am
content: You can flash Tasmota software onto a very extensive range of commercial devices for fully-local control and monitoring. I haven't used it myself but I know people who do.https://templates.blakadder.com/plug.html

author: dkonigs
author_rank: Regular Contributor
timestamp: August 23, 2025, 01:01:58 am
content: Quote from: brucehoult on August 23, 2025, 12:17:20 amInteresting list, to be sure.I think I do need to state a few things up-front, though, which might have been unclear from the initial post:I'm trying to make a product, not a DIY hobby project.Off-the-shelf solutions are only good if they'reactuallyoff-the-shelf. If I need to maintain a list of 20 different random-wifi-thingies which all likely need some amount of firmware customization to be usable, that'snota solution. (And if setup requires an app or the end-user's home network, its also not a solution.)The best example of what I actually want is that "Audiophonics" relay module mentioned in my initial post, or something very similar to it in function.

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 24, 2025, 03:48:48 am
content: Rather than supporting whatever random brand of smart plug that happens to be on sale, how about only officially support a name brand or two such as Sonoff?

author: brucehoult
author_rank: Super Contributor
timestamp: August 24, 2025, 07:12:23 am
content: Quote from: NiHaoMike on August 24, 2025, 03:48:48 amDepending on what sort of "product" you could even include them, and a WIFI base station too, all pre-configured. Or, sell through agents who can perform an install.

author: nfmax
author_rank: Super Contributor
timestamp: August 24, 2025, 08:53:23 am
content: The OP said:“RF-based solutions probably are the closest thing to a real "productized widget" for solving this problem. There are even some where the certification is totally believable, such as with the Shelly smart plugs.”The Shelly smart modules have logic inputs that can be configured to directly control the relay, without any WiFi involved. There are two-channel variants, and some (at least) support control using low voltage DC (12-24V), although this is not isolated from the mains supply. You may be able to put a solution together along these lines, possibly with your own software but possibly not.

author: 5U4GB
author_rank: Super Contributor
timestamp: August 24, 2025, 10:28:31 am
content: Quote from: dkonigs on August 23, 2025, 01:01:58 amThat looks (functionally, at least) identical to something I made a few months ago when I needed to switch a device on and off via modbus control, take an extension lead, chop it in half, wire it to a Finder relay driven from an optocoupler driver module and put it inside an ABS case This was after spending a bit of time searching for something with similar functionality and not finding much, the closest I could find was one from an electrical supply place that looked like they were assembling them themselves as required, and not certified although I would hope it at least came with an SDoC or similar. So they do exist, but possibly not in the specific form you need them.Now if I can figure out how to use modbus to drive a triac dimmer...

author: dkonigs
author_rank: Regular Contributor
timestamp: August 24, 2025, 03:29:24 pm
content: Quote from: NiHaoMike on August 24, 2025, 03:48:48 amThat's actually part of why I name-dropped "Shelly". They make smart plugs for most country's outlets. But they still often all look like separate products on the website, and its hard to see a combined catalog, and I think they're all designed for WiFi with app-based setup. Sonoff also supports Zigbee, but its unclear how many versions they make. Of course any home automation solution involves a fiddly pairing process, and any RF solution has international/regulatory concerns or interference issues.Quote from: brucehoult on August 24, 2025, 07:12:23 amNo. I do not want WiFi, a base station, or any sort of "installation" process. And no, there won't be "agents" doing site setup. I really just want the user to be able to unbox my thing, plug in their things, flip a switch, and be ready to use it without confusing support conversations or awkward button/LED sequences.Quote from: nfmax on August 24, 2025, 08:53:23 amYes, I know Shelly makes standalone relay modules. So do many others. The problem with any of these is that the user still has to do mains electrical wiring themselves. I reallydon't wanta setup process that says "Go to the hardware store, buy these bits, wire up these plugs and outlets, "be safe and call a professional if you're uncomfortable", etc. Itmighthelp shove off some liability on my part, but it'll absolutely make things less safe in reality for the end user.Quote from: 5U4GB on August 24, 2025, 10:28:31 amI've actually disassembled most of the options I rattled off up-front. The "IoT Power Relay" is clearly the best designed one, has opto-isolation and all the bells and whistles. Its just not the most practical product here.The other two are literally just "a relay in a box":

author: 5U4GB
author_rank: Super Contributor
timestamp: August 25, 2025, 10:00:23 am
content: Quote from: dkonigs on August 24, 2025, 03:29:24 pmWoah! That makes my own DIY one look like rocket science, everything sleeved and/or shrouded, mains connections in terminal blocks, optocoupler input, etc. In their case they at least have a snubber diode in there, but that's about it... hmm, do Fujitsu make their relays in China now or is that a knockoff? It also looks like they're switching the neutral alongside active, is that to deal with coin-toss Shuko connectors where you never know which one of the two you're switching if you only switch one? That's something I hadn't considered since here you always know which wire is active.

author: dkonigs
author_rank: Regular Contributor
timestamp: August 25, 2025, 09:05:27 pm
content: Quote from: 5U4GB on August 25, 2025, 10:00:23 amI might as well share photos of some of the others, if only to satisfy peoples' curiosity.This is the inside of the Vocomo one:From what I've been able to tell, Vocomo basically took an Aoboer GZBS01/01B single-outlet surge protector, ripped out the surge protection bits, and replace them with that PCB. The plastic shell is unchanged, though some versions cover up the old markings better than others. (Kinda a shame, as the original product had an Intertek GS marking but this modified one obviously doesn't.)Meanwhile, the IoT Power Relay is the only one that actually looks like a proper commercial product on the inside:It has all the bells and whistles. I even attempted to trace the circuitry at one point. Not only is it opto-isolated, but its also extremely flexible in what sort of trigger inputs you can send it (wide range of AC or DC).Unfortunately its a 4-outlet monstrosity with a single trigger input, and only rated for US voltage, so its not really a good solution for me. (And it also lacks an NRTL mark, of course, which is another hang-up.) But it is the first thing everyone automatically suggests whenever I bring up this overarching issue.

author: 5U4GB
author_rank: Super Contributor
timestamp: August 26, 2025, 02:06:53 am
content: Quote from: dkonigs on August 25, 2025, 09:05:27 pmThat really is just a relay in a box as you say. And they're only switching one line, given what look like Shuko earth contacts in the photo that would mean there's a 50:50 chance each time that you're switching neutral not active, an absolute no-no here (AS/NZS 3000 section something-or-other).Here's my DIY job, I remembered when I dug up the photo that I didn't use a Finder relay in the end due to space constraints, and it's only switching a few hundred mA so the allegedly 30A Songle relay should be OK with it.