My Open Source USB Lab Power Supply - Page 1
Forum section: electronics / general

author: Twistx77
author_rank: Regular Contributor
timestamp: May 30, 2012, 05:48:35 pm
content: Hi everyone!I just got home from work and saw the new video about the USB supply of Dave and I was like noo!! Just what I was working on... well before he give us more info about it I want to share my project which I think will not be quite like Daves. Any feedback and suggestions is highly appreciated!I've been working for maybe a month and a half, a couple hours a week in a Lab power supply because, I've been moving a lot this past couple of years and since I never have a real setup with my supply and everything where I wanted, I decided to make a small USB power supply to provide enough power and control to make a simple power supply for my uC's projects while been really cheap and with the most capabilities possible.My goal was to make it under 10€ in components including PCB and so far I have reached my goal.I wanted it to be isolated also but that would've destroy my price goal.The features of this power supply are or are intended to be:- Dirty cheap.- Really simple.- Voltage and current regulated.- Compatible with 1Amp usb 3.0- Controlled by the PC with a Java program.- Output pins made to fit exactly a protoboard or a 0.1'' screw connector.- UART to USB feature (And possibly I2C and SPI, Depending on speed of USB)- Bootloader to be able to use it as PIC18F simple learning board because I included a temperature sensor and a light sensor and left some outputs connected to 0.1 inch headers.So it would basically would be an open source tool to learn, but also to be used as power supply and probably at the same time a UART to USB converter.I actually order the components from mouser on Monday and they should be here by tomorrow to make my first prototype. I haven't had much time to work on it. But I think I'll have a functiona prototype soon.If you want see the full resolution schematic, I've uploaded it in PDF in my blog:http://www.tutoelectro.com/wp-content/uploads/2012/05/USBPS-V1.0.pdfI need to pretty up the schematic and re route the PCB since I did it with the autorouter a couple days ago just to see how it looked.Well what do you think guys?Thanks!

author: johnnyfp
author_rank: Frequent Contributor
timestamp: May 30, 2012, 08:53:35 pm
content: No Charge Pump Switch mode?I understand the need for a portable powersupply and one connected to USB. But with only a 5v output, bit limiting. Would be nice to have a higher voltage, maybe up to 12v.Maybe swap the 18F26 for a 5v version. A 18F2550 , that way you could reduce component count and make it smaller?Jfp

author: Twistx77
author_rank: Regular Contributor
timestamp: May 30, 2012, 08:57:22 pm
content: Charge Pump? Under 10€? Not possible, I don't think so. Also you might get more voltage but not more power. You reduce the current. I intend this only for microcontrollers and digital circuitry development.The 18F2550 its more expensive, need a crystal, and hace less interesting features like peripheral mapping.Thanks!

author: free_electron
author_rank: Super Contributor
timestamp: May 30, 2012, 10:34:02 pm
content: what is U2 ? part number ?most top side current sense chips cannot measure current if the voltage on the inputpins goes below 3 volt.so if you set the supply to make 1.8 volt your current sense does not work ... i'm interested to see datasheet of U2 ...Q1 will burn... use a DPAK or D2PAk part and provide heatsink.

author: johnnyfp
author_rank: Frequent Contributor
timestamp: May 30, 2012, 10:44:38 pm
content: Ah for under 10€ I see. Low cost PSU, I like it.You do realize that the PicKit2/3 already does this, so maybe there are some useful tidbits from that circuit that you could also use.Jfp.

author: EEVblog
author_rank: Unknown
timestamp: May 30, 2012, 11:13:31 pm
content: What current shunt amp are you using for U2.1?Dave.

author: Twistx77
author_rank: Regular Contributor
timestamp: May 31, 2012, 06:58:26 pm
content: Hi,I'm aware of that limitation about current amplifiers. Dave, I'm using MAX4372, it has too much input offset so it will measure poorly under 10mA but its the cheapest one that I could find that could measure down to 0V.All the prices are based on Mouser prices. I just got the package with the componentshttp://twitpic.com/9rduhiIf I understand correctly the 4372 should be able to measure down to 0V since power is in a additional pin.Quote from: free_electron on May 30, 2012, 10:34:02 pmYo think it will burn with only 900mA? I might change it, I need to make some tests with it first. If it gets too hot, I'll change it of a DPack + Heatsink if necessary, but I hotpe not because, heatthinks are bulky and expensive

author: free_electron
author_rank: Super Contributor
timestamp: May 31, 2012, 07:49:25 pm
content: feed supply 5 volts and set its output to like 1 volt and pull 1 amp through it ... you are burning off 4 watts at this point.. ins sot89 ? not gonna work ...

author: Twistx77
author_rank: Regular Contributor
timestamp: May 31, 2012, 07:51:21 pm
content: It is a SOT-223.

author: Twistx77
author_rank: Regular Contributor
timestamp: June 04, 2012, 05:22:03 pm
content: You are right, I'll have to either parallel two of them and that would take them to the extreme so, that's not good idea so I might try to change a DC/DC converter or find a more powerful Transistor.

author: codeboy2k
author_rank: Super Contributor
timestamp: June 04, 2012, 08:21:53 pm
content: Quote from: free_electron on May 31, 2012, 07:49:25 pmfree electron is correct. DPak or D2PAK is better for Q1. A D2PAK is the best, it has the lower thermal resistance for both J-C and J-A. At 4 watts you don't absolutely need a heat-sink, you can get away with a copper area on your board. The attached graph shows you can dissipate about 3 watts with a single sided 3cm x 3cm area. If you double side it and stitch it with numerous 15-20mil plated though holes, you can probably go up to 5W, maybe 6W, but the holes add thermal resistance to the second side so it's not going to be a clear doubling of the graph.

author: Twistx77
author_rank: Regular Contributor
timestamp: June 04, 2012, 08:26:20 pm
content: Thanks, I'll check it out. The problem will be to finde a D2Pack transistor with similar features as the one I'm using. I'll have to look it up. For now I'll makr my first prototype with the one I'm using right now and after I have everything kind of working I'll switch to the D2Pack or even chaging a bit the design to make a DC/DC instead of a linear.I'll have to work on that.Once again, thank you for the feedback!

author: EEVblog
author_rank: Unknown
timestamp: June 05, 2012, 06:19:19 am
content: Yeah, this sucker is going to get hot.Even with an 80% efficient direct output DC-DC, you'd still be dissipating 1W in that.Same with any tracking pre-reg circuit.The problem with having constant current capability is that it needs to be able to handle the maximum load when shorted. i.e. 5W total in this project.5W is not a trivial amount of heat for a small boardDave.

author: Twistx77
author_rank: Regular Contributor
timestamp: June 05, 2012, 05:34:19 pm
content: Yes, I might need to add a SMD heatsink or what I think I'll do for now is just limit the current but not make a constant current source. So, when you reach the limit you have set it just cuts off the power which is a great thing for people who learns and don't want to burn their circuit by mistake.It's hard to keep things small, cheap and useful

author: Twistx77
author_rank: Regular Contributor
timestamp: June 08, 2012, 03:51:08 pm
content: Hi again,I've made a simple modification and routed the board to try to solve the dissipation problem. I've changed the old NPN transistor to a TO-252 MJD44.I also made a big pad for the Tab of the transistor and I also connected it with many vias to plane with the same net so I coud get extra dissipation.The problem that I see now is that it will probably generate problems if I want it to be soldered by machine. Where I work they do this but not that big and the have no problems.What do you guys think??I still need to add ground planes.

author: EEVblog
author_rank: Unknown
timestamp: June 08, 2012, 11:45:33 pm
content: It's maybe worth extending those vias all the way along the heatsink. The more copper and surface area and room for airflow the better.And you've still got some dead space there, fill it all with copper, even under the switch.Dave.

author: Twistx77
author_rank: Regular Contributor
timestamp: June 09, 2012, 12:42:57 am
content: Thanks Dave.I've extended them as far as I could. I don't want to extend it under the switch because it will heat the current amplifier and it might worsen my current measurement precision.I will make tomorrow a prototype, and see how well it performs and if everything is OK I'll finish up the details in the board and get some ITead prototypes while I start working in the firmware and PC Software.Thanks!

author: blackdog
author_rank: Frequent Contributor
timestamp: June 09, 2012, 10:10:11 am
content: Hi,Nice project Twistx77 :-)I found 2 papers from Analog Devices in there Analog Dialogue.This one is about current sense resistorshttp://www.analog.com/library/analogDialogue/archives/46-06/shunt_resistors.htmlAnd this one is about "Staying Well Grounded"http://www.analog.com/library/analogDialogue/archives/46-06/staying_well_grounded.htmlKind regarts,Bram

author: Unknown
author_rank: Unknown
timestamp: June 09, 2012, 11:00:51 am
content: The blob of copper above C1 can be made part of the cooling surface for Q1.Also if you move R1 to the left and flip R2 to the other side of the trace you could have only one trace connecting C1 R2 and the via (this is just nit picking of course)Last but not least, a way of mounting the PCB would be good if you decide to put it into a box.

author: johnmx
author_rank: Frequent Contributor
timestamp: June 09, 2012, 11:28:12 am
content: You should correct that ground plane. I see disconnected islands and ground ‘antennas’.Regarding the schematic, I believe the circuit will oscillate. Don’t waste your time and money making the first PCB without testing the circuit first, especially for stability problems.Tip: Always keep the schematic complete. Don’t forget any part number or value. Later you will know why…

author: Twistx77
author_rank: Regular Contributor
timestamp: June 09, 2012, 01:22:35 pm
content: Quote from: blackdog on June 09, 2012, 10:10:11 amThanks! I'll take a look at them. I've read a lot of papers like those in the last couple of weeks!Quote from: HAL-42b on June 09, 2012, 11:00:51 amThanks, I have to still make lots of adjustments like that. This is just the first prototype to see if the circuit works well. About the box, no box please. I love how a circuit looks without box. I love electronics, and I love when people see me working in electronics and they see the circuits and wonder what that thing doesQuote from: johnmx on June 09, 2012, 11:28:12 amThe plane will be corrected before sending it to PCB manufacture. I just made a home prototype with no ground plane to test stability. It should be stable, for what I've been reading about LDO Regulators the stability problem is caused usually but the output capacitor which should have an ESR between 10mOhms and 10Ohms aprox.Anyway, I'll try to build the whole prototype today and tomorrow and make some firmware and software for it so I can test its performance.Thank you all for your advices! I greatly appreciate them!

author: johnmx
author_rank: Frequent Contributor
timestamp: June 09, 2012, 02:08:59 pm
content: Quote from: Twistx77 on June 05, 2012, 05:34:19 pmThis is called foldback current limit. It ensures that the pass transistor is always within its safe operating region.

author: johnmx
author_rank: Frequent Contributor
timestamp: June 09, 2012, 02:38:49 pm
content: You should remove C6 and connect it on the output in parallel with J2.Add a small capacitor between the output and the inverting input of U1.1 and the same for LMV324 (Part 2). This will introduce a zero which increases stability. Of course you can do this using trial and error method or by measuring the phase margin.

author: Twistx77
author_rank: Regular Contributor
timestamp: June 09, 2012, 10:19:29 pm
content: Thanks, if it oscillates, I'll keep that on mind. Anyway, I still have a lot to work on. I finally got everything I need for my PCB prototype so tomorrow when I get sometime I'll build it.