Measuring voltage of current source pin on ADC - Page 1
Forum section: electronics / projects

author: WillHuang
author_rank: Contributor
timestamp: February 11, 2018, 02:35:03 am
content: Hello,I am using a battery charger IC (BQ24075: datasheet:http://www.ti.com/product/BQ24075/technicaldocuments) that has a pin called Iset that can be used to determine the actual charge current. You can do this buy connect a resistor between the pin and ground, and measure the voltage across the resistor. The current calculated from ohm's law is 1/400th of the actual charge current.I am trying to measure this voltage on a ADC channel on my microcontroller (Stm32), however I am only reading zero's across the ADC data register. I know that I have setup the ADC correctly because I can measure the voltage on other pins no problem. I also setup an Arduino ADC and branched the Iset pin off to the arduino's ADC and I get the same result as well. This tells me that something is wrong with the electronic circuitry. I've attached a simplified version of the circuit.One thing I know is that there wasn't a proper circuit the help drive the ADC (unfortunately). I thought buffering the output of Iset would provide a low enough impedence to drive the ADC. So I quicky setup a voltage follower that outputs to the Arduino ADC. The opamp i used (the only one I have) was the LM358. Unfortunately, this did not help at all. For some reason, the non-inverting pin would be at ~0.4V (normal), the output pin would be at 1V. When I connect the non-inverting pin to ground, the output pin was still at 1V. I don't know what is going on here at all.Something else I tried just randomly was putting a 47uF capacitor between Iset and ground, and I get proper ADC measurements. (I'm still somewhat new to electronics, so I don't fully understand that's going on here. Any explanation or suggestions would be greatly appreciated!

author: danadak
author_rank: Super Contributor
timestamp: February 11, 2018, 12:33:20 pm
content: The issue you have is the LM358 is not RRIO, specifically itsoutput swing is limited because its output will not drive all theway to its negative rail.If you add a 10K R, output to ground, it will drop the output to~ 20 mV of ground.Best to use a RRIO OpAmp, lots of choices, most low cost.Regards, Dana.

author: WillHuang
author_rank: Contributor
timestamp: February 11, 2018, 03:22:48 pm
content: Quote from: danadak on February 11, 2018, 12:33:20 pmThanks, unfortunately I dont have any RRIO amps at the moment, but Ill go buy some soon. I put a 10k to ground and I get a nice 0V at the output when V+ is tied to ground. However, when I tried to connect V(+) to the Iset line, I get random ADC readings from the range of 0V to ~2.5V

author: Siwastaja
author_rank: Super Contributor
timestamp: February 11, 2018, 03:26:49 pm
content: If you don't need high conversion rate or high bandwidth, a 100n cap at the ADC input pin is enough to provide the low impedance for the sample/hold, instead of an opamp. Try this first.

author: WillHuang
author_rank: Contributor
timestamp: February 11, 2018, 04:35:28 pm
content: Quote from: Siwastaja on February 11, 2018, 03:26:49 pmThis was what I tried after I failed with the op amp. I did it "just because why not" and not because I knew that the capacitor would provide that low impedence. I was initially surprised about it and was thinking about why this worked, and not the op amp, and not without the capacitor.I don't require a high bandwidth so I guess this is fine for now. I'm just stuck on the why and reasoning on why this works

author: WillHuang
author_rank: Contributor
timestamp: February 12, 2018, 06:59:52 pm
content: Dear all,It turns out that the Iset pin was pulsating and was the reason why I could not get good adc measurements.