Using Digital Potentiometer with Charger IC - Page 1
Forum section: electronics / projects

author: Chillance
author_rank: Contributor
timestamp: January 04, 2020, 08:20:07 am
content: Hi!So, I figured it would be cool to have a digital potentiometer to change the resistance to vary the charging rate of a charging IC.To make it even cooler, I also have a switch with a bunch of MOSFETs to enable it from having a default resistance.My question here is that I'm a bit confused as how to connect the digital potentiometer to make this work properly.So, when the switch SW1 is OFF, the charger IC U3, pin 5 goes through U2 through 10k R2 to GND. Having set at 100mA charging rate I believe. All nice and dandy.However, when the switch SW1 is ON, I thought I use the resistance on the U1, by going from U3 pin 5 to Q1 to U1 to GND, but from what I've seen on other examples is that pin 6 on U1 is connected to, say a LED and then to GND.So, how am I suppose to do this? I can't connect two outputs together essentially....Bonus question: I'm not entirely sure, but I suppose that is how the shunts are suppose to be to connected when I want to use a current reader IC U4. Essentially the idea is to be able to get the current when charging the battery. The main confusing part might be that the SHUNT_MINUS goes to battery + side. But the shunts need to be connected like that so the IC can get the current right?Thanks!

author: Chillance
author_rank: Contributor
timestamp: January 04, 2020, 09:03:04 am
content: Oh, wait, what I'm suppose to do is connect from Q1 pin 2 to PA (pin 5) on U1! I think...

author: mikerj
author_rank: Super Contributor
timestamp: January 04, 2020, 12:19:12 pm
content: Since the MCP73831 charge current is designed to be set by sinking current from pin 5, why not connect the digipot as a simple variable resistor (B and W pins tied together and grounded) and MCP73831 pin 5 connected to the A end of the digipot? That way you can simply use the shutdown pin on the digipot to disconnect it from the charger IC, no MOSFETs needed.

author: Chillance
author_rank: Contributor
timestamp: January 04, 2020, 12:36:31 pm
content: Yes, this is what I've been thinking about just now. A few questions though.What happens if I don't tie B and W pins together?And, should I connect the MCP73831 pin 5 to A or B? Since the digipot is up to 10K resistance, I was thinking either A or B could be some kind of default value. So, essentially, I was thinking it could potentially default to 10k out of box and then it can be changed using SPI. But I'm not sure which of A or B would default to 10k, or maybe the device defaults to middle value.One other thing I've been thinking is that if there is very low resistance (essentially connecting MCP73831 pin 5 to GND) that is not good? Something needs to be done with that too then. Having a "protective" resistor in series could help, but will offset things a bit, which is fine I suppose. The digipot has like 52 ohms or so min value.

author: mikerj
author_rank: Super Contributor
timestamp: January 04, 2020, 02:52:53 pm
content: Quote from: Chillance on January 04, 2020, 12:36:31 pmI don't know, but the datasheet explicitly tells you do this when using the device as a rheostat.Quote from: Chillance on January 04, 2020, 12:36:31 pmThe datasheet states that only pin A is disconnected in shutdown, so this is the pin you need to connect to the charger IC.Quote from: Chillance on January 04, 2020, 12:36:31 pmA series resistor to limit the resistance to the 2k minimum mentioned in the datasheet would be a good plan.

author: Chillance
author_rank: Contributor
timestamp: January 04, 2020, 09:31:07 pm
content: Ok, thanks for the help! I put a 2k resistor there now so it will be at least that and make it more safe.