Unreliable HC-SR04 with Explorer HAT Pro

Thank you for the code.

I tried it and it works but it does not solve my issue unfortunately.

Like the code I have tried so far it works fine on mains power but on battery it just halts for ages and occasionally returns a reading. What power source are you using now?

I currently have tried the 4xAA as provided by the zumo chassis and a 5v power bank.

I think I may have to switch to a lipo battery perhaps?

I did make a new topic before discovering this one. PI Zero Explorer pHat sensor not working on battery power