Go Down

Topic: acs712 drift over days (Read 152 times) previous topic - next topic

Zorac

Oct 14, 2018, 05:01 pm Last Edit: Oct 14, 2018, 05:05 pm by Zorac
reading through the forum, this sensor seems to cause a fair number of people problems, mine doesn't seem have been discussed though.  I'm fine with the fact that it jumps around a bit, being a hall sensor i was expecting it.  my issue is that it drifts over time, and while some have posted they have that issue over minutes, mine drifts over days.  i have a little over 5 days uptime on it right now and it has drifted up around 0.2A.  when i have my laptop plugged into the arduino the readings go back to normal (and even ready about 0.1A lower then when its not plugged in.  Given that, I though i probably need a pull down somewhere, but that doesn't appear to be an issue with the module.  The only other solutions I have found is to buy a another set of sensors (i have 3 hooked up) from a different batch or supplier.

thoughts?

mikb55

#1
Oct 14, 2018, 06:55 pm Last Edit: Oct 14, 2018, 07:01 pm by mikb55
The ACS712 is a ratiometric device which means the output voltage is affected by the supply voltage which in your case is probably drifting downwards.
Essentially you need to work with the ratio of the output voltage compared to the supply voltage, instead of just using the output voltage for your calculations.


outsider

#2
Oct 15, 2018, 08:56 am Last Edit: Oct 15, 2018, 09:08 am by outsider
What is powering Arduino when it is NOT plugged in to USB? What is your AREF voltage after the sensor values have drifted up for a few days? What is AREF voltage after plugging in to laptop?
I suspect you're running off batteries and as the Vcc voltage falls, the AREF voltage (taken from Vcc) drifts down so the sensor voltage appears to drift up. 
You might do better to take AREF from the 3.3V pin, depending on which of the 10 or 12 Arduino types that you have.
Code: [Select]
void setup()
{
   analogReference(EXTERNAL); // Connect 3.3V pin to AREF pin

NOTE: you will have to redo your math with analogRead().

Wawa

Using 3.3volt Aref would defeat the ratiometric relationship between Arduino and sensor.
Better find the cause of the problem.

We don't know which ACS712 you're using (there are three different ones),
how you have connected it, what you're measuring, how you power the (unspecified) Arduino, and the code you're using.
Read the "how to post" sticky that's on top of every main page.
Leo..

outsider

#4
Oct 17, 2018, 01:39 pm Last Edit: Oct 17, 2018, 01:41 pm by outsider
OOPS! Wasn't thinking about the 1/2 Vcc zero point.  >:(   Time for a session with the butt kicking machine.

MarkT

Its a hall-sensor, it is affected by magnetic fields in the vincinity - my bet is something is changing magnetically
in the environment.

As its ratiometric, it should not be affected by drifting supply voltage, so long as that supply voltage
is the self same one used by the Arduino ADC (ie you have Arduino Vcc as the sensor supply voltage)
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up