I am attaching a Sparkfun ACS72 current sensor to analog pin A2 on an UNO WiFi Rev2. I usually work with MEGA2560 boards but this project requires WiFi.
I've updated the IDE and firmware on the UNO to all the latest.
The current sensor VOUT range is 0-5VDC.
I initialize the analogReference to VDD as per:
...which says it's a 5VDC reference.
When I analogRead(A2) with the current sensor attached, the integer is always 1023 (max).
When I use a voltmeter to manually read VOUT from the current sensor, I correctly get slightly above 2.5VDC.
If I ground pin A2, analogRead(A2) correctly returns an integer zero.
If I change analogReference to EXTERNAL and connect the AREF pin to Arduino 5VDC, I get the same results.
It appears the analogReference method is not working correctly, but it could be lots of things.
I've searched this forum and the outer world in general for similar issues and have found none that apply.
Anyone else out there having an analogRead problem on this type of board?