Arduino UNO max4080 and analogRead() unstable readings.

Hello,

I have recently started to use arduino. It seems a lot of people has same issue as me. So what's my problem. I have a max4080 which is measuring current its sense resistor is 0.1 Ohm. Max4080 is F series so its 5v/v gain. I expect current to be no more than 5 amps so 2.5V is max voltage on output of max4080 (pin 5). Output pin is connected to pin a1 of Arduino UNO. I have connected 0.1uF ceramic cap across output (pin 5max4080) and gnd and connected it straight to A1 of Arduino UNO. When I read pin A1 I get all crazy kinds of results. From no readings to some readings that are nowhere near the actual readings. I have tried using lm324 as buffer and the going to A1 pin but no luck. What am I missing.
I have tested A1 with potentiometer and its reading values correctly. MAx4080 is outputting correct values. So I'm in need of some more circuitry from max4080 to a1 pin on UNO. Or should I just skip atmel adc for and offboard solution like ads1115.

int Imeasured=0;
int Iin=A1;
//int Iin=PA0; stm32 pin
float cRatio=0;
float Vin=0;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);

//analogReference(INTERNAL);
}

void loop() {
  // put your main code here, to run repeatedly:
 cRatio=0.0048828125; //5v refernecer
  //cRatio=0.0010752688172043010752688172043; // 1.1v reference
 Imeasured=analogRead(Iin);
 Serial.print("Digital value: ");
 Serial.println(Imeasured);
 Serial.print("Voltage: ");
 Vin=Imeasured*cRatio;
 Serial.println(Vin);
 Serial.print("Current: ");
 Serial.println(Vin*2);
 delay(2000);
}

MAx4080_and_UNO.ino (617 Bytes)

Are you putting more than 1.1V on pin A1? What is the MAX4080 output voltage (Volts per Amp)?

If you are operating this from a USB port you may have low voltage, the MAX4080 has a minimum voltage specification of 4.5 volts. It also sounds like you may have a grounding problem.

JCA34F:
Are you putting more than 1.1V on pin A1? What is the MAX4080 output voltage (Volts per Amp)?

Im testing it with 300mA, so output voltage is 150mV. I'm not using internal reference I used it for testing purposes but its commented out. Relation between Volts and Amp is 2. Meaning you multiply Voltage by two to get Amps. MAx4080 works fine tested with power supply that has amp meter an amp meter and electronic dummy load. everything works fine on that end.

gilshultz:
If you are operating this from a USB port you may have low voltage, the MAX4080 has a minimum voltage specification of 4.5 volts. It also sounds like you may have a grounding problem.

From USB but I measured voltage on max power pins its ok 4.9V. I'm going to try with another breadboard, and play with cap value maybe add resistor between pin 5 of max and cap. I don't think this is max4080 unstable output I'm more thinking that I need to put more capacitance than current 0.1uF. Maybe even 1uF via 330 Ohm resistor.