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)