| Electronics > Projects, Designs, and Technical Stuff |
| MCP73832 charger - safely reading STAT pin from MCU |
| (1/1) |
| argintviu:
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? |
| KL27x:
--- Quote ---Is there anything wrong with this way of reading the STAT pin? --- End quote --- 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 --- End quote --- 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. |
| KL27x:
|
| argintviu:
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! |
| KL27x:
^ 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 --- End quote --- Good idea. |
| Navigation |
| Message Index |