Hello , my name is kimi and i want ask some question
- i am using acs712 (current sensor 30A) when i do troubleshooting in hardware using arduino uno my lcd (16x2) show unstable current and sometimes become negative and current not 0 when the input voltage is 0
I combine current sensor and voltage sensor in one supply voltage
here my code ( in simulation there is no problem )
/---------Voltage----------/
temp1=analogRead(VOLT);
volts= (temp15)/1024.0;
Vin = volts / (R2/(R1+R2));
delay(10);
/---------Current----------/
adcValue = analogRead(CURRENT);
adcVoltage = (adcValue/1024.0)5000;
currentValue = ((adcVoltage - offsetvoltage)/sensitivity);
delay(10);
/---------Power----------/
power= (currentValue)* Vin;
delay(10);
/------Display Result------/
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“V:”);
lcd.print(Vin);
lcd.setCursor(0,1);
lcd.print(“C:”);
lcd.print(currentValue);
lcd.setCursor(8,0);
lcd.print(“P:”);
lcd.print(power);
Serial.println(Vin);
Serial.println(currentValue);
Serial.println(power);
delay(125);