Hi guys,
first of all I have to thank you. I'm pretty new to Arduino and this Forum has already helped me a lot.
But lets go straight to the problem.
I want to measure the current and voltage of a mobile speaker. The voltage is measured correcly, but the current measurement is giving me a headache.
I'm using the ACS 712 5A current sensor on a Arduino Nano (china clone). The measured value fluctuates way to much for my application. This seems to be a quite common problem, but normaly the values are spread by +-2 or something. I did some testing and the best results I got were +-10.
There is nothing else hooked up to the Arduino.
And here are some of the results from my testing:
You can see 4 different measurements packed into one diagramm (its not really important which one is which). Bevor you wonder why 512 isn't the average, my PC somehow only outputs around 4V on the USB port. I can't see any pattern in the values. Sometimes they jump 15 up or down, sometimes they don't change at all.
I tried which impact the following changes have (and they all made almost no difference):
-Cable length of the sensor (20cm and 5cm)
-Time between two measurements (25ms to 250ms)
-Premeasurement (Measurment thats not used, 2ms Delay, Measurement thats used, 25ms Delay)
-Power Source (Desktop PC / Laptop without the Powersupply hooked up)
-0,1µF Capacitors between the 3 Pins of the Sensor (I tested every possibility)
-Pullup/Pulldown Resitor on the measurement pin
-No Current Flow through the Sensor/2A Current Flow
-Different Arduino Nano
-Tieing all the other analog Pins to ground
-Making a Lowpass Filter out of a Resistor (1k) and a Capacitor (0,1µF).
-Displaying the Voltage on a LCD screen, so I have no PC hooked up.
My cheap multimeter says that the output voltage is stable. I don't have an osciloscope on hand.
I even had another current sensor bevor, that showed the same behaviour. It was a ACS 711EX (+-15,5A).
I thought about smoothing the Value inside the Arduino, but the Problem seems to be so fundamental, that I decided to ask for help.
Here's the code I did the testing with:
const int analogPin = A0;
int sensorValue = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead (analogPin);
Serial.print(millis());
Serial.print(" ");
Serial.println(sensorValue);
delay(250);
}
Is there anyone else with these problems? Or is there someone with the same hardware and no problems?
I hope, I didn't forget any important information.
Thank you in advance,
Leo