Physical Connections

As shown in the block diagram to the right the Cluster HAT basically comprises of a USB 2.0 hub and independent GPIO controlled power for each Pi Zero (and Alert LED).

USB Hub

  • USB Port 4 -> Pi Zero P1
  • USB Port 3 -> Pi Zero P2
  • USB Port 2 -> Pi Zero P3
  • USB Port 1 -> Pi Zero P4

The Cluster HAT v2.x uses an 8-bit I2C I/O Expander (Exar XRA1200P)

  • Port 0 - Power Pi Zero P1
  • Port 1 - Power Pi Zero P2
  • Port 2 - Power Pi Zero P3
  • Port 3 - Power Pi Zero P4
  • Port 4 - Enable / Disable LED Power
  • Port 5 - Enable / Disable USB Hub
  • Port 6 - ALERT LED
  • Port 7 - EEPROM Write Protect

ClusterHAT Block Diagram

Power Control

  • GPIO21 - ALERT LED
  • GPIO22 - Power Pi Zero P1
  • GPIO23 - Power Pi Zero P2
  • GPIO24 - Power Pi Zero P3
  • GPIO25 - Power Pi Zero P4

N.B. GPIO pins 22-25 DO NOT power the Pi Zero directly they are only used for control.

Power Control

From the Controller Pi power to the Pi Zeros can be controlled using the "clusterhat <action> <devices>" command on our configured images.

Cluster HAT v2.x Cluster HAT v1.x

$ clusterhat on # Turn power to all Pi Zero on
$ clusterhat off  Turn power to all Pi Zero off
$ clusterhat on p1 # Turn power on to Pi Zero in slot P1
$ clusterhat on p1 p3 p4 # Turn power to Pi Zeros in slot P1, P3 and P4 on
$ clusterhat off p2 p3 # Turn power off to Pi Zeros in slots P2 and P3
$ clusterhat alert on # Turns on ALERT LED
$ clusterhat alert off # Turns off ALERT LED

Cluster HAT v2.x (commands not available on Cluster HAT v1.x)

$ clusterhat hub on # Turns on USB hub (default)
$ clusterhat hub off # Turns off USB hub
$ clusterhat led on # Enables Power & P1-P4 LED on Cluster HAT (default) 
$ clusterhat led off # Disables Power & P1-P4 LED on Cluster HAT (does not disable ALERT LED)
$ clusterhat wp on # Write protects HAT EEPROM
$ clusterhat wp off # Disables EEPROM write protect (only needed for updates)

Custom Control

If you're not using our images you can download our clusterhat script (may need modification for your configuration) or use wiringpi directly to toggle the GPIO pins.

apt-get install wiringpi

The Controller GPIO pins are automatically configured by the Cluster HAT to be outputs so the Pi Zero power can be enabled/disabled using simple commands.

# Turn on ALERT LED
gpio write 21 1
# Turn off the ALERT LED
gpio write 21 0

# Turn on Power for Raspberry Pi Zero P1
gpio write 22 1
# Turn off power for P1
gpio write 22 0

# Turn on Power for Raspberry Pi Zero P2
gpio write 23 1
# Turn off power for P3
gpio write 23 0

# Turn on Power for Raspberry Pi Zero P3
gpio write 24 1
# Turn off power for P3
gpio write 24 0

# Turn on Power for Raspberry Pi Zero P4
gpio write 25 1
# Turn off power for P4
gpio write 25 0

The above commands can be used in scripts to turn on/off and cycle the power to each Pi Zero individually. We advise staggering the power up of the Pi Zero by a couple of seconds to stage the increase in power requirement on your power supply.