Many tears ago...
Many true words are spoken in typos....
Many tears ago...
Many true words are spoken in typos....
Have you added a bypass capacitor from Aref to ground?
In my experience, Arduinos have adequate bypassing for most purposes, but not so good for fine ADC readings.
Even though using Vcc for both the reference voltage for the AVR's ADC and for the ACS712-30 can get around the problem of Vcc not being 5V, noise on Vcc can play havoc with this. It is not a bad thing to add 0.1uF or 0.01uF ceramic bypass capacitors to Vcc, especially right on the ACS712-30.
http://www.atmel.com/Images/doc4278.pdf
You might try not running it from the USB bus for testing.
Also - by the very nature of ADC, there is always noise. There is a thing called ENOB, which means Effective Number Of Bits. Noise, errors, etc. So doing some averaging is a good idea if you expect to get close to an actual 10 bits of resolution. Paradoxically, with the right amount of noise you can -increase- resolution by averaging, or as it is more properly called, oversampling and decimation.
http://www.atmel.com/images/doc8003.pdf
In fact, the noise must be at least 1 LSB or oversampling and decimation will not increase the resolution.
That seems to be the 100nF on the AREF to GND.
It could mean that an analogRead() is a little extra noisy in the last bit.
On the black header, AREF is next to GND. If you put 100nF in those, your measurements might be a little more stable. It is worth trying.
They leave that off of many Arduino clone boards. The Freeduino comes with all SMD parts installed. But on the bottom there is a spot for a bypass cap on the Vcc power to the analog section, but no capacitor installed.
After i added 100nf capacitator between AREF and GND i got these readings from the sensor:
-0.00
-0.01
-0.01
-0.01
0.00
0.00
0.00
-0.00
0.00
-0.01
-0.01
-0.02
0.00
-0.01
That is about as good as it gets, but i guess you dit not increase the filter capacitance on the sensor.
First of all, see ACS712-30A data sheet.
http://www.allegromicro.com/~/Media/Files/Datasheets/ACS712-Datasheet.ashx
Sensitivity's coeficient varies from 63 to 69 mv/A. My chip have 65.8 mV/A.
You may find this, after measure with multimeter and simulations.
Use Analog reference voltage of 5,00 V to facilitate calculations.
Measure this voltage with precise multimeter.
Use the capacitor too at AREF pin.
Use shielded cable to conect ACS712 to Arduino.
That is not unusual and no problem, as long as you use the same "5V" as the reference for the ADC and arduino supply.
The output of the ACS712 will allways be "VCC dividet by 2".
But there is the issue of how quickly each responds to changes and noise on the Vcc line. If they don't respond at the same speed (highly unlikely that they do) then changes and noise will mess up the readings over the short term.