What is the best way to power my design - Page 1
Forum section: electronics / projects

author: paul23
author_rank: Regular Contributor
timestamp: August 19, 2013, 10:25:21 pm
content: I have a design I am working on which runs at 5Vdc and a max of 110mA. My preferred way to power this would be the traditional fuse-transformer-bridge rectifier-LM7805, however space is a concern on this design and the transformer wont fit, so I need to find another solution. I´ve seen quite a few people using capacitor based supplies, but I am not keen on having something that is not isolated. Something that I have found that would work are these neat little AC-DC convertershttp://www.digikey.com/product-search/en?x=8&y=17&lang=en&site=us&KeyWords=945-1397-5-NDbut they are pretty expensive. Is there a better way to do this and keep everything small and relatively safe for less, or is this the best option?Thanks.

author: Harvs
author_rank: Super Contributor
timestamp: August 19, 2013, 10:35:20 pm
content: Why not just use a USB 5V 1A wall wart and put a micro USB socket on your board? Skips the whole offline conversion thing all together.

author: paul23
author_rank: Regular Contributor
timestamp: August 19, 2013, 10:58:58 pm
content: Quote from: Harvs on August 19, 2013, 10:35:20 pmI forgot to mention quite an important bit. The PCB basically switches mains through a relay. There is a terminal block that has mains in and switched mains out, so I need 230VAC and 5VDC on the PCB.

author: David_AVD
author_rank: Super Contributor
timestamp: August 19, 2013, 11:13:41 pm
content: Are there any connections other than the mains in and out ?

author: crisr
author_rank: Contributor
timestamp: August 20, 2013, 01:18:36 am
content: I normally also go with the 60Hz-iron-core-transformer - bridge - cap - 7805 route, as I am not able to design a mains-powered switching supply (not to mention the difficulty in sourcing a suitable transformer). If your project is a one-off or just a couple of units, i think your best and cheapest choice would be to gut an usb power adapter or cellphone charger and use it as a daughter board.The capacitor-zener transformerless supplies not only are normally dangerous, they are terribly inefficient and would probably not be able to supply 110mA and still be small enough; I once made an IR controlled outlet using that design (AN954 from Microchip): the circuit consumes less than 10mA @ 5V, but draws something like 6W @ 120VAC.

author: poorchava
author_rank: Super Contributor
timestamp: August 20, 2013, 07:07:31 am
content: Maybe you could try something like those cheap chinese AC phone chargers with USB output. Uou could clone one of those, but with paying attention to details like isolation, creepage distance etc. I think they are typically self-oscillating feedback winding-based single transistor forward converters. Also a small flyback converter could do.Actually the only hard thing is getting a proper transformer. Winding one yourself is a nasty job, and reusing one is risky, as you never know what the quality of isolation is.

author: Psi
author_rank: Super Contributor
timestamp: August 20, 2013, 07:51:42 am
content: Quote from: crisr on August 20, 2013, 01:18:36 amThat's not true, when used properly they are perfectly safe, like pretty much everything else in electronics."Dangerous in the hands of a novice" would be quite valid though.Quote from: crisr on August 20, 2013, 01:18:36 amThat depends on the application, they burn off all the current you don't use.If you need 50mA all the time and choose a capacitor that provides 50mA then they're very efficient.On the other hand, if your circuit draws 1mA most of the time but needs 50mA available then yes, it's very inefficient.Quote from: crisr on August 20, 2013, 01:18:36 amYeah, 110mA is at the point where he might as well use a transformer.Would need X rated 1.52uF mains cap, or bank of caps, to get 110mA which would be pretty big.

author: fcb
author_rank: Super Contributor
timestamp: August 20, 2013, 09:20:25 am
content: The powerintergrations "tinyswitch" products work well. There is a company called Myrra who make optimised flyback transformers for these parts, it becomes fairly trivial to make a small SMPSU with the appnote serving-suggestions.http://www.rapidonline.com/Electrical-Power/Flyback-Transformers-88-5159That said, if you absolutley don't need isolation, for 0.6W supply i'd follow others suggestions of a capacitor/resistors/zener based dropper.

author: nctnico
author_rank: Super Contributor
timestamp: August 20, 2013, 11:14:49 am
content: I second the suggestions for the tinyswitch or similar chips (the ones from Onsemi are also easy to use) for building an offline PSU. These designs use standard inductors and they come with lots of appnotes. If you want to go for an isolated supply you can buy an off-the-shelf transformer from Coilcraft or Wurth (and many others).

author: madires
author_rank: Super Contributor
timestamp: August 20, 2013, 12:39:36 pm
content: BLOCK offers 1VA tranformers (32.5 mm long, 27.5 mm wide and 20mm high, EUR 2.35). Take the 6V model, add a bridge rectifier, a filter cap and a LDO voltage regulator like the MCP1702 and you got a nice small PSU.

author: crisr
author_rank: Contributor
timestamp: August 20, 2013, 12:47:32 pm
content: Quote from: Psi on August 20, 2013, 07:51:42 amWell, try debugging / diagnosing your powered circuit (maybe with your mains ground-referenced oscilloscope) and tell me they are not dangerous. The OP should also pay attention that the circuit does not connect to anything else (i.e. has no connectors) other than mains input and mains output.QuoteCorrect if I am wrong, but since they are transformerless, input current will always be greater than the output current. So let's say you design it to supply 110mA @ 5V (0.55W); that means the input current will beat least110mA, which at 120V is 13.2W! That's 4.17% efficiency, irrespective of what the powered circuit is effectively drawing... That is unless Power Factor considerations can be taken into account (is there such thing as >1 PF?), I don't really know much about that...

author: Psi
author_rank: Super Contributor
timestamp: August 20, 2013, 02:55:11 pm
content: Quote from: crisr on August 20, 2013, 12:47:32 pmThink about that for a sec from an energy standpointLets say you have a AC capacitor directly across 60Hz 120VAC and the value of this capacitor is chosen so that 110mA flows.If this capacitor is using 13.2W where is this heat going? 13.2W is some serious, soldering iron level heating but the cap is cold!The energy flows into the capacitor and then back out again, so there is current flowing but the net energy used is zero (assuming ideal cap)This is the advantage capacitor powersupples have over a simple voltage divider across the mains, which would result in 13.2W of heat as you say..

author: paul23
author_rank: Regular Contributor
timestamp: August 20, 2013, 07:12:26 pm
content: Quote from: David_AVD on August 19, 2013, 11:13:41 pmNope. They are the only connections.Quote from: madires on August 20, 2013, 12:39:36 pmThat might work, I'm using a 1.5VA transformer now and that is too high, but if I used I more efficient regulator, like what you suggest, I could use a smaller transformer and I might get away with that. In an ideal world I want to keep the height down below 16mm, but if that is not possible I can squeeze a couple of extra mm, the devices I linked are 22mm I think and that was really pushing things, but doable.Quote from: nctnico on August 20, 2013, 11:14:49 amI´ll check these out too, maybe I can use these instead.It´s not, hopefully, going to be a one-off project. Hopefully I will be making a couple of hundred, so I want it to be as robust as possible and obviously safety is the main concern.The main power draw is the relay, that is around 400mW other than that there is only really a couple of LEDs and uController. Most of the time the relay will be off and the uController will be in sleep mode so the whole circuit will only consume a couple 10´s of uA worst case.Thanks for the suggestions.

author: crisr
author_rank: Contributor
timestamp: August 20, 2013, 10:12:50 pm
content: Quote from: Psi on August 20, 2013, 02:55:11 pmYeah, It actually makes sense if the current is drawn mainly when the instantaneous AC voltage is around the 5V mark... but how would I go about measuring that? I measured a transformerless supply I once made with 470nF cap and 5.1V zener and got around 20mA on the AC side using a True-RMS DMM on AC mA scale. I think I would probably have to use a shunt resistor (mine already has a 47R inrush limiting resistor in series with the cap) and measure voltage across it with an oscilloscope, with mains line on second channel, doing some math function maybe...

author: David_AVD
author_rank: Super Contributor
timestamp: August 20, 2013, 10:19:29 pm
content: Quote from: paul23 on August 20, 2013, 07:12:26 pmCan you use a relay with a mains voltage coil? That might reduce the peak current required to enable a capacitive solution?

author: paul23
author_rank: Regular Contributor
timestamp: August 20, 2013, 11:04:25 pm
content: Quote from: David_AVD on August 20, 2013, 10:19:29 pmhmmm, apparently I can, they do the same relay I was going to use, but with a mains voltage coil. I am not keen on the capacitive option, but a smaller transformer could be used now, so maybe I can go back to the original plan, but use something better for voltage regulation.The only problem with the new relay is that it is wider which might mean it won't fit on the board. It definitely won't fit now with the current design, but with a small transformer and improved regulation circuit, maybe I could squeeze it in.Without the relay that means there is now only around 30mA on the 5V rail rough worst case, plus whatever I use to drive the relay coil. Is a triac the best option for that?Thanks

author: Psi
author_rank: Super Contributor
timestamp: August 20, 2013, 11:23:51 pm
content: Quote from: David_AVD on August 20, 2013, 10:19:29 pmA lot of capacitive powersupplies i've seen use a 24 or 36V zener which is then regulated down to 5V for the mcu. The mcu drives the relays from the 24/36V rail with a transistor making the current needed much less than if a 5V zener and relay were used.Sometimes you see a lower voltage relay with higher voltage zener, etc 12V relay and 24V zener.Because the capacitive circuit is really just a current limit the relays cant draw more current than there is available, if they try the voltage just falls to compensate.And so using 12V relays when your rail is 24V gets around the issue of the voltage falling off as you approach the max current. It allows you to operate closer to the limits.

author: David_AVD
author_rank: Super Contributor
timestamp: August 20, 2013, 11:51:23 pm
content: Without seeing the circuit, it's hard to offer detailed advice, but a TRIAC referenced to the PSU - (Neutral) should be fine.The other thing to think about is the LED current. Do they really need to be as bright as you have them? Will using a "high brightness" version let you drop the LED current down to 1mA or so?

author: Psi
author_rank: Super Contributor
timestamp: August 20, 2013, 11:55:46 pm
content: Yes, i can confirm that. In one of my projects i use 39K resistors in series with high brightness LEDs to get the light output down to a level that's not annoying to the driver but still visible during the day.At night i PWM dim them to reduce the brightness even further.

author: SeanB
author_rank: Super Contributor
timestamp: August 21, 2013, 05:49:52 pm
content: Typically I see these using a 24 or 48V relay, and then use a zener diode to limit the off switch voltage to around 56V for the 48V one, and 33V for the 24V relay. That way the coil current is much lower and you get a higher contact current rating. Higher voltage coils mean a smaller value capacitor. Otherwise use a mains rated coil and a C106d sensitive thyristor with a VDR across it as a drive. For a DC coil use a high voltage transistor or a high voltage mosfet, preferably a 400V unit in a TO220 package, though you will probably need a 12V rail to do decent gate drive for it.

author: paul23
author_rank: Regular Contributor
timestamp: August 25, 2013, 08:01:30 pm
content: I have been playing around with the different ideas trying to come up with a solution. I think the LED´s can go down to 2.5mA and there are 4 or them, so the LEDs would be 10mA, the MCU is another 5mA, so that is a total of 15mA. All I need on top of that is the voltage regulator and relay. This would then mean I can use a smaller transformer, so far so good.I have not looked in to the voltage regulation yet, at the minute I'm trying to figure out the relay. What I have come up with is the mains voltage coil relay, like suggested earlier, and drive the coil from a small SSR, that would only add another 20mA taking me to 35mA, which is a lot better than what I had before. A small DIP8 version should still be OK for space.The problem is I have never worked with SSRs before and I am not 100% sure I'm doing it right. Does it matter if the SSR is zero-crossing or not? All it will be doing is switching the relay coil. The other bit I'm stuck on is if I need a snubber circuit on the output? I think I probably do, as it is a coil, but that might rule out this option because it would take the size to be about the same as using a larger transformer.Am I on the right track here?

author: SeanB
author_rank: Super Contributor
timestamp: August 25, 2013, 08:53:35 pm
content: You can use a zero crossing unit, as it will have no noise on the supply. A VDR across the coil will do the same as a snubber. Use a 275V unit and a SSR with a 400V rating. There are SSR units that will switch with 10mA, saving you a little current draw. You can run the SSR from an unregulated rail, most are rated for operation from 5-30V.

author: David_AVD
author_rank: Super Contributor
timestamp: August 25, 2013, 10:24:30 pm
content: Instead of an SSR, why not a sensitive gate TRIAC ? That will only need a few mA, but you'll have to check specs.The whole circuit is at mains potential anyway. I don't think you don't need to worry about zero cross switching it. There should be plenty of examples on the 'net.Maybe also check out the MOC30xx series of optos. There may be a version with low LED current. I think they can drive 100mA on the TRIAC side from memory which should be more than enough for your mains voltage relay coil.

author: paul23
author_rank: Regular Contributor
timestamp: August 26, 2013, 07:36:11 am
content: Quote from: David_AVD on August 25, 2013, 10:24:30 pmDid you mean drive the relay coil directly from MOC30xx TRIAC output? The datasheet shows another TRIAC connected to drive the load, but is this just to drive higher loads than the MOC30xx is rated for? If I keep well below the maximum output current of the MOC30xx and drive the relay directly from it, use a VDR as Sean suggested as a snubber, then that would be a compact, cheap solution and a problem solved.

author: David_AVD
author_rank: Super Contributor
timestamp: August 26, 2013, 11:13:50 am
content: Yes, I have seen circuits where MOC30xx optos were used to drive small lamps, etc directly. Some of the app notes show the same thing.

author: ovnr
author_rank: Frequent Contributor
timestamp: August 26, 2013, 11:28:41 am
content: On relays: You should consider a bistable (latching) relay; that way you won't have to deal with a high continous power drain; just slap a decent capacitor in there to handle the impulse load. Also, no headaches with switching the mains voltage for the relay coil.

author: paul23
author_rank: Regular Contributor
timestamp: August 26, 2013, 07:43:26 pm
content: Quote from: ovnr on August 26, 2013, 11:28:41 amGood idea, but I don't think it is going to work because I think the capacitor will take too much space. I may revisit this idea though if the TRIAC option doesn't work out.I'm really stuck on how to do the TRIAC. I have been looking through datasheets and things online and found they they all use a TRIAC or SCR after the MOC3XXX. In the datasheet from Fairchild for the MOC3063 it says that loads should not be connected it is to be used as a trigger device only. From the examples I have found, they all seem to be driving lights or dimmers, which I would assume would be a different method than what I want to do. I have not been able to find anything that shows a load connected directly. With this being mains voltage I don´t want to muck about. If it had been low voltage stuff then I would have had a play around myself and figure it out, but not with mains voltage.So here is what I have figured out, the relay coil is 3.2mA @ 230VAC, so to drive that I need a TRIAC after the MOC3063 that can drive at least 5mA,10mA or higher would be better.The bits I am stuck on, or not comfortable with. The relay coils should connect in series with the TRIAC. So it goes LIVE- relay A1, relay A2 - TRIAC and then the other side of the TRIAC to neutral. The MOV (to act as a snubber) goes across the relay coil and not live to neutral. I am correct so far? I assume I need a fuse in series with the MOV, how do I figure out the size for the fuse and MOV? Am I better off going back to the option of using SSR? The cost is about the same but the footprint is smaller, which is important.Thanks for all the help, it is appreciated.

author: ovnr
author_rank: Frequent Contributor
timestamp: August 27, 2013, 04:05:16 pm
content: Quote from: paul23 on August 26, 2013, 07:43:26 pmBecause I was bored, I checked. Looking at a decent-sized two-coilbistable relay(16A 400VAC), the datasheet specs it at 600 mW coil power @ 5V, with a minimum duration of 30ms. That equates to 18 mJ activation energy; assuming you want guaranteed reliable operation, I'd try to store at least 2x as much energy due to voltage drop and whatnot. You should be able to get by with a 2200µF 6.3V cap, which you can get in a 10x10x13mm package.

author: paul23
author_rank: Regular Contributor
timestamp: August 27, 2013, 08:25:07 pm
content: You're right thanks for your looking. Although it is slightly more expensive to do it your way, it might actually work out smaller after all. When you consider the space required for the snubber circuit and either a TRIAC or SSR, then it´s about the same if not a bit more space required than a capacitor.Just so I am clear, what you are suggesting is sizing the power supply tonotinclude the relay, Then have the capacitor sized to be able to supply the extra current required to pulse the relay on or off? I suppose if I make sure that the LEDS are off when the relay is energised, then that frees up a bit extra capacity. Does it matter where the capacitor is located? Does it need to be as close as possible to the relay coils?Thanks again, it is appreciated.

author: paul23
author_rank: Regular Contributor
timestamp: August 28, 2013, 09:54:54 pm
content: I think I have found a show stopped on using the latching relay. If power is cut to the circuit whilst the relay is on, then when power is reapplied the relay will still be on, this is a bad thing, it needs to be off on power up. I can't figure out a way to get the relay to switch off without using a load of discreets, which I don't have space for, which is shame because this was looking like quite a nice solution. Back to square one again now I guess.

author: ovnr
author_rank: Frequent Contributor
timestamp: August 29, 2013, 12:08:48 am
content: Yup, if you require that the relay switches off when the power goes out, it's not going to work.Since you're thinking of going into (cost-sensitive) small volume production and your design would essentially be fine with a non-isolated supply (just use an isolated brick for your first prototypes), I'd suggest going with a small offline switching controller like already mentioned.I did a quick calculation of a cheapLNK304 design, and you're looking at around $2.2/piece for the whole supply (12V @ 100 mA, just feed that to the relay and slap on a $0.14 regulator for your 5V needs) when ordering 100 at a time. Should be fairly small; I'm sure you could tweak it a bit - this was just a cursory glance.Also, just for comparison, the cheapest isolated AC/DC converter I found was $9.78/piece @ 100pcs at Digikey and I'm not even going to look elsewhere because shitty webshops.

author: paul23
author_rank: Regular Contributor
timestamp: August 29, 2013, 03:35:59 pm
content: Thank you for your help. I did want to avoid a non-isolated supply, but to be honest I am getting fed up with this design and I guess there is no real harm in going this route, providing it is done properly. I have looked at the datasheet for the LNK304 and it is very good and detailed and I think I will just go that route with a 12V relay and get this bloody thing finished. Thanks again.

author: David_AVD
author_rank: Super Contributor
timestamp: August 29, 2013, 10:39:17 pm
content: The folks on the DIYC Christmas light forum have used the MOC30xx optos to directly switch low current strings of mains lights. Your relay current is well within the capabilities of those optos.Grab an opto and a relay, wire in series across the mains and give it a test. Make sure it's a mains coil relay of course!