4S Li-ion pack charger and protection complete circuit - Page 1
Forum section: electronics / beginners

author: VEGETA
author_rank: Super Contributor
timestamp: February 12, 2020, 10:18:20 pm
content: Hello,I have been working on a circuit that allows charging and protecting a 4S Li-ion battery pack assuming the use of non-protected cells. I plan to use this circuit in another future project thus I like to take your opinion on it.Input is 5V USB and outputs around 16.8V with current limiting circuit by pulling the EN pin of the DC-DC boost converter to ground to shut-off the boost converter and so on. This is the only solution that I got so far so what do you think? Assuming the cheapest parts available.Looking forward to your comments!

author: mvs
author_rank: Frequent Contributor
timestamp: February 13, 2020, 04:51:15 pm
content: Your diff amp looks a bit strange. 5v supply is not sufficient for high side operation. It may work with "over the top" opamp like LT1637, but not with general use opamps.

author: VEGETA
author_rank: Super Contributor
timestamp: February 13, 2020, 07:19:35 pm
content: Quote from: mvs on February 13, 2020, 04:51:15 pmWhat do you suggest then? I am still gonna use this cheap op-amp. I thought it would take it ok but maybe you mean the inputs will be higher than its rail voltages??I am more interested in the rest of the circuit to be ok, what do you think?As for current limiting, I am open at making a hard constant current limit like 1A using any cheap method. No need for adjustable current limit, any hard one is ok with me and that is why I choose this one.

author: fcb
author_rank: Super Contributor
timestamp: February 13, 2020, 07:53:25 pm
content: You aren't using the CTL pin to control charge/discharge? Just relying on the cell voltage state machine?Where are you connecting the negative side of the battery to? I can guess, but it's not on drawing?Why not use the sense resistor 'Rsense' (which is 100||100 - to high?) to do your current sensing for charging.I'm lost why you have a constant voltage boost (HX3608) setup for charging. Especially with that mad 7 resistor potential divider. It'll just sit there and hiccup. Have you read how to charge Lithium cells?Going to ask where do V+ and V- (for the opamp) come from before I declare that won't work.What does "charger(-16.8v)" mean? Why negative?

author: mvs
author_rank: Frequent Contributor
timestamp: February 13, 2020, 08:12:17 pm
content: Quote from: VEGETA on February 13, 2020, 07:19:35 pmYes, max. common mode voltage on opamp inputs is 16.8V*R22/(R21+R22)=16.8V*10K/11K=15.3V, which is a lot higher then Vcc of 5V. You may reduce gain to get it right.QuoteCheap? If you do not need any precision, 4A switch current limit of HX3608 may do the job. Lets estimate...Duty cycle D=(Vo+Vin)/(Vo)=(16.8-5)/16.8=70%, Iout(max)=Isw*(1-D)-dI/2=4A*30% - dI/2= 1.2A - dI/2Inductor ripple current dI is typicaly around 30% of Iout, so you get just around 1A.In discharged state, say at 3V per cell, D=(12-5)/12=58%, Iout(max)=4A*42% - dI/2= 1.7A - dI/2.In this case you will get around 1.5A of your boost converter.

author: fcb
author_rank: Super Contributor
timestamp: February 13, 2020, 08:38:31 pm
content: Using the (not tested - see datasheet) current limit of the boost IC's on-chip shunt resistor is a crap way compared to doing it properly. The efficiency of the converter drops off - and that means it will likely run hot.You could amplify the Rsense voltage (battery current) and feed it into the FB pin of your converter and develop a constant-current scheme. Loop stability might need some work, but doable.

author: mvs
author_rank: Frequent Contributor
timestamp: February 13, 2020, 09:05:15 pm
content: Quote from: fcb on February 13, 2020, 08:38:31 pmProper current limit is fine and dandy, but HX3608 is barely sufficient for the task... 4A switch current is already the region, where one should look at boost controller + external MOSFET, rather then integrated boost converter.

author: VEGETA
author_rank: Super Contributor
timestamp: February 13, 2020, 10:39:51 pm
content: QuoteI don't understand, what does CTL pin do and why it is important? my method relies on total cell voltage and putting a hard current limit.QuoteYou mean J1? this is just the charging and protection circuit... it will be part of a linear (with switching pre-regulator) lab supply.QuoteThis one is around 50 ohms which is Rvss not Rsense. Rsense here doesn't exist since it is not necessary in thedatasheet.QuoteThe reason is simplicity and cost. I know Li-ion batteries need to be in constant current mode until they are about to full charge then switch to constant voltage. However, I read that constant voltage is ok assuming putting maximum current limit... the downside maybe is the speed of charging. Also, assuming a 1A limit, still comparable to constant current itself since I won't choose anything bigger than 1A.the 7 resistor divider is to get 1K and 27K divider to output required voltage according to HX3608 datasheet. choosing 7 is due to parts consolidation, that is all.QuoteFrom the USB charger input as shown in the diagram. However, people showed it needs a bigger voltage input so maybe we need to redesign it.Quotethis is not - but ~, meaning "approximately 16.8v" since it is a switching supply. maybe the image is not as sharp as the pdf.______________QuoteWhat do you suggest? powering the op-amp from the boost regulator itself? if this solution has many problems, then maybe going for another current limit method is better?QuoteYes, not so precise. 1A is ok, 1.5A is ok but not more for sure. Actually not so many USB chargers can deliver this to begin with...I am a bit skeptical about relying on the boost chip since maybe someone will put one of those 2.5A chargers... I think I've seen a hard current limit somewhere that relies on just 2 transistors but I couldn't figure how to dial the current limit.QuoteHmm I thought of driving the FB pin to ground as a method for current limit but this chip seems to have FB pin as the negative of the internal comparator while the 0.6v reference at the positive. TBH the datasheet is not well written to explain it properly. If feeding it a positive voltage above 0.6v is the way to go like say 2.5v (to not reach the absolute of 5v)... then I don't know what voltage is gonna be there since the FB pin gets its voltage from the divider connected to the output (16.8v).Quotegetting external mosfet and controller increases cost for not so much gain since 1A is good enough for now. what proper current limit that you suggest?

author: mvs
author_rank: Frequent Contributor
timestamp: February 14, 2020, 07:53:39 am
content: Perhaps you can go with HX3242... It has bigger package with ground pad for better heat transfer and external current sense resistor to arbitrary set switch current limit.https://lcsc.com/product-detail/DC-DC-Converters_HX3242_C172357.html

author: VEGETA
author_rank: Super Contributor
timestamp: February 14, 2020, 02:42:19 pm
content: Quote from: mvs on February 14, 2020, 07:53:39 amIt has a switching current limit of 3A, I wonder how can one calculate the desired output current.what about the rest of the circuit?

author: mvs
author_rank: Frequent Contributor
timestamp: February 14, 2020, 03:14:48 pm
content: Quote from: VEGETA on February 13, 2020, 10:39:51 pmRsense is needed for discharge over-current protection.Rsense=Viov / I

author: VEGETA
author_rank: Super Contributor
timestamp: February 14, 2020, 10:00:25 pm
content: Quote from: mvs on February 14, 2020, 03:14:48 pmbut in the datasheet it says it can be 0 and no typical value

author: fcb
author_rank: Super Contributor
timestamp: February 14, 2020, 10:11:04 pm
content: If you don’t have current sense resistor how will it measure current for protection purposes??

author: mvs
author_rank: Frequent Contributor
timestamp: February 14, 2020, 10:37:01 pm
content: Quote from: VEGETA on February 14, 2020, 10:00:25 pmSure it can be 0, if discharge OCP function is not needed by an application.Typical value, ugh... S-8254 has many different versions, with different Viov1 levels. You may also define your own triggering current.

author: VEGETA
author_rank: Super Contributor
timestamp: February 15, 2020, 12:25:48 am
content: Quote from: mvs on February 14, 2020, 10:37:01 pmFrom the table I think I picked this: S-8254AAVFT-TB-x which has Viov1 of 0.20 ± 0.025 V. So what does this mean in terms of Rsense and the rest?But what do you mean by triggering current?I've seen this in the datasheet:QuoteRvini is 1k ohm and we need to determine Rsense and the rest but I don't know how. Viov1/2/3 seems constant to the model you pick. but i couldn't find how to determine Rsense and if it can be a total current limit.This is the protection chip, so it takes care for overcurrent in terms of battery discharge current. we would still have a problem of determining a way to control charging current from the boost chip.

author: mvs
author_rank: Frequent Contributor
timestamp: February 15, 2020, 11:53:13 am
content: Quote from: VEGETA on February 15, 2020, 12:25:48 amIt is discharge current above which OCP kicks in...To make things more complicated there are actually 3 triggering current levels, I1=Viov1/Rsense, I2=Viov2/Rsense, I3=Viov3/Rsense. They differ by delay intervals, lowest current level has longest delay.Note, that OCP has a latched action. To reset OCP you need either to start charging the battery or disconnect any load. So do plan some margin in it.Quote from: VEGETARvini and Rvss are not in path of load current, so they are not important. You can choose default values.Rsense=Viov/I , just Ohm`s law, nothing fancy here.

author: VEGETA
author_rank: Super Contributor
timestamp: February 15, 2020, 12:10:43 pm
content: Quotehmm so Viov1 is about 0.3v and the entire design has a maximum load current of 3A, so let's say 4A is the overcurrent. Rsense = 0.3/4 = 0.075 Ohms. Is that ok??That is the discharge current which is already being limited by the power supply circuit, I need to manage the charging current limit.QuoteI choose default values. Rsense is what is important, as shown above.Rsense is for OCP for discharge current, we need to do the charging current now assuming the removal of my op-amp solution.

author: fcb
author_rank: Super Contributor
timestamp: February 15, 2020, 02:02:42 pm
content: Quote from: fcb on February 13, 2020, 08:38:31 pm^this^

author: VEGETA
author_rank: Super Contributor
timestamp: February 15, 2020, 10:09:34 pm
content: Well, the FB pin has a certain voltage that it needs to maintain due to being one of the error amplifier inputs. why not return to doing it externally?my previous circuit should work if given proper power supply but also I made it control the EN pin since I don't know if pulling the FB pin low or high makes it reduce the output. Perhaps we should investigate that or just look for another simple solution?I couldn't find a cheap charging ic which has this... till now.

author: fcb
author_rank: Super Contributor
timestamp: February 15, 2020, 10:56:33 pm
content: So your S-8524 deals with over-current, over discharging and over charging. So you just need a constant current source?

author: VEGETA
author_rank: Super Contributor
timestamp: February 15, 2020, 11:15:07 pm
content: Quote from: fcb on February 15, 2020, 10:56:33 pmI didn't think that the S-8254 can do all this, I only thought it would do the discharge protection not the charging one. Also, if S-8254 can do over-current protection, shouldn't we need a constant voltage source rather than a constant current one??I found this very cheap IC that has everything:CN3795. What do you think?

author: fcb
author_rank: Super Contributor
timestamp: February 16, 2020, 12:14:09 am
content: The data sheet says it can do all three (over current, over charge and over discharge).

author: VEGETA
author_rank: Super Contributor
timestamp: February 16, 2020, 07:54:57 am
content: Quote from: fcb on February 16, 2020, 12:14:09 amKindly see my schematic. Charger output is connected to B+ and B- which are the protected terminals of the battery. So now charging current flows in B+ (to the right direction if you are looking at the diagram) which battery current flows out of B+ to the left. The battery should be able to supply say 4A (since maximum for the design is 3A) but we want charging current to be around 1A only.So what happens when we connect the charger and we are supplying current to a hungry load? say we supply 2A of current but charging current is about 1A? the other situation is also interesting where we supply 0.5A but charging current is 1A. will this mean that the charger supplies 0.5A to the load and the remaining 0.5A to charge the battery?I am still trying to understand how to assign the overcurrent limit to S-8254. The chosen version has "0.30 +- 0.025 V" of Viov1. So should we choose a certain Rsense to match that at our current??

author: VEGETA
author_rank: Super Contributor
timestamp: February 16, 2020, 08:52:31 am
content: My confusion resides in the difference between charging current and discharging current, and how to set both of them. My guess is 8254A IC only takes care of discharging current.Furthermore, I don't know how to set the maximum discharge current limit. Many modules using 8254A claims different limits from 10 to 20A. So how can it be determined?If we could determine the discharge current limit then the rest is just charging current. If it really becomes more complex, then we could just rely on CN3795 IC since it is cheap.what do you think?

author: mvs
author_rank: Frequent Contributor
timestamp: February 16, 2020, 11:44:50 am
content: Quote from: VEGETA on February 15, 2020, 11:15:07 pmThis charger IC is made for buck topology. You will need a bit higher supply then 5V to use it with 4S Li-ion pack.

author: VEGETA
author_rank: Super Contributor
timestamp: February 16, 2020, 11:56:55 am
content: Quote from: mvs on February 16, 2020, 11:44:50 amwell, then I use the 3608 boost IC before it. easy.However, I hope you could help me to answer previous questions about how to determine discharge current since there is nothing in the datasheet (that i know of) that says that. I couldn't figure out how to choose and configure Rsense and so on.I mean many BMS boards using the same 8254A IC but with different maximum current, how?

author: mvs
author_rank: Frequent Contributor
timestamp: February 16, 2020, 03:26:42 pm
content: Quote from: VEGETA on February 16, 2020, 11:56:55 amThis boards may have different versions of 8254A, different Rsense and different MOSFETs. If you have some photos of this boards you might see used components. Rsense would be usually a large 2512 package or even 2 in parallel with clearly readable value on it (like R010 for 0.01 Ohm).

author: VEGETA
author_rank: Super Contributor
timestamp: February 16, 2020, 05:35:38 pm
content: Quote from: mvs on February 16, 2020, 03:26:42 pmI wanted to know from the datasheet. I don't think mosfets are of any relation except to be powerful enough to handle the current but not to determine the maximum current itself.See an example board here (10 amps):https://cbu01.alicdn.com/img/ibank/2017/294/031/4501130492_1344841943.jpg-> it has 2 of R010 in parallelanother one (6 amps):https://my-live-01.slatic.net/p/af3bb4846bb0ecbb822f3087715dca0f.jpg-> it has 2 of R020 in parallelThis one is 10 amps:https://img.joomcdn.net/5e2c6ead056818092e50dc2e871701ff131835f9_1024_1024.jpeg--> only one R010this one is very clear:https://images-na.ssl-images-amazon.com/images/I/71QhMB--BGL._SL1004_.jpgit says 6 amps and has 2xR020 in parallel with 51R0 which is 51 ohms recommended value of Rvss.thus maybe we could say this: I choose 100x2 in parallel = 50 ohms as Rvss and choose something like 0.01R as Rsense to allow 6 amps or 0.005R to allow 10 amps. both are more than enough but maybe i can go with 0.005R since it is used in the sepic pre-regulator.^ How about this suggestion?I will modify the circuit to add CN3795 with H3608.

author: VEGETA
author_rank: Super Contributor
timestamp: February 17, 2020, 07:07:06 pm
content: I have updated the schematic and added charging IC. Charging current is maximum of 1.2 amps which is good.Notes:1- R14 = 100R instead of 120R, C14+C15 = 200nF instead of 220nF. I guess this is ok right?2- L1 = 10uH to ensure it works.3- R27 = 0.005 as agreed previously.4- No LEDs for CN3765 IC, no need for them.What do you think now?

author: fcb
author_rank: Super Contributor
timestamp: February 17, 2020, 07:59:03 pm
content: I would fit the LED's for debugging purposes and delete for MFR. R11 not necessary if you don't have LED's.Any voltage drop across Q1/Q2 will affect the charging circuit - also, what happens if you disconnect (i.e. open Q1/Q2) the battery??R14/C14|C15 compensation network changes - perhaps this will be fine, I wouldn't deviate from manufacturers recomendations until you can test it.Your potential divider on U1 is still a bit mad. Bear in mind that 1% means +/-1% so your exact resistance is likely to be frustrated by tolerancing - are you doing somesort of select on test, and anyway the tolerance stack-up of other items makes it a bit pointless - not to mention that cell terminal voltage is affected by temperature and there is no temperture compensation in the your design.Connection to your lower cell and/or shunt resistor still missing.Boosting to then buck down seems wasteful. But it will probably work. Go and prototype it.

author: VEGETA
author_rank: Super Contributor
timestamp: February 17, 2020, 08:30:39 pm
content: Quoteyes I will probably do it. I added R11 to lower the current a bit, but it seems not so important.QuoteThe drop voltage will be so little, they are necessary anyway. Perhaps you meant making the charging voltage more than 16.79v to compensate for this?S-8254A should connect and disconnect the battery pack automatically AFAIK. I will dig into this more. However, the charger IC CN3765 can power the device without the battery as said in datasheet. I don't know if it can do it while battery is charging.QuoteMine makes nearly the same time constant so I guess it is ok. if anything happened i can just de-solder these and solder recommended ones to test.QuoteI know it is but... consolidation is a beast. This whole circuit is just a part of another bigger project, hoping I could design all of them properly.QuoteI am open to your suggestions, I did all this to consolidation. No other reason. I didn't think that tolerances will be so hugely important here, nice that you taught me that.QuoteI don't know what you mean by this. So you kind lecture is awaited xD.QuoteYes, I will just put a GND (and B-) after Rsense right?QuoteAbsolutely, but still no other choice. Assuming you use 5V 2.5A USB chargers which are cheap and available these days... then I guess it will work. Even when using 12v supply works. Efficiency is not an issue here since no solution can be done.

author: VEGETA
author_rank: Super Contributor
timestamp: February 18, 2020, 06:15:43 pm
content: BTW, I just noticed CTL pin of S-8254A IC. I tied it to LOW since this is what I understood from the datasheet. It is not tied to anything in the typical application circuit.what do you think?

author: fcb
author_rank: Super Contributor
timestamp: February 18, 2020, 06:28:47 pm
content: Quote from: fcb on February 13, 2020, 07:53:25 pm

author: VEGETA
author_rank: Super Contributor
timestamp: February 18, 2020, 06:46:46 pm
content: Quote from: fcb on February 18, 2020, 06:28:47 pmI didn't quite understand how to use it. I want this circuit to be autonomous without intervention from MCU or anything.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2020, 01:23:49 am
content: From the datasheet, putting that pin to ground makes it "normal operation" so this is what we want right?

author: mvs
author_rank: Frequent Contributor
timestamp: February 20, 2020, 02:52:36 pm
content: Quote from: VEGETA on February 17, 2020, 08:30:39 pm16.8V@1.2A is around 20W of power, with efficiency about 70% you will need >30W PSU.5V@2.5A USB charger has only 12.5W, and it may not be designed for continuous operation at this power level.Look better for 19 - 20V laptop PSU.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2020, 03:25:59 pm
content: Quote from: mvs on February 20, 2020, 02:52:36 pmHmm you are right, but 1.2A is like the maximum so even at say 0.5A it should work properly right?Another method I could do is to put another power input which is a DC jack to get 12v but I fear someone will plug 24v instead. Also, what if they plug 2 power sources at the same time? maybe a shotcky diode in series is a good method to make only the largest one (12v) to be the default right?If these 2 methods are available, one could either plug a powerful 12v supply or just stick to USB. what do you think?Also, looks like you didn't check the datasheet for the CTL pin.I checked it and it seems that "normal operation" is when CTL pin connected to ground or "low" like what I did in schematic.. so it seems ok right?

author: mvs
author_rank: Frequent Contributor
timestamp: February 20, 2020, 03:47:40 pm
content: Quote from: VEGETA on February 20, 2020, 03:25:59 pmAnd if somebody plugs it into USB port of a PC, laptop or car radio with 0.5A limit?Schottky diode will cause a voltage drop and will reduce efficiency further. On 5V rail with 0.5V drop you will lose another 10%.QuoteYou need to be able to switch between different charge current limits. Otherwise it is pointless in my eyes.And if you plan to use 12V supply, why not to use 20V laptop brick? You would not need boost circuit and you would have higher charging current, if needed.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2020, 04:39:50 pm
content: Quotethen he knows his limits. If he works with low currents (the final device is gonna be linear lab psu with switching sepic pre-regulator from batteries), then say 100mA load current... then even if charge current is as less as 200mA it would be enough. even if he takes more, he won't drain the battery as hard.Quotehaving the option of 2 charging ratings is the best here.Quotewhy pointless? say we assigned 1.2A as maximum... then if user has 5v @ 0.5A - diode drop - boost drop - etc... = 0.3A total. then the circuit will provide 0.3A of current. If he connected a good 12v-24v supply, then it will give the maximum of 1.2A. However, it is gonna protect and charge the batteries in bot conditions.Now, the performance depends on your choice that you understand.QuoteMost laptop or chinese supplies will give 12-24v DC @ 5A or so which is nice. I will modify the circuit to make the boost chip provide up to 25v so it can take all types of inputs (5v, 12, 18, 20, 24) since if I assigned it at 20v and suddenly connected 24v... then what happens?my main point was to allow people to connect it to USB (assuming they understand the limitations) + high power DC.let's try to solve the CTL pin now. shall we?always thanks to your cooperation.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2020, 05:30:23 pm
content: A quick thinking for isolating the 2 power sources came to these 2 solutions:1- using a 24v relay:https://lcsc.com/product-detail/Relays_SRA-24VDC-CL_C127865.htmlI can tie its coil to the 24v laptop charger as well as tying its NO to it, while the NC is for 5v USB. This way 5v USB is by default unless you plug the 24v dc supply. this can go for around 0.3$ which is kinda ok. contact resistance is about 100 mOhms which is not perfect but can be enough (wasting 0.05 drop voltage for 5v supply).2- using a SPDT switch, panel mount like this:https://lcsc.com/product-detail/Relays_SRA-24VDC-CL_C127865.htmlhere the user has to pick manually.

author: mvs
author_rank: Frequent Contributor
timestamp: February 20, 2020, 05:53:46 pm
content: Quote from: VEGETA on February 20, 2020, 04:39:50 pmBecause it is not that easy. You need to limit charge current not only for battery, but also to match your power source.1.2A after boost converter is >4A before boost converter, if you convert 5V to 18.6V. This means that 5V 500mA USB port fuse will trip or USB port burns. 5V 2.5A USB charger will likely go in overload/short circuit mode...

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2020, 06:04:23 pm
content: Quote from: mvs on February 20, 2020, 05:53:46 pmMy calculations were like this:5v 500mA USB = 2.5W -----> 16.8v @ 2.5W = 148mA of charge current maximum. Thus it won't reach the 1.2A maximum limit. That is unless you mean the charging circuit will force 1.2A which will cause voltage drop at 5v USB.5v 2.5A USB = 12.5W ------> 16.8v @ 12.5W = 744mA of charge current.Kindly explain to me if I am wrong. I assumed the charging IC will not exceed the current limit and won't force constant current if it cannot reach it.So far we have no problems using the DC jack input and we have a problem with USB input. what solution do you suggest we work on?

author: mvs
author_rank: Frequent Contributor
timestamp: February 20, 2020, 06:28:12 pm
content: Quote from: VEGETA on February 20, 2020, 06:04:23 pmTo not exeed 500mA at 5V rail, you will need to enforce 148mA limit on your charge IC. Just forget 1.2A, in this case it should be 148mA ( - some margin for losses).If you connect 12V 2A supply, you may reconfigure your charging IC for full 1.2A charging current.

author: VEGETA
author_rank: Super Contributor
timestamp: February 20, 2020, 06:41:01 pm
content: QuoteWell it is easy then.Charging current = 0.120 / RsenseOption 1 (USB 5v): Rsense = 1 ohm -> charging current = 120mA.Option 2 (12-24v): Rsense = 0.1 ohm -> charging current = 1.2A ----> this could also be configured to have more than 1.2A if needed like ~ 1.5A or something.I will modify the circuit to show this assuming the use of SPDT relay, until we reach a better solution. Also, we need to determine the CTL pin although I am kinda sure it is connected properly.

author: VEGETA
author_rank: Super Contributor
timestamp: February 21, 2020, 01:03:54 am
content: Updated schematic to versionAlpha 3.Updates in brief:1- Added a SPDT relay to choose which power supply (USB or DC jack). I will make a custom model and footprint for it later.2- Modified boost to give 25.2v to always ensure working with up to 24v of input.3- Now has 2 shunt resistors for charge current set: 1.2A and 120mA for DC and USB respectively.4- Shunt resistors are automatically chosen depending on active source... via N-channel MOSFETs.5- Added a 5.1 zener diode to DC jack input to act as enable voltage for 1.2A charge current.I barely made it fit into one page, I still don't know how to make another page in KiCAD (but within same schematic sheet).I remind you that CTL is "low" which means "normal operation" according to datasheet.how about it now?

author: fcb
author_rank: Super Contributor
timestamp: February 21, 2020, 07:25:09 pm
content: Looking at your schematic.1. You've definitely not read/understood how the buck converter/charge IC (CN3765) works. L2 is the buck inductor and is wired all wrong.2. Is D2 necessary?3. Risk of pulling DC jack out, relay de-energising, C5 dumping straight into USB+, you could possibly argue that the relay will take longer to reclose than the boost converter will take to empty C5, but still not nice. You could just put a 2nd HX3608 in to deal with the 2nd voltage source, probably cost less than the relay.4. My head hurts looking at the multiple current shunts (x3) and I'm not going to start looking up the Vgs of Q4/5 to work out what is going on.My advice would be to start again, simplify your specification (avoid mission creep) and prototype something.

author: mvs
author_rank: Frequent Contributor
timestamp: February 21, 2020, 08:01:29 pm
content: QuoteYou do not need to do this. Feedback set to 19V is absolutely fine. Higher input voltage will find its way to the output (throught inductor and boost diode) in any case.Quote120mA shunt can stay always connected, no need to switch it.You have battery voltage (up to 16.8V) on source of the MOSFET. It would not open with just 5V on thegate.Note that RDSon of the MOSFET and ressistance of the tracks on PCB will affect results of curent measurement. Kelvin connection (Fig. 3 in the CN3765 datasheet) is not possible.QuoteConnect CTL to VSS, not to the minus pole of the battery.

author: VEGETA
author_rank: Super Contributor
timestamp: February 21, 2020, 08:47:44 pm
content: QuoteOk understood, I will modify it.QuoteIt can affect the high current but not by much so yeah you are right. It would be around 1.32A instead of 1.2A so it is ok. but still need to switch the 0.1 shunt.QuoteI was misguided.. logic level mosfet need Vgs to be 5v or more but this one has Vgs in the minus due to source voltage as you said. Putting DC jack voltage won't do a thing too. What do you suggest?QuoteRdson is low here and PCB tracks will be as short as possible.why kelvin connection is not possible? Also, I was going to take the connection from the pads of the PCB directly, I don't have 4 terminal resistors.Quotewill do.QuoteI was wiring it correctly but when I tried to fit everything into the small space I moved it like that but forgot to re-draw it properly. sorry for this.Quotedatasheet doesn't say about it but rather it says we can eliminate D1. Not an issue right now.Quoteit definitely costs less (assuming inductor + others are cheap) and will try to do it.still the output of the 2 boost converters will be connected together. Yes the shotcky diodes will do some protection but still...if both sources got connected... 5v on one of them while +12 on the other... could the diodes deal with isolation and protection? I guess we will be forced to put the feedback resistor divider before the diodes to make sure nothing gets triggered right?QuoteI will try to modify them to make it better... as consolidated as possible.Quotemvs spoke about Vgs of the mosfets and I took the note... working on it.QuoteI will work again to do all of these modifications. I don't have any parts to prototype but rather will finish the design and order the pcbs with materials.always thanks for both of you...!!

author: fcb
author_rank: Super Contributor
timestamp: February 21, 2020, 11:32:56 pm
content: If you put a 2nd boost converter in: just set the voltage from the EXT.DC powered converter a little higher than the USB one.

author: VEGETA
author_rank: Super Contributor
timestamp: February 22, 2020, 01:00:14 am
content: Updated to versionAlpha 4.Changes in brief:1- Added another HX3608 boost, now dedicated boost for each supply.2- Added an NPN transistor (Q4) to enable the DC shunt resistor which allows +1.3A while the 120mA one is always connected as we agreed.3- Re-arranged feedback resistors as agreed.I hope this solves the problems. The only thing I am not sure of yet is what happens if both supplies are connected at the same time since this will make both boosts on. USB boost is set to 18.6v while DC one is 24.6v. Both connected to the same node... so what is the situation?

author: fcb
author_rank: Super Contributor
timestamp: February 22, 2020, 10:44:03 am
content: Quote from: VEGETA on February 22, 2020, 01:00:14 amThe one supplying the highest voltage will do the work, the other will sit a minimum duty cycle (likely 0%).a. R41 @ 100R will just burn power. This could easily be 1M in your application.b. R42 pointless.c. R43 pointless.d. R55 you'll be stuffing ~20mA into poor Q4's base, this could be 1M or whatever the highest value you have to hand (100K).e. D5 pointless.

author: VEGETA
author_rank: Super Contributor
timestamp: February 22, 2020, 11:07:29 am
content: QuoteI will make it 100K.QuoteI did some LTSpice simulation and these got the best value... although not so good and refined simulation. I will remove them.QuoteOk, 100K it is.QuoteZener voltage here is to make sure we don't exceed maximum of 6v for the3904 npn transistor's Vbe. Input of DC jack is 12-24v so if 24v is on base and ground is on emitter, then it is +24v of Vbe. this was my reason but you seem to differ... I am interested to see where I went wrong.thanks!

author: fcb
author_rank: Super Contributor
timestamp: February 22, 2020, 11:41:39 am
content: Quote from: VEGETA on February 22, 2020, 11:07:29 amI don't want to appear rude. But do you know how a transistor actually works?

author: VEGETA
author_rank: Super Contributor
timestamp: February 22, 2020, 12:07:19 pm
content: Quotenpn transistor need current into their base in order to conduct. more current in base will be more current output due to the beta of the transistor. however, mosfet transistors are voltage-driven not current-driven.Now the npn can be fully on if Vbe is about 0.7v.re-reading your comment made me re-investigate the little circuit. Assuming we have 100k resistor as R55 and that npn transistor... here all drop voltage will be on 100k resistor and vbe of npn will be 0.7v since current is 24v/100k = 0.24mA or something.re-reading the datasheet I noticed it is VEBO not VBE.. thus it is a maximum of 6v reverse voltage. So concluding it is ok to feed our signal in it as long as current is so low.I hope now I am correct.

author: VEGETA
author_rank: Super Contributor
timestamp: February 24, 2020, 06:43:30 am
content: If this is ok, then I might start doing the PCB.

author: mvs
author_rank: Frequent Contributor
timestamp: February 24, 2020, 07:48:28 am
content: Post your last schematic.PS This step is a good point to rethink if you need this beast. If you definitely need USB, it might be better to have some fast charging mechanism. BC1.2 or QC 2.0/3.0 are a bit old, but quite easy to implement. USB-C PD is far better in the medium/long term, but a bit more complicated.

author: VEGETA
author_rank: Super Contributor
timestamp: February 24, 2020, 04:26:03 pm
content: QuoteIt is in the attachments.QuoteYou are right but this is not a priority right now since I have 2 charging options. For USB, my point was to make it working and functional not necessarily fast. 120mA is very slow for a huge battery pack but if the load is below that, then it will be useful. Also, the user knows what he does and what he gets + the other very fast charging option is there.Maybe in the future I will re-design it to add it or better yet it is gonna be open source so anyone can implement it.

author: mvs
author_rank: Frequent Contributor
timestamp: February 25, 2020, 09:30:57 am
content: 1. It is better to connect CTL input of S8254 to VSS, not GND of your schematic (all voltage levels are referenced to VSS). In this case you can also eliminate C12 and probably R37.2. If you do not need charging state indication, leave nCHRG and nDONE outputs of CN3765 unconnected. R11 has no purpose, its just generating heat.3. I do not like your shunt switch circuit. As a whole and particularly very low values of R41 and R43. MOSFET will work fine with >10 KOhm gate drive in non high speed switching applications.

author: VEGETA
author_rank: Super Contributor
timestamp: February 25, 2020, 09:49:30 am
content: QuoteI will connect it to Vss of battery pack when I get back from work. I will keep R37 and C12 since they are in the datasheet circuit... at least R37.QuoteI don't need it in the final product but now maybe a good choice is to put the pads in the PCB in order to test the circuit... when I want it to be the final circuit, I just de-solder the LEDs and R11. Final circuit probably won't have any.QuoteThis is the only way I found without using relays and another charging IC. It is a practice of me to put at least 10 ohms at mosfet gate rather than getting it to be a direct connection.this application is not fast as you know. what values do you recommend?

author: fcb
author_rank: Super Contributor
timestamp: February 25, 2020, 11:12:29 am
content: Quote from: VEGETA on February 25, 2020, 09:49:30 amUnderstand why fast switching MOSFET circuits often have gate resistors. You don't need fast switching (as in microseconds), you don't need the gate resistor.Update your schematic again.

author: VEGETA
author_rank: Super Contributor
timestamp: February 25, 2020, 07:09:21 pm
content: QuoteI updated it with the following:1- added 2 LEDs as indicators. will be soldered to test the circuit and then removed (along with their resistor) in final product or if I needed to.2- modified mosfet driving circuit by upping the resistors... I even attached an LTSpice simulation of it using nearest parts. It works.3- removed the zener circuit and made it with just one resistor.4- attached CTL to Vss.Quotefrom my knowledge, gate resistor eliminates ringing effect of the gate due to the gate's capacitance. higher gate resistance means better ringing elimination and slower switching... and vise-versa.ringing happens due to the fast switching of the gate and can cause oscillation, thus a good recommendation is to put a resistor to take care of it. I see 100R as fit value here.Is everything ok now? I think so.

author: fcb
author_rank: Super Contributor
timestamp: February 25, 2020, 09:14:08 pm
content: Looks largely OK.1. You still don't need R42, but it won't harm operation.2. C12? Not on the manufacturers datasheet.Now go build it.

author: VEGETA
author_rank: Super Contributor
timestamp: February 25, 2020, 10:32:53 pm
content: Quote from: fcb on February 25, 2020, 09:14:08 pmOk this is Alpha 6 version. kept mosfet 100R resistor for now, and removed that capacitor.Now I will try to begin laying out the PCB.