Smart plug with power monitoring design issue - Page 1
Forum section: electronics / projects

author: fedimakni
author_rank: Regular Contributor
timestamp: June 08, 2021, 09:06:14 am
content: Hello,I am planning to design a smart plug with a power monitoring feature basing on the design of either Texas instruments (https://www.ti.com/tool/TIDC-CC3200SMARTPLUG) or microchip (https://www.microchip.com/developmenttools/ProductDetails/adm00642).You could found the schematic design here (https://www.ti.com/lit/df/tidrfq8/tidrfq8.pdf?ts=1623143125395&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FTIDC-CC3200SMARTPLUG).The problem that i am facing right now is that those devices require a specific wiring to both neutral and line wire which is very difficult to distinguish them in a non polarized plug like in Japan.I don't want that i need to verify using a specific tool which is the line and which is the neutral wire every time i want to plug my smart plug.Could anyone help me with any tips how i could solve this problem i am not very familiar with High voltage application as i always deal with low voltage and battery powered devices so this is a little bit complicated for me.Any information could be helpful. Thank you for your time.

author: tszaboo
author_rank: Super Contributor
timestamp: June 08, 2021, 09:48:28 am
content: Quote from: fedimakni on June 08, 2021, 09:06:14 amWhy, what happens if you swap them? Sure the GND in this circuit will be live, but other than that?

author: fedimakni
author_rank: Regular Contributor
timestamp: June 09, 2021, 01:33:28 am
content: Hello,Yes but at that time the 3.3V will not be referenced to the neutral it will be referenced to the live which will cause some problems right? I am not sure about that 100%

author: james_s
author_rank: Super Contributor
timestamp: June 09, 2021, 05:25:36 am
content: It shouldn't make any difference at all, AC has no polarity inherently. The reason there is a live and neutral in domestic wiring is that one side is tied to earth ground, that makes a difference when it comes to safety when there is any possibility of a user getting in contact with part of the circuit but in an enclosed system it doesn't matter.

author: fedimakni
author_rank: Regular Contributor
timestamp: June 09, 2021, 08:43:33 am
content: But actually there are a lot of devices which work with AC but require specific direction of connection like lamps and you could note swap them like that. The smart plug also has the same logic so that's why i am asking.

author: Alti
author_rank: Frequent Contributor
timestamp: June 09, 2021, 08:54:00 am
content: I took a look at TI SimpleLink CC3200 smart plug reference design that you linked.The schematic inpdf.I was trying to find the "a specific wiring to both neutral and line wire" and I still cannot pinpoint the problem you describe. However (review):- This design is powered by isolated flyback (via T1) but it has Neutral tied to uC GND (via R24+R34)I do not get the idea behind that. From safety point of view this is no different than capacitive dropper or an offline buck. I suggest you shouldnotuse this reference design for any beginners touching.- The VSENSEP and VSENSEN have common mode set the wrong way. These two voltages are fed to LMV324 (in differential opamp arrangement). The problem is that VSENSEN is tied to neutral (thus GND) and VSENSEP is bouncing +- 0.6V around it. This is a flaw, common mode of LMV324 is from 0 to Vdd and this design artificially attenuates mains voltage to some tiny amplitude and then drives LMV324's inputnegative! Common mode should have been set around 3.3V/2 and then there would have been no need for such attenuation and diff opamp.- There is a huge varistor across mains supply. So this is not a reference of a smartplug but rather a smartplug with built-in surge arrestor. Poorly designed because S20K275 kicks in when R32+R6 are already dead (standard 0603 resistors withstand only 100V on overload).EDIT: I do not understand the supply scheme of this design. LMV324 is powered between "VCC" (3.3V wrt GND) and "-3.3V" (which is -3.3V wrt GND) which is 6.6V total, way above absolute maximum rating of 5.5V for this device

author: fedimakni
author_rank: Regular Contributor
timestamp: June 09, 2021, 09:10:18 am
content: Hello,Yes you are right. That's why i got confused i even asked them and they said they don't support this design anymore but why it still available when it contains a lot of problems. The connection between neutral and gnd using 0 ohm resistor confused me a lot too.Do you have an idea how i could fix the issues with the design?Thanks for your time.

author: Alti
author_rank: Frequent Contributor
timestamp: June 09, 2021, 09:54:10 am
content: Quote from: fedimakni on June 09, 2021, 09:10:18 amI am afraid I don't. The problem here is that I do not understand why would someone used isolated converter and tied GND with mains.Even when we say "neutral", we do not really mean "voltage close to earth potential" because that depends on plug orientation and earthing system. Even in systems with polarized plugs (UK) it is forbidden to expose neutral to touching. From safety point of view there is no difference if you touch neutral or if you touch phase conductor.So this reference design is a big mystery. Donottry to remove the 0R link and touch GND because three resistors across are 0603 and won't survive 230V*sqrt2 and could never, ever deal with 700V this varistor works at.A Wifi meter does not really require isolation if it does not expose parts to touching. Then it can be sitting in a plastic box (class 2 appliance), does not have to deal with transients in a safe way, a lot of things get simpler. But it is PITA to do a development of such thing - if you want to go that path, do the development behind a transformer isolated 24VAC with same currents but lower voltage, do the tuning and testing and then at the last stage swap several components to 10x voltage rating.The isolated design is more pleasant to develop because you can touch this low voltage, use scope, debugger, etc. However, you have to provide current and voltage signal through the high voltage barrier. This can be made optically or by using resistors or some other sensors. As for voltage, resistor divider is a good path but forget about three 0603 resistors dividing your finger and live conductor. The product needs to withstand rated impulse withstand voltage which for CAT II appliances and 240VAC is 2.5kV! As for currents, you could use ACS712 for example.First you need to decide which path you want to take.

author: james_s
author_rank: Super Contributor
timestamp: June 09, 2021, 08:34:10 pm
content: Quote from: fedimakni on June 09, 2021, 08:43:33 amCan you show me such a lamp? I've never seen one. If a device is isolated from earth, it can't tell the polarity of the AC line. Try measuring a wall socket with a HV differential probe on a scope, it doesn't make any difference to the display which probe you put in which terminal.

author: fedimakni
author_rank: Regular Contributor
timestamp: June 10, 2021, 08:15:20 am
content: If it's as you say, so in that case you can swap line and neutral how ever you want and that doesn't affect anything so why there are polarized plug in the US and why it's a must to wire them in a specific direction. I heard about a lot of people which come to japan with devices made in the US and when they connect them to japanese plug it let's the device fail because the design require a specific connection.Try to check the refernce design from microchip the line terminal is connected to vcc of the uC i already asked them about that and they said you could not swap line and neutral because it will not work. so here's an example.

author: The Soulman
author_rank: Super Contributor
timestamp: June 10, 2021, 10:33:28 am
content: Quote from: james_s on June 09, 2021, 08:34:10 pmCorrect but onlyIf.Some devices only have good isolation between phase and earth and not so good between neutral and earth because therewouldn't (shouldn't) be a large voltage between those.

author: james_s
author_rank: Super Contributor
timestamp: June 10, 2021, 05:46:36 pm
content: Quote from: fedimakni on June 10, 2021, 08:15:20 amPolarized plugs are a safety feature, nothing more, equipment will work just fine if you replace the plug with a non-polarized type. In some cases like old audio gear you might get hum in the speaker if it's plugged in the other way around because the neutral side is tied to ground. With a polarized plug you can install the switch on the live side and then when the switch is off there is no voltage present in any of the circuitry, if the switch was on the neutral side then switching it off leaves everything live. With an ES light socket the shell should be neutral and the contact in the bottom live, otherwise a partially unscrewed light bulb could have an exposed shell that is live. The bulb will work perfectly fine wired the other way around but it is a safety risk. Think about it, AC means alternating current, the polarity reverses 100-120 times every second (50-60 complete cycles), the only difference between live and neutral is that neutral is tied to earth ground for safety reasons. The terminals coming out of an isolation transformer are indistinguishable.