Automation pHAT: "No ADC detected, check your connections"


I have an Automation pHAT on a Raspberry Pi 3 Model B, It worked well a week ago as expected but recently it hasn’t been taking output commands and constantly giving the error “No ADC detected, check your connections”. I thought it was the code so I tried using the given examples in the Automation Hat library but the same error occurs. I had soldered on the jumper cable holder so I thought maybe I burned the board so I ordered another Automation pHAT, same error. I changed the Pi I was using to a Raspberry Pi 3 Model B+, same error. I used a RPi extension board with both Pi’s to check their port connections, all good. Could it really be that both Automation pHATs are void in terms of hardware? I keep pushing them into the Pi to make sure they’re connected too.

Did you use the same SD card in both Pi’s? It seems extremely unlikely that it’s a hardware fault (although stranger things have happened), I wonder if there’s an unusual software quirk happening.

Do you have any other boards with i2c devices on them to test? Such as Scroll pHAT/HD, MicroDot pHAT, Enviro pHAT, etc?

I am using the same SD card yes. So I noticed it only raises the runtime error on the first command, so I hardcoded a try/except for the first runtimeerror like so:

try: # some command
except RuntimeError: # make sure it’s off at first

it works now. I know this isn’t the perfect solution but it works for the proof of concept I need to deliver, and I figured it might help someone else if I share it. Thank you for your response!

1 Like

Yes, setup is deferred so when you call the first command against automationhat it runs the setup routine behind the scenes. Once setup has run, it wont run again so you only have to trap the error once as you’ve discovered.

This means the ADC probably wont work when you come to try and use it- but if you’re stuck for time then it’s fine for now and we can try some debugging steps when you have a moment.