In the UK there is a free monthly magazine called Hackspace magazine, in Issue 4 (March 2018) magazine Archie Roques builds an IoT tea machine. using a mains powered kettle and some relays. One of my main objections to this article is the switching of mains current without clearly laying out the issues and risks involved. I will cover my observations at the end of this post.
I have attached the pages of the article to this post, It is an interesting project.
The relay board chosen for switching the mains in this project is the ‘Spark Fun Beef Cake Relay’ which is fitted with a JQX-15F 005-1Z1 which according to the QX-15F Datasheet is switched using 5V DC and the PCB mount SPDT contacts are raited to for 30 A at 240 VAC (1 Form C), but only rated to Switch 20 A, but this switching rating is not at 240 VAC, the maximum switching rating is 560 W which means that it is not designed for switching a 230 VAC 3 kW kettle (approx 13 A) on load.
I had a quick look at the Spark Fun Beef Cake Relay board to see what the PCB is like, and it looks like the tracks are a bit narrow for the full 13 A load.
I would also feel happier had Archie used bootlace ferrules on his mains wiring, as that would reduce the risk of stray conductive wires becoming lose and risking bridging or short circuitng.
You can see some of my previous experience with Mains electronic equipment on 5V ACDC Switch mode PSU or the HLK-PM01 PSU.
I would replace the JQX-15F 005-1Z1 with a solid state relay if I was to do this project. I am going to be doing something similar with my sous vide cooker but using a solid-state relay.
38 thoughts on “Switching mains power without dying”
Also, anything with mains or high voltage on it needs to have extra shielding, which might be a plastic/transparent cover over part of the PCB, so that you cannot inadvertently touch a solder joint with mains on it. All exposed wires and terminals need to be sleeved or shrouded to prevent fortuitous contact. Keep mains wiring physically separate from other wires.
There should also be warning stickers attached, e.g. like the lightning flash symbol, or some words telling you what voltage is present. Otherwise, one slip and you’re dead!
I have a post about creepage and clearance already…
Thanks Philip, that’s very comprehensive!
It’s a bit scary some of the unsafe PCBs sold with mains capable relays.
Nice analysis. Not dying or setting fire to the house are key non functional requirement for me.
Thank you
If you look at Fischertechnik PLC it should pass all expectations. 24 volt with rasp-pie.
Do you have a link or more details?
“Whether you use an Arduino or any other monitoring system, it is simply a tool for controlling equipment. As someone who works with medium voltage on a daily basis, having a thorough understanding of its functioning is crucial. Neglecting this fundamental knowledge can quickly lead to disastrous consequences.”
“….I had a quick look at the board to see what the PCB is like, and it looks like the tracks are a bit narrow….”
I’m curious how you can feel that a “quick look at the datasheet is not enough”, yet a “quick look at the board to see what the PCB is like” is?! You think that a gut feeling from a visual examination of a board is more reliable than the published technical ratings from the manufacturer?
If you’re concerned about the trace width required to safely carry the power for an electric kettle, I recommend you consult a calculator such as this one https://uk.farnell.com/pcb-trace-width
Because I design high current PCBs day in day out.
I guess most people don’t (I know I certainly don’t!), so as general advice in a FB group, I’d personally recommend people stick to the manufacturer’s data sheet instead 😉
I read the relay manufactures data sheet, this is how I made the assessment about the unsuitability of that relay for switching 2.7 – 3 kW on load. I also reviewed the PCB and came to the conclusion that the track width looks a little narrow.
I would recommend the use of a suitable rated Solid State Relay (SSR) if some one were to replicate this project or do something similar.
My pet hate is the dangerous stuff, there is no need of it, you got to have the set of skills when dealing with mains, get trained somewhere or get trained by an individual who is qualified and insists on all the safety procedures
and equipment are adhered too.
In America 30 people a year are dying from microwave transformer projects, mains voltage always has a way to get you, it has its own new and very inventive ways to return to the power station from where it came, tracking used to be a really big problem until they started notching the boards.
None of these things are in projects, a few years repairing crt tvs will introduce them that electricity goes where it wants not where you want, so design at high voltages takes in the fact you got to make sure it never escapes,
finds unexpected paths, tracks across components or boards, arcs through the air, if your feet are on the floor it will look at you for a route back.
Common design floor at high voltages is component layout, resistors are the worst, when mounting horizontal although they take up space and it impacts miniature designs.
Its safer. When they are vertical with a narrow gap, at a certain voltage the voltage will arc across and a lot of 80’s and 90’s stuff had this issue thats why you may have come across some plastic tubes on them, more a problem with diodes.
I never touch anything from mains unless it goes through my repair isolation transformer.
People got no concept, even on floor boards, a few storeys up on carpet wearing shoes how conductive they are.
I used to demonstrate this by letting them hold a scope probe and watch that fuzzy 50hz noise signal come up, then make them sit on a chair and lift one foot up at a time till both feet are up, the signal would halve but it would still be there, i challenge them to insulate them selves to where the signal was gone, it only reduces. Then they get the idea there is no getting away from death, there is no safety by ignorance but only death by stupidity and carelessness.
Safety recommendation
It therefore only takes 50 V to be crossed by a lethal current of 50 mA. Electricity can have fatal consequences from 10 mA: beyond this “non-dropping threshold”, muscle cramps pin the victim to the current conductor, increasing the duration of exposure and therefore the severity of the injuries.
When it comes to AC, I just don’t touch it.
If I need to work with it, I just buy whatever I need and use that in my build instead of building it myself.
That’s what IBEW is for. Unless you’ve had the training, DON’T MESS WITH IT AT ALL.
What or who is the IBEW? and how is that relevant?
I agree with you. One of the major, major hobbyist board websites sold a relay board maybe 15 years ago that violated all kinds of safe design guidelines, especially separation space between traces. People don’t understand how dangerous what they’re doing is in some cases.
One thing I don’t see often is people simply switching using an led taped over a dusk-to-dawn sensor. If you get one that clicks when it turns on and off, it’s a relay so you can switch inductive loads with it. UL tested and optically isolated.
You have just made an SSR?
Try to use a device that switches when the ac voltage is crossing at zero volts.
The biggest issue I see is there is not spark gap or circuit isolation for mains voltage on the relay board so would not be adequate. There is no difference between a SSR and a magnetic relay. They can both fail unenergized and energized. Same failure modes between them. Unless I missed it I am not seeing any inline fuses which is important to not deliver the full 13amp outlet current should a short happen. You can also isolate even safer by utilizing opto isolators in the circuits.
SSRs designed for switching mains voltages tend to switch on zero crossing. Meaning they interrupt the current when the voltage is zero. Electromechanical relays don’t. Meaning they can draw an arc, also if you had looked at the data sheet of the relay that was specified for the project you will have seen that it was not designed for making or breaking a 3kW load.
Yes but no less safer at failure than a emr. Also zero cross is bad for inductive loads and transformers and causes surge currents. I didn’t have to look at the data sheet to know it wasn’t good for mains. I saw the board itself. 😀 I use both zero cross, random and emr in my work projects. In the uk I even used 240vac ac main relays that powered a stepdown transformer and converter. One half of the machine was 240vac 50hz and the other half was 120vac 60hz.
In this case the load is resistive.
Fusing is also paramount for safety as well.
There will be a fuse in the plug that this device is plugged into the mains with. It will be fused at 13A
You would also want a secondary fuse closer to the device more inline with the amperage demands unless you really are using it on a tea kettle then it would probably draw about 10amps or so. 13 amps at 240 can do some welding if there is a short from metal to wire. Lol
It’s not that dangerous switching 120vac to be honest. You just need to not be an idiot. 240vac uk is a bit iffy with a full 32amp ring but not that much worse. Isolation is definitely you’re friend in these instances.
Contactors are the way to go. Mechanical and solid state kinds are available.
https://www.mouser.com/c/electromechanical/industrial-automation/contactors/
A contactor is a type of relay… well kind of, but they are the same class of device
I would recommend the use of SSRs for switching mains.
WARNING! Do NOT ATTEMPT TO USE RELAYS in this application or any applications dealing with high current! (“relays is not hard” is a incorrect statement and dangerous).
Also reviewing your link and the suggested components is highly confusing to a novice and the necessary “state of the are” wiring condition is absent. Including absent is reference to the special contactor devices made for this purpose and can be activated utilizing a host of digital signals.
Users, it’s highly recommend discussing this type of application with experienced persons when when the current load is above 0.5 amps. (Even at this level, most relays contacts will weld close if switch sequence is not properly transit protected and load reduced to a minimum! Considerations should include surge current on make/break switching, AC or DC powered, reverse current surge, and in the case of DC motors- reverse drive direction transition current!
I am not sure what you are trying to say…
Relays are great for low voltage and current (DC) application but for higher voltage and current applications, they are not safe -DC or AC. For example , Current surge on a standard home light bulb burnout is around 5 to 7 amps which could easily fuse together single relay contacts.
The industry standard is to use a contractor which opens both power connections simultaneously, still adding the necessary transit protection protocol circuitry.
There is nothing wrong with using correctly sized relays in this case. The issue was that the relays selected were not appropriately selected.
I recommend moving to SSRs (Solid State Relays) for this use case.
Never been a fan of using conventional relays for switching mains. The switching contacts never look substantial enough to me, and there’s always the risk of arcing.
I use a Fotek SSR-40 (solid state relay) to switch a 3kW Immersion heater.
Works silently, no chance or arcing, and no quenching diode needed.
This is not the least expensive way to do it but includes the case, outlets, and some peace of mind.
That uses the same class of relay that I posted about.