Summary: Gave up on getting accurate current readings from ACS712 analog sensor.
I figured out how to derive an AnalogSensor class for my ACS712 current sensor.
Plugged into AD1, yellow wire (outside pin) wired to the ACS712 output.
The readings (with zero current or with known current) are not consistent through the port.
The port supplied “5V” is constantly varying from 5.09 to 5.12v on my multimeter.
The sensor’s zero reading varies from +4 to +20 above 2048.
And the real killer, was the mV_per_Amp is spec’d at 185 (+/- 5), but it did not seem close to how the sensor was reacting.
When I set the seen “5v” and the seen “reading bias”, to show readings around 0.00 amps with no load, I had to use a much larger “constant” to get the sensor to correctly report my known 43ma load, but very quickly the conditions would change and the reading was off by 50% to 100%.
So with the voltage reference changing and the zero bias changing, the readings are all over the place.
Maybe my $3.70 sensor is “wacko”, but now I definitely am…
I give up. Carl doesn’t really need to know how hard he is working as long as he stays close to the recharge dock when his juice is getting low.
Sensor Description ACS712 +/-5A Current Sensor, outputs Analog Voltage 185mV/Amp around 2.5v on port AD1 pinmode INPUT portID 3