Author Topic: MCP73832 charger - safely reading STAT pin from MCU  (Read 1099 times)

0 Members and 1 Guest are viewing this topic.

Offline argintviuTopic starter

  • Contributor
  • Posts: 41
  • Country: ro
MCP73832 charger - safely reading STAT pin from MCU
« on: October 19, 2019, 12:33:18 pm »
Hi all,

I want to design a small project and make it portable. It uses an 18650 li-ion battery and I thought it'd be nice to also incorporate a cheap little MCP73832 IC to be able to charge the unit from the USB port. I have been researching for a way to read the STAT pin from the MCU so that I know in the software when the battery is being charged.

Since the USB delivers 5V and the MCU will be powered by the battery - as low as 3.1V, I can't read the STAT pin directly from the MCU because no input should be higher than its VCC. To avoid this issue, I used 2 transistors as a sort of level shifter to interface between the 3V and 5V parts and also light up a "charging" LED (simplified schematic attached).

Is there anything wrong with this way of reading the STAT pin?
None are more hopelessly enslaved than those who falsely believe they are free - Goethe
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4108
  • Country: us
Re: MCP73832 charger - safely reading STAT pin from MCU
« Reply #1 on: October 19, 2019, 12:49:16 pm »
Quote
Is there anything wrong with this way of reading the STAT pin?
Yeah, there's 1 thing. It's unnecessarily complicated.

Quote
I can't read the STAT pin directly from the MCU because no input should be higher than its VCC
See that pullup between 5V and the STAT pin? Instead of connecting it to the 5V rail, put it on your micro's Vdd rail. That's one of the main reasons we have open drain outputs.
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4108
  • Country: us
Re: MCP73832 charger - safely reading STAT pin from MCU
« Reply #2 on: October 19, 2019, 01:15:33 pm »
 

Offline argintviuTopic starter

  • Contributor
  • Posts: 41
  • Country: ro
Re: MCP73832 charger - safely reading STAT pin from MCU
« Reply #3 on: October 19, 2019, 01:28:57 pm »
There's one issue though, if the LED gets its power from the battery, the charging might never finish. In any case, I'll test your idea and also add a load sharing mechanism like here: https://blog.zakkemble.net/a-lithium-battery-charger-with-load-sharing/. That should mitigate any issues.

Thanks for the input!
None are more hopelessly enslaved than those who falsely believe they are free - Goethe
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4108
  • Country: us
Re: MCP73832 charger - safely reading STAT pin from MCU
« Reply #4 on: October 19, 2019, 01:40:54 pm »
^ The variant with the lowest cutoff is 5% typical, 3.75% minimum. If you were using 500mA current limit, that would be 18.75mA minimum.

You can buy variants that cutout at up to 20%, typical. See electrical specifications and product identification page for the codes/suffixes.

Quote
also add a load sharing mechanism
Good idea.
« Last Edit: October 19, 2019, 01:45:59 pm by KL27x »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf