This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ25628E: BQ25628E: Detecting an attached battery

Part Number: BQ25628E

Tool/software:

Hi, this question follows from one asked in this post, about detecting the presence of a battery with this device. I am trying to do the same in my design, and have followed the procedure outlined in Part 1 of the Battery Detection Algorithm shown in the accepted solution for that post. My setup draws power from VBUS (via USB), with no attached battery. Unfortunately I am having trouble getting that solution working in my setup, however.

Some possible clues:

  • My design incorporates a Fuel Gauge (a MAX17263 from Analog Devices). The BAT pin of the BQ25628E is connected to this fuel gauge by way of a sense resistor. This sense resistor is connected between the BATT pin of this charger, and the battery itself. I'm not confident this is correct - this is my first time designing a circuit like this, and I pieced together my understanding of these connections from various datasheets and online resources. 



  • I'm testing my system with a VBUS connection (via USB), but no battery attached. As advised in the link above, I initially pull the CE pin high on the BQ25628E, to disable charging before trying to detect a battery. I notice that this causes the LED I have connected to the STAT pin on the device to light, which seems surprising to me. the fuel gauge also seems to have power flowing to it at this point, also surprising. 
  • When I take ADC measurements with a battery attached. the VBAT values seem reasonable, around 4.0V or so. When I completely detach the battery, however, the ADC readings seem to be around 4.1V-4.2V. I'm totally confused by this - I would expect to see values closer to zero here?

What might I be doing wrong here, or can I do to troubleshoot this?

Thank you!

  • Hello, 

    Thank you for reaching out via E2E. Please see my comments below. 

    Firstly, for your future reference since the time of the E2E post you linked we have made an Application Brief (linked here Battery Detection Using Single Cell Charger (Rev. A) ) on the same topic. The procedure is the same with a few minor adjustments, but there is additional information and example waveforms you may find helpful. 

    Regarding your comment on the fuel gauge implementation, unfortunately you would need to reach out to the appropriate expert for that part to confirm whether connection is correct. 

    I initially pull the CE pin high on the BQ25628E, to disable charging before trying to detect a battery. I notice that this causes the LED I have connected to the STAT pin on the device to light, which seems surprising to me. the fuel gauge also seems to have power flowing to it at this point, also surprising. 

    This is not expected and I recommend you verify voltage at /CE is in fact at logic high ( > 0.78V). STAT pin LED will be on when charging is in progress. It should not be on if charge is disabled. You can also try disabling charge via software by setting REG0x16[5] 'EN_CHG' = 0b. 

    When I take ADC measurements with a battery attached. the VBAT values seem reasonable, around 4.0V or so. When I completely detach the battery, however, the ADC readings seem to be around 4.1V-4.2V. I'm totally confused by this - I would expect to see values closer to zero here?

    It is possible to observe voltage at BAT with no battery connected as output capacitor may be charged. This is why in the procedure for battery detection step 5 is to enable BAT pin discharge using 'FORCE_IBATDIS' bit. With no battery connected and charge disabled VBAT_ADC is expected to read a value closer to zero after the capacitor has been discharged. 

    Alternatively, if BQ25628E is powered on from USB with charge disabled via /CE pin and no battery connected BAT pin voltage should measure 0V as the charger IC will not provide any power to this output pin. 

    Best Regards,

    Garrett 

  • Thank you, this is great info. 

    Another followup question: what would you recommend as the most reliable way to 'trigger' this detection algorithm, for the case of battery removal or insertion? Or, rather, if I have implemented this algorithm, and concluded that no battery is present, is there a flag I should be looking for that would suggeest a change in VBAT that would cause me to re-run the algorithm to re-check? Do you imagine it's done in a polling style periodically? 

    Thank you!

  • Hello, 

    Thank you for your response. 

    When device is in charge disabled state there will not be a flag due to battery insertion. Here are a couple suggestions on when to trigger the detection algorithm. Firstly, as you mention you can simply periodically run the algorithm to check for battery insertion. Alternatively, you can use the built in ADC (specifically the VBAT_ADC channel) to check for voltage at battery and if voltage is present with charge disabled you can then run the detection algorithm to verify it is in fact a battery connected. 

    One thing to consider if you are planning to rely on the ADC is to consider the case of a dead battery. Typically a battery protector will open the path from charger to battery to prevent any further discharge of a low battery. I.E. VBAT_ADC will not see any voltage change if dead battery is connected. Depending on your application you may need to periodically run the algorithm to check for this case. 

    For battery removal during charging my recommendation is to perform a check based on if CHG_STAT register changes. During normal charging you expect to be in CV phase of charge for some time, but if no battery is connected device will terminate charge almost immediately. I do not know if you plan to have a gauge in your system, but for example if capacity is 50% and then moments later CHG_STAT indicates charge has terminated it is most likely the battery was removed and BQ25628E quickly charged the output capacitor to termination conditions. 

    Please let me know if you have any follow-up questions.

    Best Regards,

    Garrett 

  • This is awesome, thank you so very much for your help!