Good evening!

I am attempting to measure the voltage drop across a shunt (1.5 Ohm) in series with a solar cell to determine output current, and thus try to implement some MPPT. Since Vsolar is 1.4x VCC, i will need to lower the voltage to measure. From my basic understanding of microcontrollers, I need to insure the impedance is not too high for an accurate measurement. After reading here: https://electronics.stackexchange.com/questions/107741/required-output-impedance-for-adc-input

the rule of thumb seems to be Z <= 10k.

Given max Vsolar is 7.2V, and with max 5% tolerance on R1/R2, I have chosen 1.8k and 3.8k, Which would give 5.04V if R1 was at its minimum tolerance and R2 was at its max. (circuits Attached) R1+R2 should leak only 1mA, so im assuming they are not too small.

With this circuit implemented, My results have been spotty at best(noisy). The current i am measuring is on the order of 80mA max (supplied by Bench supply to test) with 40mA typ. The difference in voltage across the shunt floats between 0 and 18 (i.e 1000-982), which comes to (18/1023)*7.2 = 85mA. Ive since implemented averaging, which has only slightly helped.

for(int i = 0, Vsense = 0; i < (Samples+1);i++){

analogRead(VSensePin);

VSense = analogRead(VSensePin)+Vsense;

if(i == Samples){

VSense = (VDec*VRatio)/Samples //VDec = 5/1023, VRatio = voltage ratio of R1/R2 (7.2/5)

}

}

My questions are this:

1.) With this sampling method, do i need to add a delay between samples?

2.) Is the resolution just too low for accuracy?

3.) Do i need to add a difference amplifier?

4.) Is there anything wrong with this sampling method or is there a better implementation? Thanks!

I haven't ruled out my circuit either, and should note the PCB trace is a few inches long. I tried to follow good routing techniques, though i havent designed many boards (< 10).

Thanks!