What does this diode do? - Page 1
Forum section: electronics / beginners

author: vmallet
author_rank: Regular Contributor
timestamp: July 15, 2020, 05:47:07 pm
content: I am looking at the insides of a cheap wifi smart plug and trying to understand the power supply circuitry. It seems to be using a MP150 (Offline primary-side regulator) by MPS (datasheet:https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP150/)From what I've been able to tell they are using a design that is really close to the reference design on page 16 of the linked datasheet. Here's a screenshot:The question is about diode D4 that returns to the Neutral wire. Is it strictly needed? What does it bring to the picture, and what would happen if we got rid of it?The reason I am asking is that when I was looking at the smart plug's PCB, I was confused by a couple of things about that same diode (labeled D5 on the PCB):*) the silkscreen around D5's footprint shows no indication of orientation which is quite unusual for a diode*) the diode itself has an unusual shape, with no markings whatsoever (so how do you figure out orientation?)*) after removing D5 from the PCB and testing, it appears D5 is not a diode but just a straight jumper; Ohmmeter reads about 0 Ohm.Here's a picture of the PCB showing the D5 footprint, and the actual D5 component sitting on the trace right to the left of the D5 footprint:Did they initially intend to have a diode here like in the reference design but eventually chose to replace it with a 0 Ohm resistor for costs? or for some other reason? Or is there something else that I am not seeing right here?Thanks for any insight..Vince.

author: sahko123
author_rank: Frequent Contributor
timestamp: July 15, 2020, 06:43:18 pm
content: D4 is used as a rectifier to get the negative rail of the powersupply

author: wraper
author_rank: Unknown
timestamp: July 15, 2020, 06:50:31 pm
content: Quote from: sahko123 on July 15, 2020, 06:43:18 pmIt's already rectified by D2. Also there is no negative rail. Only positive rail and GND.

author: exe
author_rank: Unknown
timestamp: July 15, 2020, 07:19:56 pm
content: Looks redundant to me, unless for some reason they need to lift ground one diode drop above N, which is unlikely.

author: bob91343
author_rank: Super Contributor
timestamp: July 15, 2020, 07:41:51 pm
content: It may be a fuse rather than a diode or jumper. That circuit is not good, as it provides no isolation. Isolation is important much of the time.

author: Monkeh
author_rank: Super Contributor
timestamp: July 15, 2020, 07:44:24 pm
content: Quote from: bob91343 on July 15, 2020, 07:41:51 pmIsolation is not required for the application. Pissing money and space away for no gain is not good.

author: Syntax Error
author_rank: Frequent Contributor
timestamp: July 15, 2020, 07:52:57 pm
content: What happens if the live and neutral are wired the other way round in the domestic power socket? Or the power socket is one of those odd european ones that can be plugged in either way around? Is D4 some reverse protection feature?

author: exe
author_rank: Unknown
timestamp: July 15, 2020, 08:11:38 pm
content: Oh shi~, this thing is meant to be plugged into mains?? I'd dump it immediately. Here is a good reading about dangers of non-isolated power supplieshttps://sound-au.com/articles/power-supplies2.htm#s7

author: wraper
author_rank: Unknown
timestamp: July 15, 2020, 08:19:17 pm
content: Quote from: exe on July 15, 2020, 08:11:38 pmIf it's used in a fully enclosed device, say smoke detector, there is nothing wrong about it.

author: Monkeh
author_rank: Super Contributor
timestamp: July 15, 2020, 08:29:03 pm
content: Quote from: exe on July 15, 2020, 08:11:38 pmWhile we're at it, let's stop using ovens, washing machines, dishwashers, and all the other devices which use non-isolated supplies.

author: capt bullshot
author_rank: Super Contributor
timestamp: July 15, 2020, 08:40:05 pm
content: Quote from: vmallet on July 15, 2020, 05:47:07 pmThat diode (together with D2) disconnects the circuitry for most of the phase angle from both lines of the mains supply. I guess it's supposed to help with EMC and common mode interference. For the primary purpose (rectification of the mains) it's not strictly required and the circuit should work with D4 shorted.

author: james_s
author_rank: Super Contributor
timestamp: July 15, 2020, 10:01:55 pm
content: Quote from: wraper on July 15, 2020, 08:19:17 pmIt says right in the first post that it's a WiFi smart plug, so fully enclosed commercial product. Non-isolated supplies are commonplace in this sort of thing, many are just a capacitor dropper.

author: bdunham7
author_rank: Super Contributor
timestamp: July 15, 2020, 10:47:34 pm
content: Does this have a three-wire plug with ground, and if so, does that ground pin connect directly to the point in the circuit indicated by GND? If so, I hope everyone tests their sockets for correct wiring before plugging this in!

author: bdunham7
author_rank: Super Contributor
timestamp: July 15, 2020, 10:50:30 pm
content: Quote from: Monkeh on July 15, 2020, 08:29:03 pmYou can have isolated, isolated with ground reference or non-isolated, but you can't have non-isolated with an internal ground reference. Some older kitchen ranges allowed something like that, but they've since thought better of it.

author: wraper
author_rank: Unknown
timestamp: July 15, 2020, 10:51:53 pm
content: Quote from: bdunham7 on July 15, 2020, 10:47:34 pmGND is not earth. Only insane would connect earth to such GND. Not to say this circuit is from datasheet of a quite significant IC manufacturer.

author: wraper
author_rank: Unknown
timestamp: July 15, 2020, 10:56:53 pm
content: Quote from: bdunham7 on July 15, 2020, 10:50:30 pmPlease stop embarrassing yourself. GND is simply a 0V reference point you select and call it GND. For convenience, it's usually a negative power rail/or common reference point in the middle of rails with different polarity. Nothing to do with earth as such.

author: bdunham7
author_rank: Super Contributor
timestamp: July 15, 2020, 11:06:43 pm
content: Quote from: wraper on July 15, 2020, 10:56:53 pmI really do understand all that and obviously agree it would be bad practice to make that connection. However, if it is isolated, there's no need to draw it that way--it's just V+ and V-. I think it is unnecessary and a bad practice, at least for an actual component schematic. Since this is a Wi-Fi smart plug and IS NOT totally enclosed--it has outputs, I'd be curious as to how it is actually connected. I didn't see that it was a datasheet and not the actual schematic.

author: Monkeh
author_rank: Super Contributor
timestamp: July 15, 2020, 11:10:22 pm
content: Quote from: bdunham7 on July 15, 2020, 11:06:43 pmIt is absolutely normal to refer to your reference as ground even if it's not tied to earth. And no, it is totally enclosed, none of the circuitry inside is exposed, nor are the contacts for obvious reasons.

author: bdunham7
author_rank: Super Contributor
timestamp: July 15, 2020, 11:20:41 pm
content: Quote from: Monkeh on July 15, 2020, 11:10:22 pmI'm perfectly aware that it is common to do so and no matter how many time I see it I still think it is a bad practice when applied to mains-powered devices that actually DO have a real earth ground.OP: Sorry if I crapped on your thread. I've no idea why D4 is there in the context presented. The simpler typical application schematic at the beginning of the datasheet doesn't have it. Perhaps the manufacturer of your device just copied the application schematic and later realized that D4 was unnecessary.

author: wraper
author_rank: Unknown
timestamp: July 15, 2020, 11:33:21 pm
content: Quote from: bdunham7 on July 15, 2020, 11:06:43 pmHell no, V- is not a 0V reference point. And circuits with isolation like SMPS are often drawn with 2 separate GND.

author: james_s
author_rank: Super Contributor
timestamp: July 16, 2020, 12:59:12 am
content: Quote from: bdunham7 on July 15, 2020, 11:06:43 pmIn the US it would be very rare for something like this to have an earth ground, if it does it will be a passthrough to the socket on it.I'm not sure what you're talking about in regards to outputs, of course it will have an output, but that will be a receptacle to plug a lamp or appliance into, not bare metal binding posts or something. It still counts as totally enclosed, nobody in their right mind would expect the receptacle on such a device to be isolated and safe to poke a paperclip into. By "totally enclosed" it just means that no user-accessible low voltage connections that could be at mains potential are exposed.

author: vmallet
author_rank: Regular Contributor
timestamp: July 16, 2020, 04:08:59 pm
content: Thanks for the answers. Bottom line D4 is not really necessary and they must have copied the design with the diode in there and eventually decided to do away with it; maybe it was too late to change the PCB so they just swapped the part with a jumper. The thing that doesn't add up in that story is the silkscreen for the diode footprint (D5 on the PCB) looks like that of a resistor, not a diode. If they could change the silkscreen surely they could have changed the footprint?The discussion about grounds and earth was useful too, there is always something to learn!The plug is definitely totally enclosed and seriously sealed too, it took some good effort to get to the PCB. I've also come to understand the danger associated with mains-powered devices like these and non-isolated power supplies, and there are a lot of them out there!Here's the plug:

author: exe
author_rank: Unknown
timestamp: July 16, 2020, 05:12:01 pm
content: Quote from: vmallet on July 16, 2020, 04:08:59 pmWhy so? Look at, e.g., sod-323 or melf packages, they are pretty similar it terms of foot-prints.

author: vmallet
author_rank: Regular Contributor
timestamp: July 16, 2020, 05:41:10 pm
content: Quote from: exe on July 16, 2020, 05:12:01 pmRight, the footprint is fine; it's the lack of orientation indicator on the silkscreen that makes me say that. If you look at the picture of the PCB in the first post there's nothing to tell us in which direction to put the D5 diode, vs. say D4 or D3 that have the usual silkscreen markings.

author: bdunham7
author_rank: Super Contributor
timestamp: July 16, 2020, 06:09:10 pm
content: Quote from: vmallet on July 16, 2020, 05:41:10 pmProbably just a sloppy process where one person laid out the PCB according to the reference schematic and then another 'thrifted' it and eliminated the unnecessary part but with minimal effort--replacing it with the jumper but still calling it D5. Who knows how this happens--you'd have to be there to know the story. Can you post a photo of the whole board? I'm just curious how it is laid out in that small a package.

author: exe
author_rank: Unknown
timestamp: July 17, 2020, 08:56:50 am
content: Quote from: vmallet on July 16, 2020, 05:41:10 pmAh, I see. Well, I've seen people designing their pcbs right in the router by placing footprints directly, without creating a schematic first. Some people prefer to use some weird and obscure pcb routers... I mean, I'm not surprised by weird-looking pcbs that don't match schematics.

author: David Hess
author_rank: Super Contributor
timestamp: July 17, 2020, 10:43:38 am
content: Safety regulations might require it not to fail destructively on the input if a part shorts in which case two diodes are used in series.

author: james_s
author_rank: Super Contributor
timestamp: July 18, 2020, 12:39:36 am
content: Quote from: exe on July 17, 2020, 08:56:50 amThat's a really dumb way to design a PCB in this era. Even back in the days where you'd draw the traces by hand or tape it out for production you'd start with a schematic. Trying to lay out a board without a schematic is putting the cart before the horse and is begging for errors to creep in.

author: vmallet
author_rank: Regular Contributor
timestamp: July 18, 2020, 02:33:03 am
content: Quote from: bdunham7 on July 16, 2020, 06:09:10 pmHere goes:I was working on a full teardown post that I finished today, many more pictures there if interested:https://vmallet.com/2020/07/gosund-wp3-smart-plug-teardown-and-schematic/

author: vmallet
author_rank: Regular Contributor
timestamp: July 18, 2020, 02:39:24 am
content: Quote from: David Hess on July 17, 2020, 10:43:38 amOh I see. Then is it safe to say that in the MPS design we could theoretically use just D4 to do the rectification (with D2 shorted) but it wouldn't be as conventional (or intuitive)?

author: Zero999
author_rank: Super Contributor
timestamp: July 18, 2020, 11:49:37 am
content: Quote from: bdunham7 on July 15, 2020, 11:20:41 pmIt's not bad practise at all. In cases where there are different grounds, they'll have different names. For example, the 0V rail of the circuit might be labelled as chassis or simply ground, whilst the connection to real earth will be labelled as PE or protective earth, which is the standard name in the EU. The nomenclature may vary, but as long as it's clear which connection carries current and which is required for safety, there's no problem.

author: bdunham7
author_rank: Super Contributor
timestamp: July 18, 2020, 02:39:05 pm
content: Quote from: Zero999 on July 18, 2020, 11:49:37 amIs it clear in this case? Or is it just obvious after looking at the circuit, provided you understand mains power as well? It was really the symbol and extra GND designation that got my attention in this case, along with the fact that this is explicitly a mains circuit with L, N, and G. If the only issue was one of the outputs being labeled GND I wouldn't have made a peep.There have been many discussions about what various ground symbols mean and I've understood them to mean this:However, that's not an authority. So I went and looked on the internet for 10 seconds and I learned something. There is an explicit standard.So, by this standard the reference diagram from Monolithic is, well, wrong. Perhaps an intern drew it. The problem jumped right out at me when I saw it and hopefully 99% of people that see it will quickly realize that the ground prong shouldn't be connected there--but perhaps some manufacturer somewhere will have another intern 'just implement the datasheet reference'.Here's how I think the reference diagram should look--leaving aside the original question of the extra diode.EDIT:There is a flaw in my argument, but I'll let someone else point it out if anyone cares...

author: bdunham7
author_rank: Super Contributor
timestamp: July 18, 2020, 02:51:18 pm
content: Quote from: vmallet on July 18, 2020, 02:33:03 amVery nice work and schematic! Also, that's quite a BOM for a $6 device.

author: SparkyFX
author_rank: Frequent Contributor
timestamp: July 18, 2020, 05:28:09 pm
content: I'd agree that in a steady state operation this would not make much difference for the functionality, which means it is either needless or for safety and protection.It's probably designed for the world market, which implies reversible mains plug. I wonder what happens to the charged capacitor if you plug it out and put it in reverse while its charged without D4.