Maker Pro
Maker Pro

Few questions about usage of TI BQ2054

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
Hi all !
Before starting, my apologies for this long post (and for potential English errors) :)

The context (you can skip) : I'm continuing to get things ready to work on home automation process. And as I will be us ing my soldering iron a lot I first plan to build myself a little fan to suck out the emanations from the stain wires. Aside from the fan part which is fairly easy to build (battery, switch, fan, 3D printed case), I'm also working on the design of a small circuit which will serve as a battery charger, so I'll be able to use batteries for the fan and the many other things. The goal is to have a quick charger that supports many voltage and capacity of batteries, but that will go after. First, I'm focusing on a "simple" charger for a single cell battery, at 400mAh.

I decided to use the BQ2054 from Texas instruments for 3 main reasons :
- It is provided as a DIP package (among others)
- It contains all the necessary controls to ensure the security and correct charge of the battery
- The voltage and current of charge is programmable
Here is a link to the datasheet : https://www.ti.com/lit/gpn/bq2054

So. I started to design a simple circuit that would support fast charge for a single cell Li-On battery at a capacity of 400mAh (so, 4.2V of charge @ 400mA). Here is a schematic at my current state of design (click to enlarge):
schematic.png
All explain here why the choice of these components, and why.
  • DSEL/LED2, LED1, LED3 and LCOM : easy and quick. I just followed the datasheet and chose to pull down DSEL to ground to enter display mode 1
  • ITERM : set to ground to end charge when current is less than 10% of the charge current
  • On the left, RB1 and RB2 are a part of the voltage divider bridge used to allow the chip to sense voltage across the battery using pin BAT and regulate it. These resistors are set so battery charge voltage is set to 4.2V (for a single cell 3.7 Li-on battery)
  • RSNS is the resistor used to sense current inside the battery through the SNS pin and control it. The value is chosen to have a max current of 400mA
  • RT1 and RT2 are for the temperature sensor, a NTP thermistor with R25 = 10kOhms. With the help of one of yours, I was able to find the values for the temperature range I wanted (0°C - 40°C) and then compute RT1 and RT2, although it was a bit of pain as I am a bad player at functions maths (shame on me, moreover I'm a rendering programmer...) Anyway, got them to these unusual values. I will use parallel resistors to make them of course.
  • C1 is connected to the TPWM pin. I used the suggested value, to have a frequency for the PWM signal at pin MOD of 100kHz.
Now, 4 pins remain unconnected, and I need your help here (except for TM, I just didn't added the RC circuit here, but I can do it). Here are my questions :
  • Just a concern about the RSMS resistor. The datasheet states, page 6, that the formulae used to compute RSNS is : Imax = 0.25V / RSNS. As no units are provided, I consider that IMax shall be in A, anr RSNS in Ohms. But using this, I end up with a resistor of only 0.625Ohms, and I find this value very low... Shall I use mA instead of A ?
  • For ICOMP and VCOMP, the datasheet says very little about these. On page 9, it states : "To prevent oscillation in the voltage and current controlloops, frequency compensation networks (C or R-C) are typically required on the VCOMP and ICOMP pins (respectively).". I asked my friend Google about frequency compensation network, but what I found concerns OP-Amps only and use 2 pins (to have a resistor in series and a capacitor in parallel. Here I have only one pin to connect the network to, and I have no Idea of the frequencies implied nor on how to add the capacitor and potentially the resistor. Is the frequency the same used by the PWM modulator (setup to 100kHz)
  • The MOD pin... I understand that it provided and PWM signal so I can use sort of a power transistor (e.g. a MOSFET) to provide the current in order to actually charge the battery. But I have no idea of the kind of circuit I have to put around the source and the drain of the MOSFET. Do I have to provide a specific voltage ? Limit the current by using resistors ? etc ? Or is OK if I just add a simple regulated 5V source (the same I use to power the IC)? e.g. if I connect the charger to an USB port, it would have enough power to charge the battery @ 400mA + power the IC.

If you're still here, thanks again for your patience, I understand that though I have some good theory basics on electronics I still lack a lot of knowledge and practice (forget about my project log, I was on the highest point of the Dunning-Kruger curve ;)). However I am confident that I will understand your answer and will be able to learn new things and put them into practice. As Li-On battery charging is dangerous I moreover need to be twice more cautious.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
forget about my project log, I was on the highest point of the Dunning-Kruger curve
You're welcome. It is not too often that someone recognizes this fact:).
I end up with a resistor of only 0.625Ohms, and I find this value very low.
On the contrary: 0.625 Ω is a comparatively large value for a current sense resistor. Take care of the correct wattage.
Shall I use mA instead of A ?
No. Use amperes, see above.

Have a look at the bq2054 development system user's guide. You'll find a sample circuit and lots of useful information there.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
You're definitely full of resources Harald Kapp! I'll check this link during my break :)

You're welcome. It is not too often that someone recognizes this fact:).
This is because I passed this part of the curve, I guess :) But the fall is always impressive, I'll never get used to that. Anyway I hope I'll be able to continue this project when I'll get enough knowledge. I want to finish it.

On the contrary: 0.625 Ω is a comparatively large value for a current sense resistor. Take care of the correct wattage.
400mA * 0.625Ohm = 250mW, I shall indeed use a half Watt resistor. Nice catch. I did not find a resistor of this value in store, I guess I'll have to use several resistors in parallel to produce this equivalent value.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
Woops, big mistake... I cannot edit my previous message, sorry... the power equation is not P = RI but P = UI. As U = RI, P = RI². So here, P = 0.625 * 0.4² = 0.625 * 0.16 = 0.1W. During first part of the charge, intensity is kept constant to what I want it to be (here 0.4A). During second part, voltage is kept constant, and intensity starts to go down until end of charge (1/10th of 0.4A here). So if I understand well, no more than 0.1W will "pass through" this resistor. A quarter watt resistor shall do the trick, although a half watt resistor does not cost way more at very low quantities.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
1/4, 1/2, whatever you can easily get.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
Hello again, long time no see ! :) I took part my spare time reading about SMPS topologies and having a look at the schematic of the dev board you kindly posted a link to, and I think I get most of the stuff it does. But not all! As my goal is also to learn, I just didn't want to simply copy / paste the schematic in Eagle, and instead tried to understand each part of this circuit. Here's what I found and what is missing.

disclaimer: Beware, my post will be a bit long as I'll go into each part of the schematic with my understanding and questions :) I'll explain in details, as if I was teaching someone else, as I want to be sure my reasoning is OK.

I'll display the same schematic several times, with colored background to tell which components I'll talk about. They'll be light gray on next iterations, so not to lose track.

First, the BQ2054 itself (beware, I'm absolute hardcore with MS paint!)
BQ2054-part1.png

In blue:
  • obviously, the center-ot-attention BQ2054 (which I'll just call "the IC" here).
In green:
  • Fisrt, the power decoupling capacitor, C4;
  • C6 and C7 are for the VTERM and ITERM pins I talked about in my first post. They completely look like decoupling capacitors for me, too. Are they ?
  • C5 (which I wrongly put with the decoupling capacitors) is the capacitor used to determine the frequency of the PWM circuit through MOD pin.
In brown:
  • R6 and C6 describe the RC circuit used to setup the maximum allowed charging time before the IC goes into default mode if battery is not full.
In orange:
  • Left jumper is to configure the current at which battery is considered fully charged
  • Right jumper is used to set the LEDs display mode (+ pull-up / pull-down resistor to avoid current fleeing when powering D4)
In purple:
  • the 3 leds circuit + the resistor to the common pin.

Second: voltage and current sensing
BQ2054-part2.png

In blue (voltage sensing):
  • The 4 top resistors (R13 to R16) are the equivalent of RB1 in the IC datasheet, each one corresponding to a given number of cells (3.7V Li-ion batteries I guess)
  • The jumper JP2 is used to select number of cells
  • The bottom resistor (R18) is RB2 of the datasheet.
In purple:
  • Top resistor (R9) is the equivalent or RT1 on the IC datasheet
  • Bottom resistor (R10) is the equivalent or RT2 on the IC datasheet
  • The NTC thermistor (RT't on IC datasheet) is not present here, as it will be plugged-in with the battery on J2.
In brown:
  • The current sensing resistor (R17), marked as RSNS on the IC datasheet.
Let's do some calculations to check that out. Consider we want a 2 cells battery (in series of course). JP2 is correctly set.
  • First compute charge current with RSNS. According to IC datasheet, IMAX= 0.250V/RSNS (R17 in our case, if I'm right). R17 = 0.2Ohms here. 0.250 / 0.2 = 0.250 * 5 = 1A. The dev board datasheet does not say what is the charge current, but it states that it is a maximum of 1.25 Amps, so the 1A value is not aberrant. Of course, if our battery cells are less than 1000mAh in capacity, this resistor shall be replaced
  • Now move on to charge voltage. The IC datasheet states : RB1 / RB2 = ((N * VREG) / 2.05) - 1. In our case, RB1 is R14, RB2 is R18, and N (number of cells) is 2. VREG shall be 4.2V (that's the required charge voltage for a single 3.7V cell). If I adapt the equation to sort out VREG, I gret VREG = (((R14 / R18) + 1) * 2.05) / 2. R14 = 154K, R18 = 49.9K. If I compute VREG with my calculator, I get... 4.18V! Purrfect! (when I read the datasheet, I did not notice the dot in 2.05V. I though it was 205V. Thus, the stupidly wrong values in my initially posted schematic)
  • Finally, temperature sensing. The dev board datasheet states that the component to use is the Philips 2322–640–63103 NTC thermistor. Temperatures values are VLTF = 0°C, VHTF = 45°C and VCO = 47°C. Let's look at the NTC datasheet and get resistance values for these temperatures. I did not found the Philips component, but a NTC with same model number made by vishay (here!). Hopefully there are tables with resistances so I do not have to compute them on my own. I only need RLTF and RHTF, so forget about VCO. I found out RLTF = 32 554 Ohms, and RHTF = 4372 Ohms. Now, to IC datasheet. The formulas are :
    upload_2020-12-30_12-26-17.png
    RLTF = 32554 Ohms
    RHTF = 4372 Ohms
    RT1 is R9 here (4320 Ohms)
    RT2 is R10 here (8450 Ohms)
    I shall find 0.6 * 5 = 3 on (3), 0.44 on (4)

    on (3), I get 2.89V (not far!)
    on (4), I get 0.4V (not far neither!)

    Considering the thermistor has a tolerance of +-5%, I think these results are accurate enough, and I shall have found the right components on the scehamtic.

    I have to go, the rest will be in next part (basically, power supply and the rest (I mean what I don't understand the purpose of)). Second (and last) part will come end of day
 

Attachments

  • upload_2020-12-30_12-25-42.png
    upload_2020-12-30_12-25-42.png
    10.7 KB · Views: 1
  • upload_2020-12-30_12-26-9.png
    upload_2020-12-30_12-26-9.png
    10.7 KB · Views: 1

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
OK, part 2 :)

Third schematic: power supply and capacitor discharge
BQ2054-part3.png

In green:
  • This is the linear voltage regulator that provides the 5V Vcc to power the IC.
In purple:
  • C1 is here to filter out input voltage?
In blue:
  • Looks like Q1 is the "power" transistor;
  • The three other components (L2, D3 and C12) looks like the "flywheel" of the buck topology of this SMPS (as said in the dev board datasheet)
In brown:
  • Q5 seems to be used by the ICTL pin (active low) of the IC, to discharge the C12 capacitor of the flywheel (ID datasheet states that the capacitor shall be discharged in some cases to avoid power surges from the remaining charge;
  • I guess that R19 is here to pull up the ICTL pin when not set to low by the IC;
  • R21 is here in order to have a slightly negative BE voltage and thus be sure that the transistor stays open?
  • R22 is just here to prevent a too fast discharge of C12? Or to avoid a short circuit in case the power transistor is closed and connects directly the 24V input to ground?
  • I don't understand the purpose of R20
In pink (much misunderstanding here...):
  • I noticed that the power transistor (Q1, in blue) is of PNP type, though the MOD pin is not active low. I guess the reason is that the load is after the transistor, and not before. My guess here is that the pink components are here to invert the MOD signal in someway, plus controlling the power transistor which has 24V input and not 5V as the MOD pin shall be when set high. But I really cannot understand the layout here. Do you have some leads for me to understand this?

Last, the rest: BQ2054-part4.png
misc:
  • I have absolute 0 idea of what the pink and brown region are here for. Just... zero.
  • Regarding the green diodes, I guess that there are here to avoid reverse current, but in that case, why using schottky diodes ? Aren't they bad at this?
  • I noticed that the symbols of D1 and (D3 / D7) are slightly different (orientation of the "S" shaped stuff in front of the diode saying it's a schottky one), is it just a drawing issue? All the three of them are the same model (1N5818)
  • As the input voltage may be up to 24V, shouldn't I use 50V capacitors instead of 25V ones? That seems just.

Aaaaaaaaaaaand... I'm done! If you read until the end, congratulations to you. I hope I did not write to much crap here and that your eyes were not hurt. It would be a lot of help if you could help understand the dark spots / answer my questions :)

Oh, and happy new year!!!
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
The first Schottky diode is what is called an "idiot diode". It's there to stop all the circuitry downstream of being blown to bits if connect the power supply back to front. If you do so the diode simply becomes reverse biased. The second one performs a similar function for when the battery is connected the wrong way round.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
Hello WHONOES :) Thanks for your help, my bet was right for the left one, but I didn't think about reverse battery connection, nice catch ! But still, why schottky diodes? Their ability to support reverse voltage is not the best
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
Schottky diodes have a lower forward voltage drop than conventional silicon diodes. The small amount of reverse leakage current they exhibit is neither here nor there. All diodes will exhibit a small amount of reverse leakage current, you can't get away from it.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
Yes. I meant the reverse voltage at which they "blow up" and start to become fully conductive. But yeah, having a lower forward voltage is a good reason indeed. Do you have an idea for the pink & brown regions ?
 
Last edited:

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
No. Your schematics are very difficult to read because of the shading you have added.
 

WHONOES

May 20, 2017
1,217
Joined
May 20, 2017
Messages
1,217
Schottky diodes are no more likely to fail than conventional silicon diodes UNLESS you exceed their reverse voltage rating. This applies to all types of diode and for that matter all semiconductors.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
Oh, I understand. I was not even sure myself that it could be read easily. You can find the schematic into the data sheet of the dev board provided by Harald (follow this link). By zooming it it is easily readable. I'm using the exact same schematic on my thread replies.

Yes for the semiconductors. My point was that the reverse voltage rating of a schottky diode is way lower than the reverse voltage rating of a silicon diode, according to what I read. But I guess that as soon as I don't plug the circuit back to front to a more than 25V to power supply this shouldn't be a problem. (I read 40V of reverse voltage rating for schottky diodes)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
My point was that the reverse voltage rating of a schottky diode is way lower than the reverse voltage rating of a silicon diode
Depends on the diode. As long as the rated reverse voltage is sufficiently higher than the actual reverse voltage both types will block reverse current.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
Yes, thanks :) and that somewhat makes sense to use schottky diodes here as their lower forward voltage drop will reduce energy waste (and heating, but that's not a concern here I guess).
I just need to understand the last 2 sections and I'll be good to make my own schematic using that knowledge. Thanks a lot! I'll try to take some time again and carefully look for the schematic.
 

@xi@g@me

Dec 15, 2016
86
Joined
Dec 15, 2016
Messages
86
I read the BQ2054 DS again, and it looks like one can ignore the thermistance, and notify the IC by using a couple of 10k resistors. Even though I'm still not sure how that does work, the brown region may be here for that. In case no thermistance is plugged-in, this circuit will provide the necessary 10k resistors. The pink region is just needed for the thermistance measurement to work. Yet I still do not understand what C11 is for...

Anyway, I think I have enough information to try out a new schematic. I'll post it here :) stay tuned
 
Top