Automation HAT Analogue In spurious reading

Hey, I’m having this same issue. I’m guessing it’s also the issue encountered here and maybe here. I’ve followed the troubleshooting steps taken so far by the earlier users, and I’m starting with a clean and up-to-date Raspberry Pi OS before installing the Pimoroni python libs.

My test setup is as shown below:

I have a hat with an ADS1115, judging by the “BOGI” marking.

Like jpkelly, I’m finding that grounding the unused analog channels doesn’t make the problem go away. The 5V reading still seems to jump around the channels as reported by the automationhat.analog.read() method, with the while loop of “analog.py” modified to read and report all four channels. Here’s that loop:

while True:
    one = automationhat.analog[0].read()
    two = automationhat.analog[1].read()
    three = automationhat.analog[2].read()
    four = automationhat.analog[3].read()
    print(one, two, three, four)
    time.sleep(0.5)

and here’s some sample output:

0.02 4.5 4.5 0.57
5.06 5.06 0.02 0.0
0.02 4.5 4.5 0.57
5.05 5.05 0.02 0.0
0.02 4.5 4.5 0.57
5.06 5.06 0.02 0.0
0.02 4.5 4.5 0.57
5.05 5.05 0.02 0.0
5.0 5.0 0.02 0.0
5.03 5.03 0.02 0.0
0.02 4.5 4.5 0.57
5.06 5.06 0.02 0.64
5.05 5.05 0.02 0.0
5.06 5.06 0.02 0.64
5.06 5.06 0.02 0.0
5.05 5.05 0.02 0.65
5.05 5.05 0.02 0.0
5.06 5.06 0.02 0.65
5.06 5.06 0.02 0.0
0.02 5.06 5.06 0.0
5.06 5.06 0.02 0.0
5.06 5.06 0.02 0.0
0.02 5.06 5.06 0.0
5.06 5.06 0.02 0.0
5.06 5.06 0.02 0.0
0.02 0.02 0.02 0.0

What’s really weird is how I’ve got the +5v wire on the “3” terminal, but the “1” and “2” lights are staying on, and these correspond to the channels that report ~5v. This makes me think the ADC channels might be getting twisted somehow. I don’t think the ads1015.py driver is to blame, as everything in there looks like it’s exactly what it needs to be. I’m getting sensible data out, it’s just getting put in the wrong places, and where it gets put is inconsistent.

There might be a connection routing issue on the circuit board, but this is unlikely given the reading is moving around when the wire’s in the same place. This might a gremlin resulting from the sample rate difference between the ADS1115 and the ADS1015, but given that the ADS1115 is reportedly a 2020 chip shortage substitute, and the earlier complaints predate this by a few years, I don’t think it’s that, either.

In concept, this hat’s exactly what I want to use for my application. Any advice on what I can do with my copy to get it working?