A power supply for a Raspberry Pi 3 - Page 1
Forum section: electronics / projects

author: gore
author_rank: Regular Contributor
timestamp: April 10, 2016, 09:31:25 pm
content: Hello,I've decided to build a Raspberry Pi 3 server for fun. Put the entire thing in a box along with fans, drives or any other hardware I might need. I'd stick my wireless router in there too (fed by a different power supply, obviously). The building part is the box itself, I suppose, but I want to put my own power supply for the Pi inside.I've drawn a schematic and was wondering whether I left some mistakes in the design. I'd appreciate any advice before I proceed with designing the PCB to be sent for manufacture. The 16VA transformer easily fits on the board itself. LM2576 5V fixed is my choice to regulate the voltage. Seems easy enough and comes with a low part count.

author: wraper
author_rank: Unknown
timestamp: April 10, 2016, 09:47:35 pm
content: Frankly, you could just buy good 5V SMPS which would give better efficiency at same or lower price. Also 16VA (~11W) transformer is too weak for 3A. Considering losses, your schematic will reliably provide only 1.5A at best. 1000uf after the rectifier at such current is a bit too low as well. Putting there a tantalum cap is not a good idea either, use ceramic if you want. But just electrolytic is more than enough, no additional cap needed.Weird that there are micro USB connectors on the schematic, micro USM is only for sink device (RPi). PSU or host should have USB type A.

author: wraper
author_rank: Unknown
timestamp: April 10, 2016, 09:59:13 pm
content: And why on the earth you want to make it earthed. Also, for mains frequency transformer, all that mains filtering is a complete overengineering.

author: gore
author_rank: Regular Contributor
timestamp: April 10, 2016, 09:59:39 pm
content: Quote from: wraper on April 10, 2016, 09:47:35 pmI could buy one, but there's no fun in that. The idea is to build it. The 3A output figure in the schematic is too rough indeed. Not that I need 3 amps. 2.5A is more than enough for a Pi. This is thetransformer. Is it good only for 11W? Good point about the USB type A. Went over my head.

author: wraper
author_rank: Unknown
timestamp: April 10, 2016, 10:03:33 pm
content: Quote from: gore on April 10, 2016, 09:59:39 pmThen build something comparable, not inferior thing. Using step down converter after usual mains transformer is just wrong. You get worst out of the 2 worlds, big size, low efficiency and high noise.

author: eugenenine
author_rank: Frequent Contributor
timestamp: April 10, 2016, 10:56:38 pm
content: I was thinking of building a small supply like that but it would charge a single lithium ion cell and switch over then power was lost so it would work as a small ups.

author: linux-works
author_rank: Super Contributor
timestamp: April 10, 2016, 11:16:21 pm
content: how funny, I'm working on something like this now. its a build, not a design, though.that was an old build; I'm redoing it for the pi3 that I just got yesterdaythe idea is to use 12v SLA batteries like this small one:http://www.amazon.com/ExpertPower-Rechargeable-Battery-Replacement-WP3-12/dp/B00KC399SYand have it connected to this neat little already-done-and-working-just-buy-it UPS fast switchover board:http://www.amazon.com/Mini-Box-picoUPS-120-battery-automotive-enviroments/dp/B005TWE4Q0then, feed your 12v into this buck converter:http://www.amazon.com/DROK-Adjustable-Non-isolated-Buck-Boost-Transformer/dp/B00GWCC6S4adjust so that you see 5.05v AT the pi's b+ and ground.power the UPS board with a 4amp 19v laptop psu brick (I think the voltage does have to be higher than 12v so the battery will charge).

author: gore
author_rank: Regular Contributor
timestamp: April 10, 2016, 11:21:46 pm
content: QuoteIsn't this a SMPS? I was trying to find something very simple and came across theLM2574. Never used these before. The efficiency seems to be relatively high compared to regular linear regulators.

author: gore
author_rank: Regular Contributor
timestamp: April 10, 2016, 11:28:18 pm
content: Great looking build, linux-works. Aha, a UPS! Will definitely add that to the box.

author: timb
author_rank: Super Contributor
timestamp: April 11, 2016, 12:53:03 am
content: I use one of these for a similar Raspberry Pi UPS:http://www.amazon.com/DROK-Uninterruptible-110V-240V-Battery-Charger/dp/B00GFHB3XK/With that, I don't even need a separate power supply. It contains an 18W AC-DC converter, SLA battery charger and UPS circuitry. So I just put an IEC AC plug on the case and add a 5V buck converter module to the 12V output and away I go.(There's two larger versions of that DROK AC-DC UPS module as well if you need MOAR POWWWER; one is 120W!)

author: linux-works
author_rank: Super Contributor
timestamp: April 11, 2016, 01:38:39 am
content: Quote from: gore on April 10, 2016, 11:28:18 pmthat ups is meant for a car pc, I think. but its fast switchover and auto charge of sla 12v cells made it an easy choice. it gives 12v out so you go into the 3watt dc/dc of your choice and you are done.I have my stratum1 gps ntpd timeserver on that ups card. I have about half a year of uptime but that's due to a kernel upgradeI'm going to use the pi3 for some SCPI data polling and I'm hoping I can get it to be a test gear 'hub' in terms of serial 9600 data streams. for fun, I plan to use bluetooth serial dongles to relay the db9 rs232 signalling from the various meters and scpi devices to the rasp pi. since longish term data collection is the goal, having a battery backup on the polling engine makes sense, especially when it does not cost much and can fit right inside the same box as the pi.I'll design a custom plastic laser cut box around the pi, the board and the battery and maybe it will be about the size of a fluke benchtop dmm, ready to stack right on top

author: linux-works
author_rank: Super Contributor
timestamp: April 11, 2016, 01:40:55 am
content: Quote from: timb on April 11, 2016, 12:53:03 amyeah, more power is needed that is listed as:Output : DC 13.5V, 1.5A, 18Wyou need a good strong 2.5A for the pi3. I'd go to 3 just to be save, so that powered usb items can also work.the pi is getting very hungry for its size. not happy that a small board that is supposed to be efficient needs well over 2 amps! ;(

author: linux-works
author_rank: Super Contributor
timestamp: April 11, 2016, 01:46:44 am
content: also, somewhat unique on my build; I have that micro usb 'turn around' card board. special thing (on amazon, though) that lets me 'remote' the sd card so that I can get access to it, do backups when I shut the pi down.even more needed with the pi3 since they stupidly removed the spring eject and its now a friction fit. once you insert the card, there's no GOOD way to get it out again if the board is mounted like any normal person would mount it. how stupid. this is exactly what happens when you don't eat your own dogfood first before pushing it on customers. if they lived wtih the non-spring card slot for a while, I'm sure they'd have decided to go back to the spring style. sigh.

author: timb
author_rank: Super Contributor
timestamp: April 11, 2016, 09:03:34 am
content: Quote from: linux-works on April 11, 2016, 01:40:55 amThat's 18W at 13.5V. Once you step it down to 5V, it should be at least 3A. (18W @ 5V = 3.6A, so assuming a worst case 80% buck converter efficiency you're left with 2.88A. ~90% would be more likely, so you'd be okay. That's assuming you couldn't push the thing a bit higher to 20W with proper cooling.)I know what you mean about the new Pi being power hungry; I was disappointed when I first read the power specs for it, but then I remembered it's got built in WiFi and BT. Radios can be pretty power hungry. I remember needing close to 2A with the first Pi once I added a WiFi dongle and some other stuff to it.I wonder what power consumption looks like with WiFi and BT disabled on the Pi3?

author: gore
author_rank: Regular Contributor
timestamp: April 11, 2016, 09:39:19 am
content: Might just get one of those DROK UPS's. Gotta look for something like that in European markets. On the other hand the shipping cost on amazon.com isn't that bad for me. With additional 7 dollars of product I get into free shipping range, as it seems.The little DROK is on the edge in terms of power. The Pi 3 is indeed power hungry compared to its predecessors. Combine that with hardware add-ons and power losses. The 120 watts version is an overkill, but I see no option in between. There's no mention of low voltage cut off built-in on either of them. Wouldn't want to damage the battery by mistake. One more board to keep in mind, I guess.linux-works:Access the SD with the Pi powered down? That's awesome! Not sure if I'd need one, but what are they called anyway?EDIT:Here's what seems like a nice LVD module to prevent the battery from over-discharging.

author: exe
author_rank: Unknown
timestamp: April 11, 2016, 12:30:42 pm
content: L2 may be too big, as well as C2 (swap it with C3). Google "Second-Stage LC Filter Design", it explains some "traps for young players".There are missing low-value ceramic capacitors to suppress noise.Why is C4 1uF tantalum?I would also use a pre-assembled diode bridge like DBL204G (I've got plenty of them), but it's up to you (nothing wrong with discrete bridge).Beware that routing is absolutely essential for SMPS, follow the recommendations in the datasheet.

author: gore
author_rank: Regular Contributor
timestamp: April 11, 2016, 01:45:47 pm
content: The value of L2 comes from the datasheet of LM2576. C2 is 1000uF. I'll have to rework the filter somewhat. How aboutthisone? As for C4 being a tant - no valid reason. Just picked a random capacitor to lay out the general design. It shouldn't be there anyway. The reason for using individual diodes for the bridge is because I have plenty of them. Might as well use some. I checked the datasheet for routing specifics. Element placement, PCB trace length etc. It's all in there.

author: Finndersen
author_rank: Newbie
timestamp: April 11, 2016, 02:02:10 pm
content: Hi guys,I came here to ask a similar question. I'm wanting to make a portable RPi 3 project that can either run off rechargeable battery or while plugged into power and also charging (UPS-style)I effectively want exactly this:Adafruit Powerboostbut with higher current capability (Rpi 3 needs more)Would a PNP transistor together with 5V rechargeable battery supply like this work?eBay 5v li-ion battery housingThe idea is when external power is plugged in, transistor switches off battery to Pi. Battery box has built in recharge circuit, switch, LEDs, protection, etc.(+5V at bottom goes to Pi)

author: exe
author_rank: Unknown
timestamp: April 11, 2016, 03:02:54 pm
content: Quote from: gore on April 11, 2016, 01:45:47 pmActually, it's better to have it for better transient response. And, probably, mlcc would do a better job.Quote from: gore on April 11, 2016, 01:45:47 pmThey also have another L1. So please do read the article I suggested (or just keep L2 10% of L1). I played with this stuff in ltspice, it can really go wrong and oscillate. Concerning capacitors: "Design Rule #2: Make the first capacitor the smaller of the two. Then you'll have a second filter resonance which is fixed— it won't be affected by capacitive loading. Typically, the first capacitor will be 2-20 times smaller than the output capacitor".Quote from: gore on April 11, 2016, 01:45:47 pmFor mains filtering? Why not. They all more or less similar. Usually the difference in values dictated by the peak/maximum current. Higher current devices have lower choke values and worse filtering. Usually values are specified in the datasheet. Although I don't think this is crucial for this design.

author: gore
author_rank: Regular Contributor
timestamp: April 11, 2016, 08:08:26 pm
content: I still have a lot to learn. I read a couple of articles you suggested by name. One in particular has fine detail on equations, values, frequency response and other fundamental parameters. I should use LTspice more often. Thanks to everybody for criticism and a good number of suggestions. Plenty of material to work with.

author: Fungus
author_rank: Super Contributor
timestamp: April 12, 2016, 12:40:01 am
content: Quote from: linux-works on April 10, 2016, 11:16:21 pm$12 + shipping?They go for $1.80 on eBay, shipping included.eg.http://www.ebay.com/itm/161270864741

author: linux-works
author_rank: Super Contributor
timestamp: April 12, 2016, 01:32:48 am
content: when I buy from amazon, I often find things that are next-day shippable and the premium is not all that much consider how much your time is worth.if you are a student, have no money and have tons of time, buy from china.if you have a life, don't want to wait close to a month for something that may even be the WRONG item, then getting it from a US shipper makes more sense (to me).I'm not buying in bulk; I'm doing one-off buys and time matters. plus, the few times that amazon has sent the wrong thing or a broken thing, they have taken care of it, often the same day. good luck with any customer service from china.its not news that china/ebay is cheaper. everyone knew that, right?

author: exe
author_rank: Unknown
timestamp: April 12, 2016, 11:49:12 am
content: Huh, wait, I just recalled these oldish buck regulators do not work well with ceramic capacitors on the output. I think the datasheet should specify minimum ESR value. If not, it's better to be conservative. Or find a better chip that is MLCC-friendly.

author: wraper
author_rank: Unknown
timestamp: April 12, 2016, 12:06:44 pm
content: Quote from: timb on April 11, 2016, 09:03:34 amGood luck getting 90% efficiency out of LM2576. Even the datasheet states typical 77% efficiency at VIN = 12V, ILOAD = 3A. 90% is in the realm of ICs with synchronous rectifier.

author: justin66
author_rank: Regular Contributor
timestamp: April 12, 2016, 12:43:53 pm
content: Quote from: linux-works on April 10, 2016, 11:16:21 pmyou will kill the battery dont apply more than 14.5v or fluid inside battery will boil and eventually dry and sulfate the battery. i deal would be 12.8v where is the battery resting voltage is.

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2016, 02:08:25 pm
content: If you are starting from an 18-20V laptop PSU, then you need a regulator suitable for float charging between it and the battery. Many of the EBAY CC-CV buck converters with two presets (voltage and current) can do that. Simply set to the correct float voltage for the battery technology you are using (typically 13.6-13.8V for 12V SLA) before connecting the battery, and set the current limit to C/5 where C is the battery capacity, or 50% of the nominal buck converter rating. You can use the same type of module to power the Pi - set that one to 3A, and at least you have some protection if something shorts out. The only remaining thing you need is a low battery warning circuit and a way for the PI to shut off the power so it doesn't kill the battery by deep discharging it if mains power is off for an extended period.There are commercially available Pi UPS 'hats' - Its worth studying them carefully before you start hacking something together as by the time you've mounted and wired two buck converters, modded one of them to access the shutdown pin, and built a latching comparator board for the low battery warning and lockout, you'll probably have spent as much as the commercial 'hat'.

author: linux-works
author_rank: Super Contributor
timestamp: April 12, 2016, 04:53:52 pm
content: I thought the battery output was regulated (to charge the battery); it was the pass-thru port that is not regulated (which is why I have that buck converter to step down whatever it sees down to 5v).I could not imagine anyone designing a battery charger and not having a limit on its output voltage!are you sure about this, on this circuit?

author: timb
author_rank: Super Contributor
timestamp: April 12, 2016, 11:32:11 pm
content: Quote from: wraper on April 12, 2016, 12:06:44 pmYeah, totally true for the LM2576. The board I was using didn't have that controller though, some other chip that I measured at about 85%.I've been working on the design of a 4-switch synchronous buck-boost converter using an LT part, which does get above 90% efficiency, so I must have had that on the brain when writing the above post.

author: gore
author_rank: Regular Contributor
timestamp: April 19, 2016, 09:26:38 pm
content: A small update. So, I got one of those drok UPS power supplies ~ 50W version. Unfortunately the PSU was in a pretty bad shape on arrival. As soon as I took it out of the box something was rattling inside. A piece of aluminum to hold down a power diode for heat dissipation was loose. The perfect scenario for a short. Not a good start. Well, I took care of that and turned it on. A somewhat loud and periodic tick was audible as I hooked up my 12V 7aH battery. The output voltage was alright though.Wasn't difficult to pin point the source of the noise. Sucker's coming from the flyback transformer! The core of the flyback was... loose, to put it mildly. At that point I thought about returning it, but I really dislike messing around with shipments with a relatively low cost. What am I going to do? I still need a PSU/UPS for the Pi!Opened the damn thing up and disassembled it. What a mess! First thing came to my eye - a couple of schottky barrier rectifiers weren't properly attached to the heat sink. I also found a 220ohm resistor on the output soldered in instead of a capacitor. The silkscreen clearly shows an output cap, as it should, right? I checked some of their gut photographs of the product on amazon. There's a cap in there, yup.The poor resistor was smoking hot. I knew I smelled something... Replaced it with an output cap. Actually I replaced just about anything that looked suspicious. What else? Some of the solder joints looked pretty bad. After all the 'mods' and cleaning up the ticking was gone. Now it seems to work just fine.As for the further design. Well, I'm still going with the LM2576's. Got all the parts on my bench to finish off the DC-DC converter. I know they are inefficient in the world of SMPS's (~75%), but in this case I do have the power to spare. Wouldn't do it a second time though. What else? Apart from a crowbar for over voltage protection - that's about it. Everything seems to be working just fine. The next step is a low voltage disconnect to keep the battery safe. Until that arrives, I have to finish the board. It's a split board with two adjustable outputs. I need the second source for other piece of hardware with a different voltage output.P.S the two TO-220's in the picture aren't properly secured to the heat sink yet.

author: timb
author_rank: Super Contributor
timestamp: April 19, 2016, 10:32:56 pm
content: Huh. My DROK UPS didn't have any rattling or loose parts. Which seller did you buy from? If it was Fulfilled by Amazon I would have requested a refund. It's super easy, you don't even have to dick around with shipping labels and the like; you simply print the RMA sheet (or write the number down on a slip of paper), stick it in the box with the product, seal the box up and stick it in your front porch. UPS will arrive the next day, collect the box and apply the label for you. (I write "Broken Item - Amazon Return for UPS Pickup" on the box so there's no confusion.)

author: gore
author_rank: Regular Contributor
timestamp: April 19, 2016, 11:22:59 pm
content: Actually mine's not a "Drok". It's a "Deok", if it makes any difference.That's what they sell on UK amazon. Anyway, yeah. I thought about doing it, but... curiosity happened. Well, that plus I wasn't really up to waiting for another week or two. I marked some of the things to watch out for, for anybody who's willing to buy one. Perhaps I had a faulty unit and there's nothing to worry about. Transformer noise was my biggest concern and now it's fixed.EDIT: About the resistor. That's probably a load resistor to keep it stable. Some builds of this power supply have the resistor, while others don't. Weird. I hadn't planned on turning the PSU on without a load anyway.

author: gore
author_rank: Regular Contributor
timestamp: April 21, 2016, 10:38:21 pm
content: The step-down portion is complete (13.5V to 5V @ 3A). Now I need another design for stepping-up (13.5V to 19V @ 1.6A). Any ideas what I could use to achieve that? I have to fit that on the left side of the board.

author: gore
author_rank: Regular Contributor
timestamp: May 26, 2016, 09:45:45 pm
content: Hello. It's been a while. I've put together a case from organic glass to house all the goods. The first wave of boards have arrived from production. A combined step up and down DC-DC converter for the RP, some add-ons and a router too. It has adjustable voltage outputs on both channels; adjustable over voltage protection and a temperature based fan control. The efficiency isn't top notch (70 – 80%), but good enough for its purpose. The PSU has a few spare watts to waste away.The low voltage disconnect boards are on the way. It’s a key piece to keeping the battery safe. Well, so that’s that. There’s still work to be done on placement, enclosure routing and mounting.