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

Sdílet
Vložit
  • čas přidán 15. 05. 2024
  • $2 for 2-4 Layer PCBs, free ENIG for 6Layer PCBs:jlcpcb.com/AAA
    Get $54 New User Coupon &3D Coupon: bit.ly/3UlsFjE
    Free Altium Designer Trial: altium.com/yt/greatscott!
    Previous video: • I tried finding Hidden...
    HomeAssistant Video: • DIY Home Automation In...
    Facebook: / greatscottlab
    Twitter: / greatscottlab
    Instagram: / great.scott.lab
    Support me for more videos: www.patreon.com/GreatScott?ty=h
    More project information here: www.patreon.com/posts/7325577...
    Parts list: (affiliate links)
    ESP-12F: s.click.aliexpress.com/e/_DF1...
    HT7833: s.click.aliexpress.com/e/_DF5...
    5V Power Supply: s.click.aliexpress.com/e/_DcZ...
    Mini Transformer: s.click.aliexpress.com/e/_Dl3...
    Current Transformer: s.click.aliexpress.com/e/_Dmd...
    CS5460A Power Measurement IC: s.click.aliexpress.com/e/_DBa...
    0805 Resistors: s.click.aliexpress.com/e/_DE6...
    0805 Capacitos: s.click.aliexpress.com/e/_DkG...
    Relay: www.mouser.de/ProductDetail/6...
    Crystal: lcsc.com/product-detail/Cryst...
    Choke: lcsc.com/product-detail/Commo...
    Varistor: lcsc.com/product-detail/Varis...
    Input Capacitor: lcsc.com/product-detail/Suppr...
    Fuse: lcsc.com/product-detail/Fuse-...
    MOSFET:
    Flyback Diode: lcsc.com/product-detail/Diode...
    Tactile Switches: lcsc.com/product-detail/Tacti...
    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:
    esphome.io/components/sensor/...
    www.mouser.de/c/electromechan...
    datasheet.lcsc.com/szlcsc/190...
    circuitjournal.com/esp8266-wi...
    asset.conrad.com/media10/add/...
    ibex.tech/resources/geek-area...
    www.cirrus.com/products/cs5460a/
    statics.cirrus.com/pubs/proDa...
    www.mouser.de/ProductDetail/6...
    www.mouser.de/datasheet/2/418...
    Thanks to JLCPCB for sponsoring this video.
    Visit jlcpcb.com to get professional PCBs for low prices.
    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
  • Věda a technologie

Komentáře • 765

  • @HMPirates
    @HMPirates Před rokem +83

    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.

    • @Mdsoebee
      @Mdsoebee Před 10 měsíci +2

      Great advice. What computer program do you use to do this?

    • @micah2936
      @micah2936 Před 9 měsíci

      @@Mdsoebee there are many ways to do this. Most softwares for PCB design allow you to directly print your design into paper or PDF directly. Most also allow you to export the PCB to a 3D file which is what I do, and then you can 3D print the design to see if it will fit
      Personally, I always make the enclosure first then I design the PCB around the design. When I use Fusion 360 for PCB design they have an option to just select a sketch and turn it into a PCB outline. If you use any other PCB software such as KiCAD, you can export a fusion 360 sketch as an DFX file and then import it into KiCAD or other as the outline

    • @wildniscamper7276
      @wildniscamper7276 Před měsícem

      or use the fusion360 electrical 3d tool..

  • @MichelSatoer
    @MichelSatoer Před rokem +265

    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)

    • @greatscottlab
      @greatscottlab  Před rokem +106

      Also sounds like a good idea. Might try that in another video ;-) Thanks.

    • @jorno1994
      @jorno1994 Před rokem +26

      @@greatscottlab would be cool to have a video on methods to reduce sparking in relays/switches!

    • @ianthehunter3532
      @ianthehunter3532 Před rokem +12

      @@jorno1994 and what about solid state relays, like I know he did a video on them, but he didn't mention them here

    • @zyghom
      @zyghom Před rokem +8

      @@ianthehunter3532 SSR with 10A capability has to be big I think, much bigger than mechanical one. And their reliability is not as good either

    • @omsingharjit
      @omsingharjit Před rokem

      Than three will be no proper seperation between mains and load .

  • @connecticutaggie
    @connecticutaggie Před rokem +14

    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!

    • @dl5244
      @dl5244 Před rokem +4

      2) you probably meant to say NTC instead of PTC? NTC (Negative Temperature Coefficient) start as high impedance as cold and then current flow dissipates power for them to warm up and become low impedance. A PTC is the opposite - useful to protect from battery overload, but WAY too slow to protect from inrush.

    • @connecticutaggie
      @connecticutaggie Před rokem

      @@dl5244 Thanks DL, I don't use this technique very often so I guess I got the terms swapped.

  • @therealjammit
    @therealjammit Před rokem +154

    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.

    • @fodl4387
      @fodl4387 Před rokem +24

      There's is a really old method for starting motors using this system to prevent inrush current.

    • @NicksStuff
      @NicksStuff Před rokem +12

      Smart!
      And the double click must be nice to hear for the connoisseur, a bit like someone heel&toeing while downshifting

    • @foogod4237
      @foogod4237 Před rokem +24

      This can be useful for really high loads, high switch frequency, or something which requires precise start timing, but is usually overkill for something like this IMHO. Much the same result can usually be achieved (much more easily) using something like a negative-temperature-coefficient (NTC) thermistor in series with the load...
      Also, a lot of the time, relay arcing is actually not because of inrush current, but occurs when _disconnecting_ due to back-EMF from things like motors (this doesn't usually result in relay sticking, but can result in contact degradation which ultimately leads to high resistance and relay failure (or worse, fire risk). For that sort of issue, adding a metal-oxide-varistor (MOV) can often reduce or eliminate the problem...

    • @ShainAndrews
      @ShainAndrews Před rokem +6

      Double the failure modes. Brilliant.

    • @williamhuang8309
      @williamhuang8309 Před rokem +5

      @@fodl4387 Some old electric trains use this system, they have massive DC motors connected to massive banks of resistors which are bypassed/put in parallel as the train speeds up and current reduces. But not all old trains use resistors, some use tapping contactors.

  • @george-broughton
    @george-broughton Před rokem +4

    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.

  • @p_mouse8676
    @p_mouse8676 Před rokem +49

    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.

    • @RandomUser2401
      @RandomUser2401 Před rokem +2

      0.7W of standby consumption per outlet is a lot, mate.

  • @Connie_cpu
    @Connie_cpu Před rokem +53

    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

    • @zyghom
      @zyghom Před rokem +8

      S2 has this for ages already, S3 as well ;-)

    • @Connie_cpu
      @Connie_cpu Před rokem +6

      @@zyghom Oh that's awesome! I've mostly been sticking to the chips on the lower end, so it's great to see this feature is now in one of the boards you can get for under $2 each

    • @joekinsella1203
      @joekinsella1203 Před rokem +4

      Another advantage of the ESP32 is the GPIO matrix which allows almost complete flexibility of which signal connects to which pin. The SPI wiring issue in this video could have been addressed without a hardware revision.

    • @phizc
      @phizc Před rokem +6

      ESPs are great. I wanted to experiment with making a joystick a while ago, but it turned out none of my arduinos supported USB HID.. I remembered I had an ESP (not sure what model atm). It too didn't have USB HID either though, so I ended up creating a Bluetooth joystick instead 😅. I found a sketch online and was up and running in less than an hour. It did turn out that the only potentiometer I had was for audio volume, thus logarithmic/exponential, so didn't make for a precise input device. Still a cool experiment.
      The "joystick" was a single axis input for a mining throttle in Star Citizen.

    • @Connie_cpu
      @Connie_cpu Před rokem +1

      @@chrisreynolds6331 That's awesome, Tasmota is really cool for tasks where you don't want to write your own application code from scratch. My builds are fairly specialized though so I'm writing code for them in Rust with ESP-IDF. I can deploy my code to the ESP32-C3 with a simple `cargo espflash --release` command

  • @thesimbon
    @thesimbon Před rokem +23

    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 😀

    • @EdHayes3
      @EdHayes3 Před rokem +4

      Was going to say the same thing! Follow their guide on it. I place mine at the edge of the board, and have the PCB vendor rout out the PCB under the antenna. 15mm clearance on either side I think is in the guidelines.

  • @abrarahmed1269
    @abrarahmed1269 Před rokem +20

    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!

  • @foogod4237
    @foogod4237 Před rokem +28

    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.

    • @SquintyGears
      @SquintyGears Před rokem +2

      For the massive wall of text you wrote, it's weird that you end up contradicting yourself. A tungsten lamp is a purely resistive load. Meaning 25 regular bulbs would be what they expect you to use.
      Well in general these are intended to smarten up lamps. They don't expect people to use them on their ac or fans because they think you should normally have that installed and not plugged into an outlet. They're made in China they don't think people live in decades old buildings in Europe.
      I don't know what you're trying to control through these but it just wasn't intended for that, i don't think it's really the fault of the specs they report.

    • @foogod4237
      @foogod4237 Před rokem +8

      @@SquintyGears No, that's a common misunderstanding, but a tungsten lamp is *not* a purely resistive load (at least the way the term is typically used in electrical engineering). This is why if you look closely, many components like switches will have a separate "normal" wattage limit and a (much lower) "tungsten" wattage rating listed.
      The reason is that the materials that incandescent filaments are made out of actually have a resistance that varies depending on the temperature. When they are cold (right after turning on), they actually have a fairly low resistance, and it's only as they warm up (and start glowing) that they settle down to their nominal resistance/wattage. That means that at first, they will actually pull substantially higher current (10 times or more) when they're initially switched on than they do after they're fully "on".
      So any components designed for switching "tungsten" loads like incandescent bulbs really need to be designed to handle substantially higher instantaneous currents than one would expect from the nominal wattage of the bulbs themselves.
      (And in my experience, people often do put these sorts of switches on things like pumps, fans, even sometimes things like refrigerators, etc, and then usually get annoyed when they fail after a few months of use, even though they never exceeded the power ratings the thing claims it's supposed to be able to handle...)

    • @SquintyGears
      @SquintyGears Před rokem +1

      @@foogod4237 a variable resistor is still only a resistor. I'm not confused about that part.
      I guess i see what you mean, they don't include the burst rating of the first 5s of short circuit current from turning on cold.
      That's the source of the arcs. That's why the contacts fuse.
      But shouldn't that only covers the material choice? because 5 bulbs doesn't trip anything pulling double breaker limit during the warm-up.

    • @dl5244
      @dl5244 Před rokem +4

      @@SquintyGears A typical "40 watt" tungsten filament bulb (120 volts) has a cold resistance of about 28 Ohms. If you apply 120VAC (0% THD) at 90deg phase angle, the peak applied voltage is ~170V. This means the peak power for a couple milliseconds (plenty of time for bouncing and sparks) is about 1kW. Averaged over the first half-cycle (8-10ms) it's still 500W. After many cycles the wire temperature and its resistance has increased to ~360 Ohm, so the average power dissipation is now 40W.
      Circuits don't "trip anything pulling double breaker limit during the warm-up" because breakers are designed with a time delay. Mechanical ones use a bi-metallic strip that (like the tungsten filament) takes time to warm up. Fancy new electronic breakers basically emulate this with a time-constant or i^2-t implementation.

    • @foogod4237
      @foogod4237 Před rokem +3

      @@SquintyGears I think your confusion is that "pure resistive load" actually has a specific meaning in electrical engineering, and it doesn't just mean "there are resistors involved". It actually means a load which behaves exactly the same as if a single, standard resistor were put in its place (that also means the resistance not change value over time, etc).
      The reason that tungsten loads don't generally trip circuit breakers, etc, is that the current spike is for only a brief moment when turning them on (it's actually only a fraction of a second, not even anywhere near 5s), and most breakers and fuses are actually designed to be fairly slow-acting (partly for this reason). This can cause a problem, though, if for example somebody replaces a regular fuse with a fast-blow type fuse in circuits involving incandescent lights, etc, because those often will blow in that situation when the more common slow-blow fuses won't.

  • @aleksandar4923
    @aleksandar4923 Před rokem +13

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

    • @NabilTouchie
      @NabilTouchie Před rokem

      i learned that the hard way

    • @pauldale260
      @pauldale260 Před rokem

      How about having the antenna at the edge of the main PCB, even hanging over the edge?

  • @cde875
    @cde875 Před rokem +42

    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

    • @RandomUser2401
      @RandomUser2401 Před rokem +1

      why exactly is it a problem to put the current measurement IC on the mains side and isolate the SPI? You anyways have mains voltage in there and the transformers seem like a ton of added build volume and BOM cost.

  • @ddavid2
    @ddavid2 Před rokem +1

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

  • @bentfishbowl3945
    @bentfishbowl3945 Před rokem +36

    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

    • @RandomUser2401
      @RandomUser2401 Před rokem

      why exactly is it a problem to put the current measurement IC on the mains side and isolate the SPI? You anyways have mains voltage in there and the transformers seem like a ton of added build volume and BOM cost.

  • @karthikrajagopal6162
    @karthikrajagopal6162 Před rokem +10

    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.

  • @crazyirishman121
    @crazyirishman121 Před rokem +29

    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.

    • @bansheedearg
      @bansheedearg Před rokem +13

      Zero crossing is 120 times per second and relays are mechanical. I used such a detector for triacs but a relay? Iffy.

    • @strehlow
      @strehlow Před rokem +3

      @@bansheedearg It could use a triac to switch the load directly.

    • @crazyirishman121
      @crazyirishman121 Před rokem

      @@bansheedearg Good Point

    • @tin2001
      @tin2001 Před rokem +4

      @@bansheedearg
      100. He's not in North America.

    • @fltfathin
      @fltfathin Před rokem +3

      @@bansheedearg doesn't have to be perfect, triacs detector is used to rearm the triac for every cycle but for relay you only to do it once every switching. even if you miss the timing by 3ms you still subject to ~30% voltage which creates smaller spark

  • @Farm_fab
    @Farm_fab Před rokem +1

    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.

  • @spaideri
    @spaideri Před rokem +4

    One thing to note that usually cheap relays are specced to AC currents or to a rather low voltage resistive load. In your tests you kinda have a capacitive load in DC.

  • @stevesfascinations1516

    I love your channel and the way you explain things in detail. I built a spot welder one time, and had the high power switching turn on at the zero crossing point so there was no current flow on switching and no arcing. I am surprised you did not do something similar.

  • @geddysciple
    @geddysciple Před rokem

    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.

  • @hoctrimededebutry8655

    Hello from Frankreich !! Once again a GREAT job 👌 I like your approach of problem and your methodology to resolve them. Thanks for sharing your thoughts, projects and tips !!

  • @twoliterturbo8hp
    @twoliterturbo8hp Před rokem +1

    You made a video about something I've been exploring over the past few weeks. Fantastic job and a great project!

  • @RomanoPRODUCTION
    @RomanoPRODUCTION Před rokem

    Great Smile implies Great DIY Project. Good Job GreatScott!

  • @mikm.6375
    @mikm.6375 Před rokem +4

    @GreatScott! I went trough this too. Realized that the sockets are built to a cost not a high standard. Id thought about moding them for higher load but the reality is they already sell them if you look hard enough on google & are willing to pay for it. Would also point out Outdoor smart plug applications tend to have the internals were after

  •  Před rokem +5

    Hi @GreatScott! , one way that I found that can help improve the relay sticking problem is using a zero crossing circuit to turn on or off the relay at the zero voltage of the sine wave of the main voltage, I believe the IC that you used have that functionality and improves a lot the arc problem ;)

  • @martin09091989
    @martin09091989 Před rokem +2

    There is one thing you could add also to such a divice, called zero point switching!
    It´s used in modern impulse switches and stairwell relais!
    Problem with modern contact materials are that the use of beryllium copper was baned some years ago, until then such problems where more or less unheard of!

  • @antonstolbunov6620
    @antonstolbunov6620 Před rokem +2

    Nice work. You could as well keep the old relay but add an NTC resistor in series with the load. This eliminates the inrush current capacitor charging problem. I did it with one nasty socket some years ago and it is still going strong.

  • @andi
    @andi Před rokem

    Really awesome project and the result was great! I did not know about the relay sticking!

  • @MCsCreations
    @MCsCreations Před rokem

    That's just brilliant, dude! Fantastic work! 😃
    And this way you can get data for almost everything in the house!
    Anyway, stay safe and creative there! 🖖😊

  • @dodutils
    @dodutils Před rokem

    Know I finally understand why so many remote controlled sockets dies and I needed to open the socket box and replace the relays ! Thank you !

  • @Sekir80
    @Sekir80 Před rokem +6

    Oh, I thought the solution will be solid state relays. But, as it wasn't the case I learned something new about relays. Thanks Scott!

    • @Alan123456789876543
      @Alan123456789876543 Před rokem

      A solid state relay as 1-st phate of turning-on and after it should be crossed by a normal relay. Well, there is already 3.3V PSU, so why can't be used both? Pretty simple in my opinion and NO sparks on connect (on disconnect - still possible - need tests).

    • @limtbk
      @limtbk Před rokem +1

      @@Alan123456789876543 on disconnect just turn off normal relay, and then solid state. Agree with you, this will work.

  • @LordPhobos6502
    @LordPhobos6502 Před rokem +5

    Ok, I'm curious... Scott, what are your thoughts on solid state relays?
    I've used some DC driver solid state relays on arduino projects, on the theory that solid state won't weld contacts, I know AC driver solid state relays are a thing, but I've never used them.

  • @galangtirtayudha3973
    @galangtirtayudha3973 Před rokem

    Glad to see you are finally use your DIY T12 Soldering Station :)

  • @allezvenga7617
    @allezvenga7617 Před rokem

    Many thanks for your sharing
    That is what I am searching for

  • @fr33dumb0
    @fr33dumb0 Před rokem

    such a cool concept for a series as I think the same way

  • @BrotUndSaft
    @BrotUndSaft Před rokem

    Great video as always, I am a big fan of JLCPCB for my DIY Projects.

  • @nonchip
    @nonchip Před rokem +4

    by the way since you're already monitoring mains you could also make your relay switch in a very low current part of the waveform to extend its lifetime even further (this would also prevent arcing on disconnection of inductive loads for example, not necessarily catch _all_ the inrush current though, but should definitely make it "nicer" / less spikey).

  • @DJW3lch
    @DJW3lch Před rokem +39

    Great project! I had no idea how much extra work went in to voltage and current monitoring. I wonder if it would be possible to precisely time the relay turning on and off to match the current waveform you showed. If you were able to reliably switch the relay at the 0 point of the current cycle, then theoretically you wouldn't have to worry about arcing or welding of the contacts.

    • @greatscottlab
      @greatscottlab  Před rokem +13

      Definitely worth a try :-)

    • @PNWZombieWatch
      @PNWZombieWatch Před rokem +6

      I was going to mention the same. Mr Carlson's Lab did a similar upgrade on a refrigerator light that used a zero crossing circuit to prevent the inrush/arcing. It didn't use relays but could probably be used as a starting point.

    • @oddzc
      @oddzc Před rokem +4

      Just use a zero crossing SSR.

  • @millomaker
    @millomaker Před rokem

    Great project 😊
    And happy to see that we can also repair the cheap smart sockets with a better relay.
    I think a awesome project could be to do that with each port of a power strip

    • @Henry-sv3wv
      @Henry-sv3wv Před rokem

      @Annette Singleton Steele i prefer to invest in drugs

  • @Maisonier
    @Maisonier Před rokem +1

    Amazing as always. Greetings from Argentina.

  • @arshiajalali3622
    @arshiajalali3622 Před rokem

    This video was great! The quality of your videos continue to improve. I do miss EasyEDA though.

  • @KaylaJoyGunn
    @KaylaJoyGunn Před rokem +1

    Love your series, thanks you so much for sharing with us

  • @john_hind
    @john_hind Před rokem

    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.

  • @Wrublos212
    @Wrublos212 Před rokem +2

    I thought it gonna be solid state relay switching at the zero crossing of the mains. It would be also beneficial in scenario where you have 5 PSU under one socket. It popping 16A circuit breaker if you hit peak mains voltage when turning on. Great job with DIY smart socket :)

  • @RedstoneHair
    @RedstoneHair Před rokem

    I wanna be like you, you inspire me so much!!

  • @henkdevries2971
    @henkdevries2971 Před rokem

    Interesting video 🤩
    Looking forward to an in-wall edition 😇

  • @kreinova2747
    @kreinova2747 Před rokem +1

    yes ! this just solved my curiousity !!! i know them are Planned Obscolescence as i bought 4 of them and they just dead and yes, they have that pop sound always

  • @chrismalone3980
    @chrismalone3980 Před rokem +1

    I did this by simply buying a $1 power socket and rewiring it to a hlk relay and ESP breadboard. Would love to see you redo it that way with your circuit

  • @zyghom
    @zyghom Před rokem +3

    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

  • @inventorkr1
    @inventorkr1 Před rokem

    You are creative I salute you for this wonderful work✅✅

  • @AlexanderHrabovy
    @AlexanderHrabovy Před rokem +1

    You can try designing a hybrid relay switch combined with triac: to power on some consumer, first the signal comes to a triac, which opens at zero cross point and only after that a signal to relay is sent. And the reverse process is used to cut the power. Thus, we receive highly efficient arcless relay work. The only drawback is necessity of extra circuit controlling components.
    I've already implemented such device using ESP 8266 for automatic heat control, and it works as expected.

  • @deviantstudio
    @deviantstudio Před 8 měsíci

    this is so cool! i really tired of crappy sockets from aliexpress. most of the time they are non-esp so can't be reprogrammed with tasmota or similar. sometimes they just don't work or work only via Chinese cloud. the idea of opensource reliable wifi socket is flying around for years. i really glad that somebody finally did the good job on it. btw 3d printed case is amazing too!

  • @tommyle628
    @tommyle628 Před 10 měsíci

    very good explanation, I revisit this video again after studying Ugreen power strip teardowns on a Chinese website, apparently Ugreen uses the relay that has AgSnO2 as the contact material as you explained to reduce sticking, thus I know they do care about quality.

  • @troublehd7236
    @troublehd7236 Před rokem

    Cool project, incredible content quality

  • @priyanshubhagat6002
    @priyanshubhagat6002 Před 9 měsíci

    Hey wanted to know did you make the breakout board for esp8266 yourself, if yes then can you share the schematic and layout design please. And if not then can you give some insights on how to do so.

  • @phillipmugisa3065
    @phillipmugisa3065 Před rokem

    Hello, thank you for the video. I am inspired by your understanding of electronics. What advice would you give someone trying to pursue that journey without doing an electrical engineering course? Thank you.

  • @juniorjunior7179
    @juniorjunior7179 Před rokem

    Great topic.
    This "fragility" is part of planned obsolescence...
    I made my own system a few years ago and it still works great.
    Here in Brazil people have been doing home automation with low quality "smart devices" without worrying about safety and this is dangerous.

  • @argoscerberus
    @argoscerberus Před rokem

    love to see how much you enjoy making your video :D

  • @pyrobeav2005
    @pyrobeav2005 Před rokem +9

    The 3d printed mains enclosure concerns me. There are many considerations given to fault containment and flammability in rated (UL) enclosures that may or may not be covered by a print. Many (most?) molded enclosures are ABS or polycarbonate same as could be done on a 3d printer, though I was under the impression that they have flame retardants added. *After a quick search you can in fact buy flame retardant ABS filament, neat! That being said, there are no shortage of sketchy, unlisted devices that don't end up burning your house down, so in all likelihood it's probably ok.

    • @deterdamel7380
      @deterdamel7380 Před rokem +2

      There're some other filaments out there. For example INKRAYON Glass (PEN-PET, like PETG), UL94V-2. Sometime you can get it for a very low price on ebay(DE/EU). But's transparent.

    • @nagi603
      @nagi603 Před rokem +2

      @@deterdamel7380
      > But's transparent.
      For some of us, that's an improvement :D

    • @deterdamel7380
      @deterdamel7380 Před rokem +1

      @@nagi603 Yes, we have nothings to hide there. And the color of this filament is very nice, too.

  • @ytHUNTR
    @ytHUNTR Před rokem

    Gute Besserung :) Great Video as always :D

  • @mortimersnead5821
    @mortimersnead5821 Před rokem

    My aquaponics system has an ac pump that I control with an Arduino. Every mechanical relay I tried would eventually stick in the on position. A month ago I switched to a solid state relay, and it's been fine so far.

  • @GoofyChristoffer
    @GoofyChristoffer Před rokem +9

    Very cool! Will you be sharing the BOMs and Gerbers for this project? My preferred smart socket is completely sold out, but I need more of them. Also, an inline cable design might be cool.

    • @greatscottlab
      @greatscottlab  Před rokem +6

      Yes. Of course. I will share all the information. Coming soon😁

    • @MartinBalle7
      @MartinBalle7 Před rokem

      I only have one concern. As you said in the video we are dealing with mains voltage. There are codes and standards the normal manufacturers have to follow. Depending on the country you live in, it may not be up to code.

  • @fiveleafcloverfpv4445

    Great idea to put in the power consumption.
    Never had issues with sticking contacts.

  • @catchmypoint6756
    @catchmypoint6756 Před rokem

    Hi Scott have a great Sunday

  • @Electronzap
    @Electronzap Před rokem +2

    It's amazing how many problems are solved with a well placed smack :)

  • @stepheneyles2198
    @stepheneyles2198 Před rokem

    Nice project, thanks for sharing!
    Only thing I'd like to ask is the power consumption figures - it seems that the W and VA values for both states are transposed? Or have I missed something? (@ 11:39 in the video)

  • @Drxxx
    @Drxxx Před rokem

    amazing channel! 😍😍😍😍 super video

  • @Teleport73
    @Teleport73 Před rokem

    Wow. Nice solution and you taught me something about relays. It's sad that the market for these goods is all about the lowest possible price, to the detriment of longevity and creation of waste.
    My only recommendations are to maybe add a manual override switch to the case and also check that the case material is of a suitable type and thickness
    to be safe, in terms of both electrical insulation (double) and flammability.

  • @jsecret9459
    @jsecret9459 Před rokem +2

    Great video ad always. Would have liked to see an explanation of a diode across the relay to decay the avalanche properties of the coil discharge.

    • @greatscottlab
      @greatscottlab  Před rokem +2

      I talked about that in previous electronics basics videos ;-) Check them out

  • @PriyankaMajumdarOfficial

    It's a great educational video! I just wanted to share a data with you, you might know also that the enclosed air-tight relay are basically spark-protected by its design. Inside the air-tight encloser, their are no Oxygen available to make a spark/fire. Because the fire triangle is broken here. That's why it's fill with some inert gas like N2, it may be welded together if really high current passes through the contact point(Over 2-3 times of rated current).

    • @foogod4237
      @foogod4237 Před rokem +5

      I think you have some misunderstanding of the basic physics of electrical arcing. Electrical arcing is not actually fire, and it does not require oxygen (or any combustible material) to occur. What you see when electricity arcs from one contact to another (and what causes much of the damage) is the ionization of the gas molecules into an incandescent plasma. This can happen with any gas, even completely inert ones (this is actually the same thing that happens (in a controlled way) in flourescent and neon lamps, etc, which also have no oxygen in them).
      Removing oxygen can prevent oxidation of the relay contacts (which can lead to high resistance and relay failure), but it does not prevent the arcing itself, nor does it prevent the high heat of the arc which is what results in relay contacts ultimately fusing and sticking together in these sorts of scenarios.
      Also, hermetically sealed relays are actually not that common, and are usually substantially more expensive. Most common relays are not actually sealed in any way that can keep oxygen out to begin with.

    • @PriyankaMajumdarOfficial
      @PriyankaMajumdarOfficial Před rokem

      @@foogod4237 May be you are right...

  • @bivekkarn4771
    @bivekkarn4771 Před rokem

    Great video 👍
    I was wondering why didn't you use a static relay?

  • @zer0net
    @zer0net Před rokem

    Great video as always. why not use a solid state relay (SSR)?

  • @per995
    @per995 Před rokem +1

    I have for many years done service on ultra low temperature freezers. The main problem was sticky relay contacts for the compressors duty relays.
    The worst working relays was with long contact legs and two poles.
    The speed and torque of the switching is so important.
    In the last 15 Years s the relays was changed to a single pole Potter and Brumfield that never let me down. Those small 25amp had one big diameter curved contact side and the other a smaller that rolled a little to the side on every action. The duty cycle of every 15 minutes 24/7 and never made a failure. The sugar cube sized beauties was awesome in function. The ones to try on heavy load and frequent duty😊

  • @Pippy626
    @Pippy626 Před rokem

    Love the videos look into a Shelly 1 they are 19$ (they have other versions too and work with home assistant and other apps. This doesn’t have a enclosure but it goes behind plug or in a project like yours has Wi-Fi and Bluetooth around 1watt waiting

  • @josephlunderville3195

    If you are taking on the complexity of measuring the power at the ESP anyway, you can add a zero crossing detector and switch the relay on/off close to the zero to minimize sparking as well.

  • @timberthewolf733
    @timberthewolf733 Před rokem

    I have had great luck with my Kasa smart outlets, after 4 years of use i haven't had any issues.
    ...But I am only running lights and lower power items.
    I have one on my window AC, no issues so far but good to know I should keep an eye on it.

    • @timberthewolf733
      @timberthewolf733 Před rokem

      They are $20 USD each so definitely more expensive.
      I try not to cheap out on something that controls mains power in my home.

  • @7GIGEO7
    @7GIGEO7 Před rokem

    Hey Scott, you seem to be using JLCPCB for quite a while now.
    I was wondering if there is an option to order with the VAT and DUTIES/CUSTOM costs precalculated (EU). Cause really don't wanna mess with those procedures...
    Thank you for the nice tutorial.

  • @robinholmes785
    @robinholmes785 Před rokem +1

    With the power monitoring, is it possible to add a programmable fuse and/or current limiting feature??
    that would a very interesting video??

  • @ukrlan4414
    @ukrlan4414 Před 8 měsíci

    Coul it be possible to make "soft start" or delay time, somehow, 220/240 AC power delivery, so relay would be "ready" with already connected contacts?

  • @kataseiko
    @kataseiko Před rokem +3

    I would love to see your comparison between what JLCPCB offers in 3D printed parts and what you can create at home. I have used their 3D printed parts in the past and I am quite happy with them, especially compared to the quite a bit lower quality of the parts from my own 3D printer.

    • @HiruS22
      @HiruS22 Před rokem +1

      I’ve done this too where I need a hard wearing part, print in PETG on my Ender and order it online in Nylon once I’ve tested my prototype works/fits well

  • @PotatoClips
    @PotatoClips Před rokem

    What do you think about triac optocoupler circuits (deconstructed solid state relay) to control mains power? Smaller, silent, no sparking. I hardly see it used anywhere. I have my own DIY board with it and it works great (as far as I can tell).

  • @therandomguy7738
    @therandomguy7738 Před rokem +1

    Great Scott to the rescue again✨

  • @bansheedearg
    @bansheedearg Před rokem +2

    I did something similar, twice. Parts: 4 gang outlet box, populate with 4 dual outlets and a 4 gang plate. Recycle a power cord from something heavy. Inside is an 8-relay board from SainSmart but any relay board will do. The brains is a Raspberry Pi using the Wiring Pi to switch the relays, which are connected to the outlets. Use a USB charger and a 6 inch usb cable to power the rPi. The pi has a USB wifi adapter for communication. Finally I use the web server on the pi and CGI scripts (and some SUID scripts) to turn outlets on and off. I use it for Christmas Lights, our lawn irrigation system, and to shut down an internet switch so the kids are not up all night. Putting it in a 4 gang outlet box means it is more like a chunky power strip than a single outlet. Very useful though and doesn't serve ads, require a subscription, or anything. Code can be found here: github.com/zettix/outlet

  • @jlucasound
    @jlucasound Před rokem

    Thank You for the Pix-elation! After all, this _is_ a Family Oriented Channel. 🤣😂🙂

  • @dgusw
    @dgusw Před rokem +4

    Hey, nice video! A solid state relay would also be an option in this case

    • @russthibault8800
      @russthibault8800 Před rokem

      specially if it has a zero crossing detection ckt built in

  • @msm2029
    @msm2029 Před rokem +1

    Ralph S Bacon's video #131 also goes over the relay damage and sparking and how to fix it using the snubber. Worth checking out.

  • @timobk14
    @timobk14 Před rokem +1

    Nice project. I also worked on a solution like this for years. So I think your solution is safe and the pirce is ok. But I think your standby power consumption is about 1-2W? Maybe you show us the disadvantage in a future coming video?

  • @electronics.unmessed
    @electronics.unmessed Před rokem

    Cool project!

  • @Alexander91
    @Alexander91 Před rokem

    Did you ever take a look at the Shelly devices? Comparable to your DIY version, the Shelly plug S is also based on ESP32, works with home assistant, has a relay and voltage/current measurement. I am not sure about the used relay, but never had any sticking up to now, although I have multiple ones that are switched many times per day.

  • @ZongyiYang
    @ZongyiYang Před rokem

    I'm curious about the selection of R7 in the schematic for the current sense burden resistor. At a turn ratio of 1:1000, a 20 ohm resistance would cause a differential voltage at 30A to exceed 250mV differential voltage spec for the CS5460A chip. The resistance needs to maybe be like 8.2 ohms. Also I suggest looking at the upgraded CS5463 chip as a drop in replacement.

  • @marshallscholz8629
    @marshallscholz8629 Před rokem

    Adding a zero crossing circuit, and also a triac to handle the surge then you close the relay slightly later to remove that extra ~2v of drop can extend the life nearly indefinitely.
    Though some arcing in relay contacts can be good. It clears off nonconductive oxide layers and makes a better connection.

  • @beehumble92
    @beehumble92 Před rokem

    Hi great Scott.
    I have a good video Idea for you to do!
    Get the biolite camp stove.
    A camp stove which has and inbuilt power bank that recharge with fire

  • @biggityboggityboo8775
    @biggityboggityboo8775 Před rokem +15

    Don't forget that smart sockets also have their own, always on, power draw!
    I thought you'd have gone with a solid state relay too.

  • @stratos7755
    @stratos7755 Před rokem

    You should've tested this agains the shelly relay. They are freaking amazing, as they fit behind your socket/switch and some support power monitoring.

  • @VolpeInCalze
    @VolpeInCalze Před rokem

    Have a peek at railway signal relays. So many different ones and for different applications. All analog. Pretty cool stuff. Studied it for 4 years

    • @analoghardwaretops3976
      @analoghardwaretops3976 Před rokem

      Railway signalling relays is another wholly different ball game specially for signalling apps...the handle much lower currents and are deliberately designed to be slow acting.
      mostly are made with(48Vdc ??) dc coil actuators..

  • @ArifKhan-bp9zx
    @ArifKhan-bp9zx Před rokem

    Finally 😢😢 A DIY winner

  • @Ryuseigan
    @Ryuseigan Před rokem

    Awesome work making a more reliable plug.

  • @JAMP1865
    @JAMP1865 Před rokem

    Great! Nice tutorial. You can consider using an SCR instead and gain dimmer capabilities along the way, but you will need to deal with triggers or use an SCR driver

    • @greatscottlab
      @greatscottlab  Před rokem +3

      SCR also come with a bigger voltage drop.

    • @JAMP1865
      @JAMP1865 Před rokem

      I forgot to mention, I had to control a vapor generator with electrodes and ended using a solid state relay

  • @AnshumanFauzdar
    @AnshumanFauzdar Před rokem +4

    Very interesting and useful project!
    I have a small question - can a solid state relay be considered over electromechanical for longer life and compact design?

    • @greatscottlab
      @greatscottlab  Před rokem +3

      Yes. Should work longer. But also is a bit more inefficient since it comes with a voltage drop of 1V to 2V.

    • @AnshumanFauzdar
      @AnshumanFauzdar Před rokem

      @@greatscottlab Thanks for replying!
      That's a good point to consider ☺️

  • @jlucasound
    @jlucasound Před rokem

    Hey Scott! It's "Next Time"!! 😄😀