USB charger circuit for car  - Page 1
Forum section: electronics / projects

author: Charybdis
author_rank: Contributor
timestamp: April 04, 2019, 05:47:25 pm
content: Hi there, lurking through some technical datasheet of LM338 I've come with this scheme of a USB 1A charger to be installed in my glorious Fiat PandaWhat do you think about it ?Any suggestion?I've replaced the 1N4xx diode with smth that can handle safely 1A, and this is what TME sells..Thank you for your advice!!

author: madires
author_rank: Super Contributor
timestamp: April 04, 2019, 06:01:58 pm
content: At 1A that circuit would produce about 7-8W heat and it requires a matching heatsink. Is there any particular reason why you are going for a linear voltage regulator? In most cases a simple buck converter makes more sense.

author: Charybdis
author_rank: Contributor
timestamp: April 04, 2019, 06:11:47 pm
content: Basically because I'd like to learn somethingThanks I didn't consider that at all !Do you think this " FISCHER ELEKTRONIK FK 222 SA " 20K/W will do the job ?

author: madires
author_rank: Super Contributor
timestamp: April 04, 2019, 07:40:52 pm
content: Sorry, that heatsink is much too small. Another thing to consider is the ambient temperature in your car. During the summer time it could be about 50°C. So you would need a fairly large heatsink to cool the LM338. I'd suggest to use a buck converter for the car and the LM338 for a simple lab PSU.

author: ebastler
author_rank: Super Contributor
timestamp: April 04, 2019, 07:52:59 pm
content: Quote from: Charybdis on April 04, 2019, 06:11:47 pmIn the interest of „learning something“: The 20K/W spec means that each Watt of power which the heatsink has to dissipate, will cause its hot side (i. e. your voltage regulator) to get 20 degrees warmer than ambient temperature. Hence, at 7-8 W power dissipation and 50 C ambient temperature, your regulator would run at 200 C.Way too hot!! As stated earlier, you would need an unpractically large heat sink too cool the linear regulator properly. Hence the suggestion to use a buck converter, which has negligible power loss in comparison.

author: mc172
author_rank: Frequent Contributor
timestamp: April 04, 2019, 08:23:56 pm
content: Quote from: ebastler on April 04, 2019, 07:52:59 pm50°C ambient! Come on, Germany isn't THAT warm.The heatsink wouldn't have to beimpracticallylarge, especially if you just wanted to use this as a messing around with electronics exercise. Here's one that would probably do the job, according to the RS website data entry person:https://uk.rs-online.com/web/p/heatsinks/7226915/It's a bit on the large side relative to the equivalent switching type converter, but not ridiculous.

author: tsman
author_rank: Frequent Contributor
timestamp: April 04, 2019, 08:35:17 pm
content: Quote from: mc172 on April 04, 2019, 08:23:56 pmYou can easily exceed 40+C inside a car parked in direct sunlight even in Europe.

author: ebastler
author_rank: Super Contributor
timestamp: April 04, 2019, 08:37:42 pm
content: Quote from: mc172 on April 04, 2019, 08:23:56 pmIt‘s meant to be operated in a car, and in routine (unattended) use. It can easily get that warm in a car parked in the sun, even in Germany. And for unattended use I would want more safety margin than the 5K/W heatsink you suggest.Ok, maybe not impractically large — how about „annoyingly large“? ;-)

author: mc172
author_rank: Frequent Contributor
timestamp: April 04, 2019, 09:04:39 pm
content: That's a fair point that I hadn't considered!

author: Charybdis
author_rank: Contributor
timestamp: April 05, 2019, 11:15:57 am
content: Quote from: ebastler on April 04, 2019, 07:52:59 pmThank you so much !! I've read a tutorial online now on how to calculate correctly what correct size you need and that has been interesting. I found in my datasheet that Tj has to be maximum 125°C with absolute max of 150°C. I found a bunch of dissipator and I'll be the circuit because the room in my old car is soooo huge compared to the fancy new car.Given that what do you think of the design itself ?Is it safe ?Thank you all guys !!

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 05, 2019, 12:05:02 pm
content: That circuit seems pretty vulnerable to normal vehicle power transients.Automotive Line Transient Protection Circuithttp://www.ti.com/lit/an/snva717/snva717.pdfhttps://www.eevblog.com/forum/projects/battery-protection-circuit/Probably many more resources about vehicle power protection....

author: madires
author_rank: Super Contributor
timestamp: April 05, 2019, 01:41:21 pm
content: No need for over-engineering, a TVS diode (1.5KE or P6KE) would be sufficient.

author: Charybdis
author_rank: Contributor
timestamp: April 06, 2019, 03:43:52 pm
content: Quote from: Richard Crowley on April 05, 2019, 12:05:02 pmLOL, thank you for you reply: I'll take a look at the material you posted.But this is what my 21years old glorious Car looks like.I think that the circuit I'm building will be 20 years innovative than the rest of the stuff that's insideelectrical engineer in Fiat didn't even put some relays on the headlightsand I'm going to fix this in few months

author: radiolistener
author_rank: Super Contributor
timestamp: April 07, 2019, 01:26:47 am
content: I think there is needed for some kind of protection from high voltage pulses which may be present in the vehicle power line.These pulses may be up to kilovolts, and it may damage expensive iPhone with no protection from high voltage pulses.

author: Charybdis
author_rank: Contributor
timestamp: April 07, 2019, 11:52:56 am
content: Quote from: madires on April 05, 2019, 01:41:21 pmDo you think that this1.5KE15Aone will be fine ?Type of diode transilPower dissipation 1.5kWMax. off-state voltage 12.8VBreakdown voltage 15VMax. forward impulse current 71ASemiconductor structure unidirectionalI modified the circuit with the diodes mentioned. Are they in the correct position ?

author: madires
author_rank: Super Contributor
timestamp: April 07, 2019, 12:20:16 pm
content: The TVS goes between Vcc and Gnd, like a Zener. Simply put it in parallel with C1. 15V could be a tad low. I'd suggest 18V.

author: mariush
author_rank: Super Contributor
timestamp: April 07, 2019, 12:21:32 pm
content: If you want to learn something, use a MC34063 switching regulator to get your input voltage down to 5v, or down to around 6-7v and then down to 5v using a linear regulatorPlenty of documentation for it in datasheets (the chips are made by various companies, just download several datasheets and look at the instructions, notes etc in them),there's online calculators for parts :http://www.nomad.ee/micros/mc34063a/andhttps://www.electronicproducts.com/DC-DC_Circuit_Calculator.aspxand even software for it for ex.https://sourceforge.net/projects/mc34063uc/All parts are cheap and can be bought from TME and others... all through hole... My advice would be design it for 11v..14v input, 6v output and then use a linear regulator to get 6v down to 5vWith 34063, you'd get up to around 0.75A of output current... here's an example:The inductor value is odd, but it's a minimum - you can use slightly higher value, for example in this case 27uH or 33uH would be super common and standard values, bigger may mean slightly lower efficiency but you don't care about this. The hardest part to get would probably be the 0.12 ohm resistor for Rsc, but you can obtain it using two or three resistors in parallel ... for example you can use 2 x 0.22 ohm in parallel which gives you 0.11 ohm which is close enoughThen just get a 5v Linear regulator with a voltage drop lower than 1v at 0.75A ... for example LM2941 ... or loads of other regulators out there which are cheaper.You still learn a lot and make your own circuit, but you don't have as big of a heat issue (you'll only have to dissipate 0.75w - 1v at 0.75a max)

author: Charybdis
author_rank: Contributor
timestamp: April 07, 2019, 06:02:53 pm
content: Thank you so much my friendmariush!!Unfortunately as for now I'm not so skilled to fully understand everything.But i truly apreciate your post

author: Charybdis
author_rank: Contributor
timestamp: April 07, 2019, 06:14:25 pm
content: Sorry to bother you, Madires. But do you think that this will be fine ?I changed the diode and left the other 3 normal. Is it ok now ?Thank you very much

author: madires
author_rank: Super Contributor
timestamp: April 07, 2019, 07:16:12 pm
content: Yep!

author: Charybdis
author_rank: Contributor
timestamp: April 09, 2019, 10:44:44 pm
content: Thank you Madires, I'll make the circuit when I'll receive the material

author: mariush
author_rank: Super Contributor
timestamp: April 10, 2019, 09:51:03 am
content: Some comments about that schematic :C1 (100uF)- should be rated for minimum 25v, because a car's battery/alternator often provides up to around 13.8v..14.5v, which is fairly close to 16v rating, so a higher value should be used.- 100uF is just a common value, it's not critical.. it can be a bit higher and even a bit lower.The battery is very close and you only need some capacitance to provide a bit of smoothing out of the input voltage and a bit of filtering (the wires between the battery and regulator can act as very small value inductors so capacitor acts also as a filter, taking care of variations in voltage from battery).Point is you don't need exact values ... you could use something very common like 470uF 25v if you want to... but anything higher than let's say 1000uF would be pointless.R1 and R2 set the output voltage of the regulator - datasheet tells you the formula Output voltage = 1.25v (the reference inside regulator) x ( 1 + R2/R1) = 1.25v ( 1 + 820/270) = 1.25x(1+3.037) = 5.04vSome linear regulators need at a minimum of current in order to output a smooth voltage on the output pin... and you control that amount of current with the R1 value. If the circuit doesn't work right, lower that R1 to 100-120 ohm, and adjust the R2 value to maintain that ratio .. for example use 330 ohm and 100 ohm ... that gives you 1.25v x ( 1 + 330/100) = 1.25v x 4.3 = 5.375v maximum, which is good enough. All USB devices are designed to handle up to around 5.6v, and you'll probably lose 0.1v..0.2v in the cables between the usb connector and whatever you have plugged in)C3 ( 10uF) doesn't hurt anything, but also doesn't do much. Normally it's recommended to be used when you change R2 to a potentiometer to make the output voltage adjustable. As it is right now, it won't make any difference, it may smooth out the output voltage a tiny bit but basically not noticeable.You could remove it completely if you can't buy it.ZD1 is more or less a protection measure ... if somehow the regulator dies and outputs more than 5.6v. the diode "activates" and protects everything.C4 and C5 - there's no benefit to having one 1uF before the zener diode and one 10uF after the diode. If they're both electrolytic capacitors, it really makes no difference. There may be some benefit to adding a 1uF CERAMIC capacitor there, because it would filter stuff that the electrolytic capacitor can't filter so well.As for C5 ... most regulators say at least 10uF is recommended... there's nothing preventing you from using slightly higher capacitance, but it also often doesn't bring any benefits.In your case, to save money, you could reuse a 100uF 25v rated capacitor, for example you may get a better price ordering 5 100uF 25v capacitors instead of ordering 1x100, 1x10, 1x1uF.While you could use capacitors rated for 6.3v, since the output voltage should be 5v, unless you're space constrained it makes no sense, 6.3v rated capacitors are often not cheaper than 10v rated or 16v or even 25v/35v rated capacitors at such low capacitance values.Some regulators will only output a stable voltage on the output as long as there's at least something connected to it consuming some current, let's say 5mA or something like that.A bit of that is consumed by the adjustment mechanism (those 2 R1 and R2 resistors) but you also make the circuit constantly "busy" with your led.The resistor R3 controls the amount of current going through the led... you can estimate the value depending on the led's forward voltage and current desired :Input voltage - Forward Voltage of led = Current x ResistanceSo for example if you're using a red led with a forward voltage of 2v and you want minimum 5mA (0.005A) you know the resistor will be R = (5v - 2v) / 0.005A = 3 / 0.005 = 600 ohm.In your circuit, a value of 330ohm with a red led would probably let around 10mA go through the red led, which may be too bright. You may find out that even 470ohm will be too small, led could still be very bright. You could try raising that value to 1000 ohm / 1 kOhm

author: Charybdis
author_rank: Contributor
timestamp: April 10, 2019, 07:00:36 pm
content: I'm really ASTONISHEDMariush! There is a bunch of enthusiast forum in Italy like Grix.it or Electroyou but they are full of selfish people, reluctantly to reply to "silly" questions and they deleted the same post I wrote in here !!! I have a lot of savaged capacitor and I already bought a kit on eBay so I can spend extra cap in this projectI will carefully follow your suggestions, but I have few questions:-I'll put a ceramic 1uF as C4, but as for C5 is it true that "the higher (capacity) the better"?-Are the diodes in the right orientation ?-Do I have to use only one 1.5KE15A as above mentioned or I have to replace EVERY diode in the scheme with these 1.5KE15A ?Thank you very much ! I truly apreciate your help !!Lorenzo

author: mariush
author_rank: Super Contributor
timestamp: April 10, 2019, 08:16:46 pm
content: If you use a ceramic 1uF for C4, it should be rated 50v or higher. It really won't make much of a difference if it's there or not.The diodes seem to be in correct layout to me.You only need the "special" diode at the input of the regulator, to protect it from transients and crap produced by the car's alternator as it charges the battery of your car.The other two diodes can be any kind of cheap diode, as long as they're rated for more than the output voltage of the regulator. It could be something as simple as an 1n400x diode, where x can be 1,2..7.. difference is just maximum voltage supported by diode .. so 1n4001 would be max 50v, 1n4002 would be max 100v ... 1n4007 would be max 1000vThe D3 diode is really only needed if you use the C3 capacitor, and it's there to protect the regulator from voltage coming back into the regulator.D2 is also kind of optional, but a good idea to be there if you use a big capacitor on the output (or devices connected to the usb have big capacitors inside)Since you don't know what you'll plug in the connector, it's better to have that diode always there.See datasheet of LM338 :http://www.ti.com/lit/ds/snvs771c/snvs771c.pdfSee page 12, section 8.2.1.1 Design Requirements where it explains the role of those components. See also chapter "protection diodes", section 8.2.1.2.3 (page 14).It explains there... but I can try to explain it... Let's say you have a big capacitor and it's charged with energy and there's 5v on the capacitor. Now imagine you suddenly disconnect the battery or whatever powers the circuit. So on the input the voltage suddenly drops down to 0, but you have 5v on the output and now the energy tries to go back from the output back to the input ... if it goes through the chip, the chip can be damaged. So by placing the diode between the output pin and the input pin, you create a more direct path for the energy from the capacitor to go instead of going through the chip.The components inside the regulator in theory can handle up to 25v as the datasheet says, but that may vary depending on who makes the chips... there's lots of companies making LM338 regulators.Also, keep in mind that some of these datasheets were written 10-20 years ago and the text can be vague ... for example the datasheet I linked to is copyright 1998-2016, and while the text of such datasheets is often updated and revised, it's better to stay on the safe side.For example, the text on page 14 says "Most20-μF capacitors have low enough internal series resistance to deliver 20-A spikes when shorted." - but were they talking about regular electrolytic capacitors from the 1990s or 2000s which have worse specifications than the modern 2010-2020 electrolytic capacitors, or did they update the text with the modern components in mind? Or, were they thinking of tantalum capacitors or ceramic capacitors? Tantalum capacitors were often favored back then because they had better characteristics compared to electrolytic capacitors.Linear regulators don't need a lot of capacitance. Some regulators require a certain minimum of capacitance, like 10uF for this particular regulator.Some regulators (due to their internal design) require some capacitance as long as some other requirements are met.For example, datasheets of regulators in the 1117 series recommend having a capacitor with ESR between 0.1 ohm and 1 ohm at the output...A 10uF 16v electrolytic capacitor may have an ESR value that's higher than 1 ohm, but a 47uF 25v electrolytic capacitor may have around 0.3-0.5 ohm ESR and the regulator would work fine. It's not just the capacitance but also the volume of the capacitor, often capacitors rated for higher voltage are also a bit larger.An electrolytic capacitor that's too big, could have too low ESR .. for example a 820uF 10v capacitor could have ESR below 0.1 ohm and that's not good for a 1117 regulator.Polymer (solid) capacitors can have very low ESR.. for example you may have a 100uF 16v polymer capacitor with ESR below 0.1 ohm .. that could cause the regulator to not work right.Also, ceramic capacitors typically have very low ESR, under 0.1 ohm so it's not safe to just use a 1uF or 10uF ceramic capacitor with a 1117 linear regulator.Some old datasheets don't even mention this ESR thing, but simply say "a 10uF capacitor is enough for stability" - because datasheet was written in the days where tantalum capacitors were more popular and a 10uF tantalum capacitor of that age had an ESR value higher than 0.1 ohm for sure (and ceramic capacitors were maybe too expensive to consider back then).So you have the be aware of the minimum requirements but you have some room to "optimize" the components to make your circuit cheaper by using slightly bigger capacitor, or a different diode, things will work unless you have some very strict requirements (efficiency, heat produced, noise produced by regulator etc)The capacitance is more important when it comes to other types of regulators .. switching regulators, inverters, charge pumps.. these function in a different way and capacitors are more importantMaybe this video can help you understand some things

author: Charybdis
author_rank: Contributor
timestamp: April 13, 2019, 12:36:09 am
content: Quote from: mariush on April 10, 2019, 08:16:46 pmActually the original schematic came after the very datasheet you mentioned !I thought it was kinda safe but it turned out in this forum it was not suited for automotive spikes. I watched the video you posted but I didn't undersand everythingI found Dave made a video on linear regulators and that was somehow easier to me.Thank you very much Mariush

author: Charybdis
author_rank: Contributor
timestamp: April 16, 2019, 12:56:50 am
content: Hi there I was wondering about F1 specs.Is it ok to put a 3A fuse?does it have to be fast, or slow?Thank you so much

author: soldar
author_rank: Super Contributor
timestamp: April 16, 2019, 11:49:37 am
content: For a while I had a car which would kill any 12V to USB adapter which was plugged in when cranking the engine. I had to remember to unplug before cranking and I killed quite a few when I forgot. Especially if I killed the engine in traffic and wanted to start in a hurry.I guess I could have put some protection but I always thought I would remember to unplug it.

author: madires
author_rank: Super Contributor
timestamp: April 16, 2019, 01:09:23 pm
content: Quote from: Charybdis on April 16, 2019, 12:56:50 amThe things to consider are the inrush current (mostly by filter caps), the maximum load current and over-voltage situations (suppressed by TVS). I'd suggest to go for a medium blow fuse rated slightly higher than the maximum load current to be able to deal with short overloads by inrush current or over-voltage. BTW, you could add a power resistor in series with the fuse to help with the power dissipation (less for the LM339) and to limit current. In this case a fast blow fuse could be used.

author: jfiresto
author_rank: Frequent Contributor
timestamp: April 16, 2019, 03:19:51 pm
content: Quote from: soldar on April 16, 2019, 11:49:37 amI have an old car, that lacks a central suppressor, which may see up to 80V load dumps if you respect the original equipment requirements.I used an off the shelf, 12V USB car charger, and designed and placed a circuit upstream that disconnects the charger around 24V, well below its 36V absolute limit. I can dig up and post the design if there is interest.I decided that was less work than designing and making an extra robust charger.

author: Charybdis
author_rank: Contributor
timestamp: April 17, 2019, 11:21:45 pm
content: Thank you for all your replies.Quote from: madires on April 16, 2019, 01:09:23 pmI'll go for a medium fuse then. I would take the fuse 3 times greater than the amount delivered to the usb. Am I right ?Also, is it safe to put the fuse AFTER the diode 1.5KE diode ?Thank you

author: madires
author_rank: Super Contributor
timestamp: April 18, 2019, 01:17:59 pm
content: The fuse should be the first component in a circuit to protect the circuit and the power source. For a maximum load of 1A please try a fuse rated for 1.4 or 1.6A, but not 3.15.

author: Charybdis
author_rank: Contributor
timestamp: April 18, 2019, 11:18:12 pm
content: Thank you Madires

author: Charybdis
author_rank: Contributor
timestamp: November 20, 2019, 03:23:04 pm
content: Ciao guysFinally I made the order with all the components and beyond (50 different items)I was wondering if I can replace the HER203 diode that has "Maximum average forward rectified current 2A"with some diodes from the 1N400x family that I already have at home, even though they have "Maximum average forward rectified current 1A" and my regulator will provide up to 1,5A to devices.Thank you very much for your help once again

author: madires
author_rank: Super Contributor
timestamp: November 20, 2019, 05:45:28 pm
content: I think 1N400x should be fine as protection diode.

author: rvalente
author_rank: Frequent Contributor
timestamp: November 20, 2019, 07:54:48 pm
content: Im using the lm2596 boards for 3 years on my 307 as phone charger set at 5.1v, never tested in load dump and im not woried. Short the d+ ans d- for fast charging

author: tooki
author_rank: Super Contributor
timestamp: November 20, 2019, 10:58:09 pm
content: Quote from: mc172 on April 04, 2019, 09:04:39 pm... and this is why every single summer, dogs and small children die inside locked cars. People do not understand that it can take as little as 10-15 minutes to reach lethal temperatures inside the car.As for this charger, at an ambient temperature of 24C, it only takes an hour in the sun to reach 50C. So you can imagine how after a whole day, it could reach a lot more.https://www.t-online.de/leben/familie/kleinkind/id_69606574/so-schnell-wird-hitze-im-geparkten-auto-lebensgefaehrlich.htmlhttps://www.dogingtonpost.com/how-hot-does-it-really-get-inside-a-parked-car/

author: mc172
author_rank: Frequent Contributor
timestamp: November 20, 2019, 11:36:40 pm
content: I'm aware of the issues of pets and children left in cars and I think that people that subject their pets to such torture should be subjected to it themselves, swiftly followed by castration - I just hadn't thought about the usage case where the car either wasn't running or had nobody in it, i.e. without A/C running or windows down, car moving, direct sunlight etc. as is the usual nature of a hobby device where the OP doesn't specify anything other than it's a Fiat Panda.

author: Charybdis
author_rank: Contributor
timestamp: November 21, 2019, 06:13:08 am
content: Quote from: tooki on November 20, 2019, 10:58:09 pmI don't think you should worry that much asthis charger will be used for a maximum of 3 hours straight, twice a weekin the worst scenario.I consider myself as a very pessimistic person but I think you are worrying a bit too muchas I will use this charger only when I'm driving, I don't want to left my phone in the car charging for a limitless amount of hours.Oh and I don't have any dogs and kids