The Dark Secret of Smart Sockets and How I Fixed it! (DIY or Buy)

preview_player
Показать описание


Parts list: (affiliate links)
MOSFET:

In this episode of DIY or Buy we will be having a closer look at Smart Plugs, Sockets, Outlets.....However you want to call them. I love using such Smart of Wireless outlets to completely disconnect my appliances from the grid and thus getting rid of the standby power. But commercial smart outlets do often fail when I use them. So in this video we will investigate this problem, find a solution and possibly build the BEST DIY Smart Outlet that exists. Let's get started!

Websites which were shown/used during the video:

Thanks to JLCPCB for sponsoring this video.
Thanks to Altium for sponsoring this video.

0:00 The Relay Sticking Problem!
1:42 Intro
2:06 Reason for the Relay Sticking?
3:53 Testing the Solution
5:09 DIY Smart Socket Features
6:01 Power Measurement
8:27 Circuit (PCB) for the DIY Solution
10:13 First Tests & Improvements
10:49 Final Version & Verdict
Рекомендации по теме
Комментарии
Автор

Always take a actual size printout of your pcb before sending out to the manufacturer. That way you can try all the components and size any enclosure you want.

HMPirates
Автор

Looks like a fun project. As a fellow EE, I do have a couple of things to recommend you consider to increase the life of your switch.
First, as an aside, I am also working on a own project that includes an ESP32 - a ceramics Kiln remote temperature monitor. But, let's get back to you. Here is what I would consider.
1) The simplest solution would be to move from a relay to using an AC solid state relay. These always switch when the ac crosses zero so no nasty current transition issues. You could buy one but, I would expect that you would want to make you own one.
2) If you really want to stick with the relay, add a PTC thermistor in series. I expect that the high current you are seeing must be due to inrush, not the static current or the circuit would overload. Adding the PTC will limit the inrush current when you turn the relay on and hopefully prevent the contact from arcing.
Have fun and stay creative!

connecticutaggie
Автор

You could also add a snubber circuit over the relay-switch to prevent electrical interference noise and sparking. (I have had micro controllers reset because of electrical interference from switching relays)

MichelSatoer
Автор

Hello mate
I've been loving the content for years now, and have been watching since I was 16.
I am now in my 2nd year of electronics engineering degree thanks to your content too!
Please keep it up and I love the content!

abrarahmed
Автор

I love the way you introduce the topics, and how clear you speak!

ddavid
Автор

One thing you may want to try to prevent inrush relay sticking is to use a dual inrush relay circuit. Basically you have two relays where the load contacts are in parallel. One relay has a current limiting in series (resistor will do for testing). You close the current limited relay first then the non-limited relay is energized and bypasses the current limiting. When turning off you open the non-limited relay contacts and then the current limited contacts.

therealjammit
Автор

I'm really excited about the ESP32-C3 for projects like this, it feels more like the next evolution of the ESP8266 than it does the other ESP32 series chips. One nice feature about it is that it has a built-in USB Serial/JTAG port, so by simply connecting IO18/19 to USB D-/D+ you can connect it to a computer and program it without even having to mess with programming pins

Connie_cpu
Автор

A cheaper relay can also be used, as long as a simple soft-start circuit is being used.
Either with resistors or with a NTC, to bring down the inrush current.
Downside is that it will take a little longer for the devices to get needed energy to power on.

p_mouse
Автор

Some people have solved this problem using one of the aforementioned relays, but also ensuring that the switching occurs at the zero crossing point in the AC waveform. Though with switch bounce being a factor, it might be worth measuring how long the bounce effect occurs for your given relay before trying it.

george-broughton
Автор

Scott, I got some threaded, silver tipped contacts, from a big brother of the relay, which was a contactor, and it was made for a large DC drive motor from some warehouse transport equipment. I used these for my welding earth ground as they were much more conductive than the copper plated steel ones that were standard on a battery charger clamp. These were for my "new" flux core welder.
It was a heavy clamp with a rubberized coating, and was replaced with a newer clamp, but wasn't worn out. I ran a tinned braided copper cable from the welding lead end which were both attached at the jaw on one side. I then secured this with a contact stud from the former contactor behind the back of the pivot inside the grip, around to the other jaw of the clamp. Then I attached a silver contact on this side as well. It was a fair substitute for a proper earth ground, and will work until I find a suitable replacement.
The contacts are proud in the clamp, and have a good "bite" on the steel thanks to a good spring.

Farm_fab
Автор

Great project! You should remove ground plane copper below ESP antenna

aleksandar
Автор

Great work again!
You can add a small transistor circuit to switching the coil to a lower holding current to make the circuit more power efficient. Since you were concentrating on improvising the design, you could have included low power considerations also for the electronics.

karthikrajagopal
Автор

Next time you may want to use cutouts between your low voltage part and the mains voltage part on the PCB to get the insulation voltage up and prevent creepage paths on the pcb

cde
Автор

In next revision you may consider a better placement for the poor antenna of the esp8266, as I'm not sure it would like that big ground plane around it 😀

thesimbon
Автор

Nice Job. Consider switching the relay at the zero crossing of the mains (since you are measuring the voltage). That should dramatically increase the life of the relay.

crazyirishman
Автор

I think the reason the small transformer distorted was because most mains transformers saturate a bit with no load. That's the same phenomenon that makes old school power supplies warm

bentfishbowl
Автор

I am 100% with you - I recently replaced all my cheap boards I bought on Ali (with blue relays, SONGLE) that were almost all sticky, to the new ones - FANHAR - and these are with AgSnO2. Btw good companies use exactly FANHAR relays. It is not easy to find the 5V ones (black, FANHAR) but I back ordered 100 pieces on LCSC. And the cost of FANHAR is just about 0.5$/piece

P.S.
your solution is kindly 4x more expensive than the good sockets i.e. from Athom and they use AgSnO2 relays, that are also providing power measurements and are based on ESP so super easy with ESPhome

zyghom
Автор

One thing I was surprised you didn't mention was proper derating for relays depending on anticipated load type.

One of my pet peeves about these sorts of "smart switch" things is that they generally use the cheapest relays they can get away with, which means they are also not derating them properly. If the switch claims it supports, say, 10A, they actually mean that only for *purely resistive loads.* (and sometimes it may even say that somewhere in the fine print, but often not) For any other types of loads it will only be able to handle a fraction of that without eventually failing.

If you are switching inductive loads (like something with a transformer), you really need your relay to have twice the current rating. If you're switching motors, it should be around 4 times. If you're switching "tungsten" loads, such as incandescent lamps, the relay should actually be rated for somewhere around *8 or 10 times* the nominal current in order to actually reliably function and last properly over time. Since these sort of "outlet switch" devices could theoretically have all kinds of different loads plugged into them, and you can't know what the user is going to try to switch, you really need to design conservatively, IMHO, and should usually be substantially oversizing your relay specs to be safe.

You also really should design your circuit with some thermal protection to detect if the relay gets too hot (because somebody's plugged too big a load into it, or because its contacts have degraded over time so it can't support as high a load as it should be able to). Most commercial products place some sort of thermal fuse right next to the relay to detect problems and cut out before things get so toasty that they start melting things or burning your house down.

foogod
Автор

I've been uninstalling some smart switches I put in 5 years ago that have all stopped working, and I'm seeing here what probably happened to all of them. Thank you for your endless creativity and educational efforts.

geddysciple
Автор

I've been thinking about this for some time but have not built anything yet. Some ideas I've been toying with:

1. Make a multiway strip. That way you avoid duplicating the LV power supply, the voltage sensor and the controller chip. Plus you put less burden on your WiFi router. Plus you can build in value added functionality like turning off peripheral power supplies when the main device power drops to standby level.

2. Use latching relays. That way you avoid consuming current to hold the relays on. These relays have gotten surprisingly inexpensive.

3. Use a hall effect sensor for current measurement. It ought to be possible to build this like a miniature clamp meter on the PCB. Intrinsically safe and should be much smaller than a current transformer.

4. Zero- current switching. If sensing AC current you can delay opening the relay contacts until the zero crossing of the current waveform to eliminate arcing. Also may be worth closing the contact on the zero crossing of the voltage waveform.


5. Genuine zero-power standby. This could be done with a super capacitor and push-button for wake up. Maybe even a solar cell and an IR transmitter for cordless remote.

john_hind