SMPS mains to DC - Page 1
Forum section: electronics / projects

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 09:24:15 am
content: Currently I am using a linear PSU consisting of mains -> toroidal -> filter -> LM2679 DC DC - > 23.25V outputThe problems are (1) weight of toroidal transformer (2) very high off-load voltages (transformer regulation) (3) variations in main voltages eg when we turn the oven on...But the advantages are safety from mains voltages and currents present on the output (even though the toroidal itself has some inherent capacitive coupling).Has anyone constructed from first principles a mains to DC power supply and are happy with it? In particular how safe is it? Also is there a Y cap between the two windings of the transformer (because they always leak voltages and currents into the output) ? If you do have a good design would you please share it?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 21, 2015, 09:39:18 am
content: Is it really 23.25V exactly? Why so particular?If not, I'd say, but an off the shelf PSU. They're fantastic value (you can buy several for the cost of that transformer), and already cover all the filtering and safety you need.Tim

author: paulie
author_rank: Frequent Contributor
timestamp: March 21, 2015, 09:56:29 am
content: 12v 1 amp "security" DC-DC adapters are available from Ebay for $2 or even less if B.O. or bid. Fed into an LM2977 buck/boost (again $2) no problem generating 23.25v exactly. Safe and cheap. Of course if this is for educational or entertainment purposes then feel free to spend a couple hundred dollars and hours reinventing the wheel.

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 10:12:49 am
content: It seems I have misled with the 23.25V, it is not a strict requirement, I would like to produce around 23V-25V adjustable.The biggest concern is safety. I want a pure DC output, I do not want mains voltages present and very small capacity for failure, ideally none. Failure meaning full mains at the output, fire, shorts etc.There is a thread I started some time ago testing and discussing various laptop and ebay adapters - it reads like a horror story. I personally tested probably a dozen, some were branded Sony and other makes.The only other solution off the shelf is "medical" PSUs. But I have inquired and they also use Y-caps, typicallu two in series. And they are very expensive. And they could be nothing more than re-branded ebay PSUs with an extra Y-cap fitted. There is nothing I have found without the blue Y-cap.So my requirements are:1) mains input2) 24V DC output with some small adjustment3) totally clean DC output, no mains present4) very good build quality in terms of resilience to vibrations, heat, knocks and drops, even liquid damage.

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: March 21, 2015, 10:20:51 am
content: Quote from: akis on March 21, 2015, 10:12:49 amYou have to be more specific. Every power supply has some output noise, even a car battery.QuoteSo it is OK if there is 500mV pp output ripple @ 100kHz?Serious, you cannot select a power supply on such vague criteria.Define load regulation, line regulation, short circuit behavior, temperature rise on maximum load, isolation voltage etc.Once you have the specs, see if a PSU matches it.Do not even attempt to build a PSU yourself, because you haven't the faintest idea what you're going to build.

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 10:38:07 am
content: All PSUs I have checked, fail instantly at "10s or 100s of volts at the output" - this:https://www.eevblog.com/forum/testgear/laptop-power-supply-adaptors-mains-on-the-output!/15/No point in discussing load regulation and such if I have already got electrocuted.Main concern is SAFETY.The culprit, even on "medical" PSUs, seems to be the blue Y-cap - but it may also be a number of other reasons. In addition I have opened up a few adapters, some have wire or resistor links to the mains earth, some have links to earth but not soldrered, others have "earth" tracks but come with a two wire mains lead, really, everything goes. Many have less than 1mm distance between high and low tension tracks, others have dirt and debris in those tiny gaps. Everything goes.Obviously I have not tested everything - hense why I am asking here.If someone has already designed a SMPS they will have visited this issue and would know.

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: March 21, 2015, 10:55:14 am
content: Quote from: akis on March 21, 2015, 10:38:07 amYou brought up the point of "absolute no mains on the output" !QuoteAgain: define SAFETY!!1,5 KV/5sec isolation between mains and output, or 5KV/60sec ?? Perhaps 10KV/20min??Or is SAFETY the leakage to earth from the input capacitors? Or the stray capacitance between primary and seconday winding of the transformer?If the transformer has separate chambers, is that SAFE?You cannot ask for SAFETY, without specifying SAFETY!And SAFETY can mean a lot of other things. For example how the enclosure is constructed, how much temperature rise on full load, moisture resistance, etc.QuoteFWIW, I designed quite some PSU's

author: paulie
author_rank: Frequent Contributor
timestamp: March 21, 2015, 11:10:42 am
content: Quote from: akis on March 21, 2015, 10:38:07 amQuote from: akis on March 31, 2014, 03:47:33 pmQuote from: akis on March 31, 2014, 03:47:33 pmQuote from: akis on March 21, 2015, 10:12:49 amI think you are too easily frightened. Or maybe don't understand the difference between dangerous high current potentials and harmless bleed through. Even medical grade units will exhibit crosstalk if measured with high enough sensitivity instruments.I specially had to laugh at the guy who claimed 1k between mains and output on all Dell supplies. Probably had his meter set on the wrong range or more likely just trolling. I just checked 4 laptop bricks (2 Dell and 2 90w Ebay multivoltage universal) and all had no reading at all on the 2meg scale of my meter. All did show voltage with my 100meg scope probe which disappeared when loaded with 1meg resistor. Same thing for several cheap chinese 5v and 12v adapters.Also note that even if completely disconnected from the main the scope will show 160vac picked up from thin air. Maybe you should avoid "quality" bricks and stick to the cheapies. And don't forget to check under the bed for wolves.ps. Your complaint about medical grade being too expensive also seems a bit misguided. Certification if not quality costs.

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 11:54:03 am
content: There is no reason to be arrogant, sarcastic, condescending, and there is no reason to mock. This is a forum where people should try to be helpful.There are two main types of PSUs I have tested.First type have leaks at the output and they "fix" this by earthing the negative terminal. This is not good for me as it makes assumptions as to how I will use the negative terminal.The second type do not need an earth lead to operate and their outputs are floating which is great, but they still have a Y-cap or some other circuitry which links mains and output and present large voltages at the output wrt earth. Which gives me painful jolts, and I do not like it.Back to my original request, if anyone has made a switched mode PSU that does not leak at the output (so as to give me jolts) please let's discuss the schematic.

author: paulie
author_rank: Frequent Contributor
timestamp: March 21, 2015, 12:05:13 pm
content: Quote from: akis on March 21, 2015, 11:54:03 amIn addition to controlling phobias you might consider developing a thicker skin to survive on the internet. I do find the overly sensitive ladies entertaining though. And those who don't recognize help when they see it.As far as your "shocking" experiences it is most likely your mains are wired incorrectly. Quite common to see reversed hot or floating ground. This would only be noticed with 3 pin plug supplies like PC where there is cap and high value resistor between chassis and mains ground.

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 12:20:43 pm
content: Now you are calling derogatory names? "ladies", seriously?Are you saying that you can design a switched mode PSU which is not earthed, with truly floating outputs, and when wired correctly will not give me jolts?Please share your design, that is all I ask. If you have no design, then why waste time ?

author: paulie
author_rank: Frequent Contributor
timestamp: March 21, 2015, 12:37:19 pm
content: Well, to my credit, being a feminist, using the term "ladies" would not be recognized as an insult. But aside from the fact that comment wasn't directed at any one specific person I guess we can add gender sensitivity to the list.Regarding schematics I've created hundreds if not thousands in my career but not generally for things that are available off the shelf for far less cost and superior design. There are cases as hinted in my first post here where I re-invented the wheel for educational purposes but generally a limit. Rarely when it costs 100x more in time and money and of significantly inferior quality. Everybody has his quirks though so to each his own.

author: paulie
author_rank: Frequent Contributor
timestamp: March 21, 2015, 12:43:12 pm
content: Quote from: akis on March 21, 2015, 12:20:43 pmMore so I'm saying there is no such device commonly available that would do that. Not in a properly wired building. I do recall when moving into this location I did experience some "buzz" when touching certain appliances but there was never a danger of "jolts" or "electrocution" (your words not mine). After properly bringing up to code this disappeared. You really need to check your mains.

author: electr_peter
author_rank: Unknown
timestamp: March 21, 2015, 01:44:54 pm
content: Everybody, calm down a bit.In general, few points on the topic of mains electricity.The safest method is not to have mains at all.Electricity from mains leaksslightlyin many possible ways, no matter insulation, DC/DC converter type, floating or earthed, etc. After all, insulators are resistive materials with high resistance (resistor -> small leakage). There are also other ways for leakage.Potential dangers or issues with mains noise, overvoltage, lighting, ..., have to be considered.Grounding(earthing) is both safer and more dangerous depending on circumstances. Earth wire is metal conductor to mains supply, so it is certainly not for isolation purposes.The actual question is how much leakage you can tolerate because it was not specified. Without knowing exact requirements I can always claim that you do not haveperfectsafety (no matter what method you use) because I can use DMM with very high impedance to find half mains voltage...For best possible isolation use either batteries or electricity generator disconnected from mains. For less paranoid, understand what you are doing and design DC/DC converter according to initial specs.

author: Ian.M
author_rank: Super Contributor
timestamp: March 21, 2015, 01:45:38 pm
content: SMPSU adapters with two wire mains leads inherently have mains leakage on the output. Even if the design doesn't have any EMI suppression caps across the isolation barrier, you've still got the inter-winding capacitance providing an AC coupled leakage path.It is possible to design a floating output SMPSU with a three wire mains lead that is leakage free at the output, simply by having an grounded inter-winding screen, which removes the need for the troublesome EMI suppression cap across the isolation barrier. However if the supply ground connection is bad/missing, the result for both EMI and leakage is likely to be worse than a two wire supply. It is possible to add a circuit that monitors ground integrity and forces a shutdown if its missing, but that level of protection is rarely seen except in the most critical applications.TANSTAAFL - if you want a properly specified medical grade PSU with a fully isolated floating output, you have to use a reputable supplier and will pay a lot more for it, for the extra component costs, certification costs and because its development cost is amortised over much smaller sales numbers.It is quite possible to get a significant shock off equipment using two wire SMPSUs that isn't faulty, without any mains supply faults. All you have to do is interconnect enough of it (e.g. a complex multimedia home entertainment system) without any grounded system components. All the leakage capacitances end up in parallel and the current can reach dangerous levels (which is why communal aerial or satellite distribution systems *MUST* be bonded to ground - so you don't get shocked by the leakage current of not only your entertainment system but that of all the neighbours as well).

author: Zero999
author_rank: Super Contributor
timestamp: March 21, 2015, 02:14:20 pm
content: Quote from: akis on March 21, 2015, 11:54:03 amIt is true the tiny current is not a safety issue, unless it's to be used in medical applications or you have several power supplies connected together, so the current adds up. Any power supply (even an isolation transformer) will capacitively couple a small current between the primary and secondary.This is easy to fix by connecting both the positive and negative rails to earth via Y capacitors, so any mains leakage current is safely diverted to earth.In fact most industrial power supply modules which have an earth connection, as well as live and neutral, bypass the output rails to earth via Y capacitors so it's not a problem.It it's not practical to have an earth connection then using an isolation transformer is the only way to keep leakage to an absolute minimum, whether it be a 120V or 230V transformer before an off the shelf SMPs or a 12V or 24V transformer before a boost or buck converter.

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 02:39:20 pm
content: I just tested my linear PSU vs SMPS, and the SMPS has 10 times the leakages of mine. Mine is not particularly great either, because I use a toroidal transformer.So here are some figures:Is it possible to have a truly floating SMPS, without connection to earth, so that I can connect them in series and to other appliances in a chain without fear of shorts and other nasties, and that will leak less than 50uA RMS at 50Hz (measured over a 10K and a 100K resistor to earth)? (that is how much my toroidal, linear PSU leaks).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 21, 2015, 03:36:31 pm
content: You're getting a "jolt" from 50uA of mains?I don't care about what power supply you want, that's amazing. Would the local medical college be interested, or something? Like, an electrical version of hypersensitivty? Does that come with any other neurological attributes or is that really it?Tim

author: CM800
author_rank: Frequent Contributor
timestamp: March 21, 2015, 03:54:07 pm
content: If you care THIS much, here is what you do.Set up 2 lipo batteries with one being charged and the other powering the device through a step-up dc-dc converter, use an arduino and some relays to switch the batteries over when one becomes flat.you might as well be asking for a free-energy device that powers it, you won't be finding an SMPS with 'complete isolation from the mains'

author: prot_brot
author_rank: Contributor
timestamp: March 21, 2015, 04:04:02 pm
content: Quote from: akis on March 21, 2015, 02:39:20 pmIn general, the answer is no.If you want a really low leakage at the output, then you may choose a decent quality SMPS. The problem with quality SMPS is they will NEVER allow the secondary side to float completely. If you need a very low leakage, safe and completely floating output, then a standard 50/60Hz mains transformer are the only way to go. You don't have to use the expensive toroid one. In fact, a good EI core one with separate pri/sec windings on the bobbin can provide better insulation.

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 21, 2015, 04:05:25 pm
content: @akis, we know nothing about you except what you have written here. So it seems possible that our perceptions are completely incorrect.But, from what you have written here we are having a hard time trying to work out why you have such stringent and unusual requirements.And why your measurement methods seem to be different from the industry-standard techniques.If even the medical-spec solutions aren't good enough for you, then you should strongly consider using batteries (primary or rechargable)Of course, we don't know whether batteries are a viable solution for your project because you have not chosen to reveal the bigger picture.

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 04:07:06 pm
content: Quote from: T3sl4co1l on March 21, 2015, 03:36:31 pmWhere did you read that I get a jolt from 50uA? Suggest you first learn how to read, then get a 5 year old to help with the 10 times tables, then get an adult to explain to you what's written in this thread.Quote from: TCWilliamson on March 21, 2015, 03:54:07 pmWell I have tested 50uA and it is OK, it is not "complete isolation" - simple question, can 50uA be achieved with a SMPS?Quote from: Richard Crowley on March 21, 2015, 04:00:56 pmRichard : thanks.To be honest, all I am asking is if anyone has designed an SMPS that can achieve very low leakage. I gave 50uA as what my not-so-good linear PSU gives. I am sure I could improve using a non-toroidal transformer. That is all I am asking. Either you have designed one like that and you can also show me, or you have not, and then the questions "why would you ever want that" does not really matter.Quote from: prot_brot on March 21, 2015, 04:04:02 pm@prot_botThanks for the straight answer.

author: madires
author_rank: Super Contributor
timestamp: March 21, 2015, 04:53:04 pm
content: I'm not sure, but would an isolated DC/DC converter at the output of the SMPS help?

author: paulie
author_rank: Frequent Contributor
timestamp: March 21, 2015, 06:03:14 pm
content: Quote from: akis on March 21, 2015, 04:07:06 pmThere is no reason to be arrogant, sarcastic, condescending, and there is no reason to mock. This is a forum where people should try to be helpful.

author: IanB
author_rank: Super Contributor
timestamp: March 21, 2015, 06:09:59 pm
content: Quote from: akis on March 21, 2015, 09:24:15 amIt's not a "linear" PSU if you have a switching converter generating the regulated output voltage...

author: Ian.M
author_rank: Super Contributor
timestamp: March 21, 2015, 06:13:39 pm
content: Quote from: madiresNot much.A typical SMPSU rectifies the mains supply to get a HV DC bus then implements an isolated DC-DC converter to provide its output voltages. The only advantage cascading isolated DC-DC converters would have if it isn't possible to ground one side of the first one's secondary side, would be that the EMI suppression caps across the isolation barriers of the two converters would be in series.The EMI suppression cap from the negative side of the input DC bus to output common provides a return path for the leakage current at the switching frequency and its odd harmonics capacitively coupled from the hot end(s) of the primary winding(s), and without it there would be a large common mode voltage at the switching frequency superimposed on the output. As the switching frequency is typically three or four orders of magnitude greater than the supply frequency, it is easy to shunt most of the leakage back to the primary side while keeping the line frequency leakage an order of magnitude or more below what the HF leakage would be. However, this isn't the only way to solve the capacitive leakage problem. An inter-winding screen returned to ground if available removes all the capacitive coupling to the secondary side. If ground is not available, returning the screen to the -ve side of the DC bus will also work to eliminate the HF leakage, but wont eliminate line frequency leakage, but without the cap across the isolation barrier and with enough physical distance between the secondary and the screen, the line frequency leakage can be greatly reduced.The trouble is that the inter-winding screen takes up winding area, as does the extra thick insulation separating it from the secondary, invariably resulting in a larger, less efficient transformer, both from the loss of usable winding area for a given core size and the increase in leakage inductance in each winding due to the reduced coupling making it harder to drive efficiently.As I said earlier, reducing the mains frequency leakage costs serious money - whether its a custom medical grade SMPSU with an inter-winding screen and a fully floating output, or a line frequency transformer with an grounded inter-winding screen, or simply a line frequency transformer with split or seperate bobbins reducing the capacitance between primary and secondary. All will be larger, heavier and more expensive than a supply of equivalent ratings where no attempt is made to reduce capacitive leakage further than the minimum safety requirements.

author: oldway
author_rank: Super Contributor
timestamp: March 21, 2015, 06:16:07 pm
content: I have just measured the capacitance between primary and secundary of a toroidal (medical grade) transformer AMPLIMO ZN229 2x110V / 2x110V 4.55A with my Fluke 87V:1.65nFIt means: I = 119µA between secundary and earth with 230V 50Hz primary voltage

author: Ian.M
author_rank: Super Contributor
timestamp: March 21, 2015, 06:32:11 pm
content: You are assuming simple capacitive coupling between the live end of the primary and the secondary - not too bad a worst case assumption, as if the live end is adjacent to the secondary, the voltage drop across the first layer of the primary is not going to make a vast difference. However if you reverse the primary connections so that the neutral end is next to the secondary, the average voltage seen on the primary side of the inter-winding capacitance is only half the drop across a single layer of primary turns which will reduce the leakage current by at least an order of magnitude. The problem then becomes that of maintaining the preferred primary connection, which is impossible if the PSU has a two pin non-polarised plug or two wire power cord with a figure eight connector

author: Zero999
author_rank: Super Contributor
timestamp: March 21, 2015, 06:53:53 pm
content: Why do you feel you need such an insanely low leakage current?A leakage current of under 50µA would require an inter-winding capacitance of less than 692pF. This is possible using a transformer with the secondary wound on a separate bobbin.As mentioned above, it's very expensive to design a switched mode power supply with such a low leakage current and other things such as noise and efficiency suffer.Here's a like to a range of switched mode PSUs with a leakage current of under 0.5µA under normal conditions. The prices aren't shown but they're probably very expensive, compared to most cheap PSUs.http://www.jeromeindustries.com/products/medical/specialty-products/ultra-low-leakage/delta-epsilon.php

author: eneuro
author_rank: Super Contributor
timestamp: March 21, 2015, 07:34:26 pm
content: Quote from: akis on March 21, 2015, 09:24:15 amDatasheet of LM2679 says about adjustable current from 3A to 7A, so basic question is how powerfull this PSU should be since with 7A max we get 168W ONLY at 24V, and it is marked as 5A step-down, so around 120W which is two H4 car light bulbs in parallel @ 12V car batteryUse a two supercapacitors banks charge one of them from transformer galvanic insulated PSU, than quickly switch between them, so each of those two caps banks will not discharge too much, connect to third caps bank LM2679 DC DC input-since due to fast switching on "primary" caps will be no significant voltage drop between switches and 3rd caps bank will have some ESR, probably not too much current rush, but it can be limited by inductor anyway if needed.Note, this is a concept and didn't tried it yet, but working on balancer project now where a few batteries need to be charged using one bulky insulated transformer and smooth switching between two similar voltage charged batteries (huge caps) might work.Really in normal PSU operating conditions you need to touch this 24 VDC output all the time?Is it medical application?

author: Zero999
author_rank: Super Contributor
timestamp: March 21, 2015, 07:49:23 pm
content: Quote from: eneuro on March 21, 2015, 07:34:26 pmThe problem with the capacitor idea is noise, efficiency (without limiting the current in some way 50% of the energy transferred is lost) and how are you going to do the switching? Presumably old mechanical relays are a bad idea because the contacts would soon burn out and they won't be fast enough and solid state relays have a high leakage current so aren't much good either.

author: akis
author_rank: Frequent Contributor
timestamp: March 21, 2015, 07:53:14 pm
content: @Hero999:I measured earlier today 47.3uA on my own PSU which have been using for months without any issues (no jolts) unlike a variety of SMPS I have used in the past. Maybe 47.3uA is insanely low, I have no idea. I would think it is terrible considering my outputs are floating, there is no earth caps or links anywhere (actually there is no earth lead), and the toroidal is not exactly the best to use for isolation.@Ian.MThanks for your very elaborate explanations, would you by any chance have any schematics of "better than average" or "home made medical grade" SMPS we can use as a starting point?@eneuroYes it is a medical device working almost 24/7. I am drawing around 1.3A-2A at 24V DC output continuously and I use two in series (so 24V + 24V = 48V @ 2A == 96W)I have to re-read the rest of your comment to try and understand what you are suggesting

author: Zero999
author_rank: Super Contributor
timestamp: March 21, 2015, 08:03:00 pm
content: Quote from: akis on March 21, 2015, 07:53:14 pmIf it's working and you're satisfied with it then why change? It sounds like a good solution to the problem.The reason for the leakage is the inter-winding capacitance of the transformer. The primary and secondary windings act like two plates of a capacitor, coupling some of the primary voltage to the secondary. When you think about the area between the two windings a leakage current for 47.3µA seems very good.It's not possible to get the leakage current down to zero. If you set the meter to measure AC voltage, connect one meter probe to earth and hold the other in your hand, you'll find it reads tens of volts. You can then use the meter's input impedance to work out the current flowing into the meter and then your impedance to the mains surrounding you which will not be infinity.

author: LukeW
author_rank: Frequent Contributor
timestamp: March 22, 2015, 11:04:52 am
content: The thing about "safety" is that it's incredibly vague... it only has definitions from politics, not from physics.Let's suppose, say as an example, that your offline SMPS is "safe" if it is cerified to UL 60950-1, and the transformer is high-pot tested for input-to-output galvanic isolation at 3kV/10mA for 1 minute.Is that "safe" enough, and if not, what is your required definition of safety?If the above definition of safety suits what you want, in this context, then there are plenty of off the shelf products that would do what you want - here are a couple of quick examples:http://www.deltapsu.com/upload/product_image/10_10_20130401_000031642_Technical_Datasheet_PMT-24V35W1AA_Rev.01_2013.02.pdfhttp://www.cui.com/product/resource/vof-6.pdf