I'm having trouble with my current sensor. I have acs712 30A current sensor. And after uploading the code the serial monitor & serial plotter only shows a negative voltage and doesn’t change at all after turning on the power and the motor runs fine. I’m trying to measure switched reluctance motor phase current, but it doesn’t seem as though the sensor is recognizing the motor current (~12Amps). I also have tried 2 other codes and the same type of thing happens where the serial plotter doesn’t change values after turning on power. Im also using the ground, 5v, and A0 pins of an Arduino Uno.
The code3A_plot picture shows my observation of no change in current before and after current turning on power.
[ code ]int value;
const float vpp = 0.0293255132;
float voltage;
float current;
void setup() {
// put your setup code here, to run once:
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(6, HIGH);
digitalWrite(5, HIGH);
delay(3000);
digitalWrite(6, LOW);
digitalWrite(5,LOW);
delay(1000);
value = analogRead(A0);
value = value - 551;
voltage = value * vpp;
current = voltage / .066;
Serial.println(current);
} [ /code]


