If you have a Hat or Phat that is not plugged into a PI, you may find that all of the grounds are not connected together. They rely on the fact that they are common on the Pi. Plug it into the Pi and they are then all connected together. This has caught me out once, had me scratching my head for a minute anyway.
I had a powerboost breakout board mounted on a Proto Zero pHat. I had a switch wired to the enable pin to ground it and turn the up converter off. I tested it while it was not plugged into the Pi and it didn't work. Got my ohm meter out and found the ground pin I used wasn't common with the ground I used for the powerboost. Plugged it into the Pi's GPIO and it worked as I had intended.