Automation Phat on Raspberry Zero W



total beginner in respect of solderding things together:

I have a Raspberry Pi Zero W and the Automation Phat with one relay.

I connected the Pi Zero to the respective ports on the Automation Phat:

Pi Zero <-> Automation Phat
17 (+3,3) <-> 3,3 (Power)
20 (Gnd) <-> GND (Power)
21 (SPI Miso) <-> Miso (SPI)
19 (SPI Mosi) <-> Mosi (SPI)
23 (SPI SCLK) <-> SCLK
24 (SPI CS0) <-> CE0

Althouth I run the setup as described on I cannot find any device with ‘i2cdetect -y 0’ and also cannot use the example code on I measured from each soldering point to the respective other soldering point and each time have a resistance of .001 Ohm. So I assume the solderings are fine.

So the questions are: Is my assumption regardint Pi GPIO-Port to PHat port correct? Anything obvious I am missing?

Thanks for any input!


Is there a reason for not using the 2x20 header? I have a zero w with automation pHat and it works fine.

Without seeing your measure points I would caution you in assuming that just because you measure a good connection between two endpoints of a solder joint does not mean that the board is making a good connection. If you can measure from a chip-pin to chip-pin you’ll know for certain that you have a good connection. :-)

What distro are you running on your zero? My config is running jessie.


Hi Cxrider,

thanks for your response. You are right regarding the soldering. I will try to get a soldering iron with a more pointed head to make sure the soldering points really are working. As a note to this: When measuering from the Pi-End to the wrong endpoint of the Automation Phat I get resistances in the M-Ohm range, which seems to me an indication that the connection seems to be working.

But your note of not using the 2x20 header is irking me. Do I have to solder from the Pi-2x20 to the respective Port of the Phat-2x20??

Os is current Raspbian, i2cdetect -y 0|1 does not yield and serial device.


That’s because you don’t have the i2c pins wired up. The pinout of what pins are used is here,
I do believe the ones your wired to are meant to be used as outputs, not inputs. You would have been better to wire to the GPIO 40 pin part.


I did not understand the pinout to be honest. If it is just a simple 1:1 connection from Pi to Hat in my understanding I need to connect BCM2, 3, and 20 as 5v, 3,3 and a GND-line to control the relay?


To answer myself: Yes, it is that simple. Just 1:1 solder the thing to the Zero.


Normally the Pi would have a 40 pin male header pointing up from the component side. And the pHat would have a female 40 pin header pointing down from the solder side of the board. The pHat then plugs in on top of the Pi. Pin 1 to Pin 1, Pin 2 to Pin 2 etc. If your using wires/jumpers You solder from the same pin on the Pi to the same Pin on the pHat. You could wire up all 40 but really all you need is the contacts actually in use by the pHat. In your case its pins 3,5,29,31,32,36,37,38,and 40. I would also wire up all the grounds and the 3.3V and 5V pins. You can probably get away with only wiring 1 of the ground pins. If it was me I’d wire up at least 2 of them…


I’d post a pic of my setup if I wasn’t using it as a garage door opener… :-)

I have a male 2x20 pin header that is soldered to the zero. I then soldered a female 2x20 header to the enviro pHat, connected the two and went from there. I am using the relay with connections to NO and common. I manage the relay from the from the automationhat python lib. It is a trivial use case for the pHat but the end goal is a phone app that is location aware and opens the garage door as I ride up on my motorcycle. :-)

root@gdctl:/home/pion# more src/
import time
import automationhat (1)

The i2c device is wired to the GPIO bus which is the 2x20 set of pins. Get the male and female 2x20 headers and you’ll be good to go.


Normally the Pi would have a 40 pin male header pointing up from the component side. And the pHat would have a female 40 pin header pointing down from the solder side of the board. The pHat then plugs in on top of the Pi

Thanks, will do this definetly the next time I use a pi with with a board that has 1:1 pinout. The idea of using male and female pin headers did not cross my mind although I have the parts lying right by me. Learned something for the next time.


Every Pi except the Zero comes with the male header already soldered on. The header is omitted on the Zero to keep costs down. Not just the cost of the header, it actually speeds up manufacture by leaving it out. Everything else on the board is surface mount and all mounted on the one side. They only have to solder flow it once. Preinstalling the GPIO header would add to that in time and cost. Plus it opens up other options for connecting devices. Your Automation pHat should have come with the female header, my Explorer pHat did. They don’t presolder it on because that gives the buyer options. Like using a stacking header instead etc. Or using wires like you did to keep a low profile. I like that the headers aren’t pre attached.


Hey hope you don’t mind me butting in, but i found this image online that will give you an idea of what you need to be aiming at. its not the best pic and don’t worry about what is pictured below the pi zero, that is where the pi is sitting on a breadboard but you don’t need to do that.


That looks like a stacking header on the Pi. Likely plugged into a Black Hat Hack3r or mini hacker.
I did something similar here,

with my Explorer pHat. The Pi Zero has a female header mounted on the bottom. The whole thing is mounted to a rover chassis. I mounted the Pi that way so the camera is facing forward. In the direction of travel of my rover.