CLUSTER HAT, THE EASIEST WAY TO BUILD A RASPBERRY PI ZERO CLUSTER
One HAT, four Zeros, and one controller Raspberry Pi and for under $100 you have a cluster
I recently compiled a list of Raspberry Pi clusters and reader Alex Hortin wrote in to suggest I looked at a cluster framework for up to four Raspberry Pi Zeros called the Cluster HAT produced by 8086 Consultancy.
In case you haven’t come across the term, the “HAT” part of Cluster HAT, means that the device implements the Raspberry Pi Foundation’s Hardware Attached on Top system for add-on hardware. The Foundation’s 2014 blog post announcing the standard explains:
In a nutshell a HAT is a rectangular board (65x56mm) that has four mounting holes in the (nicely rounded) corners that align with the mounting holes on the B+, has a 40W GPIO header and supports the special autoconfiguration system that allows automatic GPIO setup and driver setup. The automatic configuration is achieved using 2 dedicated pins (ID_SD and ID_SC) on the 40W B+ GPIO header that are reserved for an I2C EEPROM. The EEPROM holds the board manufacturer information, GPIO setup and a thing called a ‘device tree‘ fragment – basically a description of the attached hardware that allows Linux to automatically load the required drivers.
The Zeros connected to the Cluster HAT operate in USB gadget mode, a framework developed by the Linux USB Project. Published in 2005, this API specification allows a USB-connected device to look like various peripherals including printers, file systems, audio systems, and, most importantly, Ethernet connections. Gadget mode allows connected PCs or, in the case of the Cluster HAT, a Raspberry Pi (A+, B+, 2, or 3) to act as the controller for programming and networking the Zeros.
The great thing about the Cluster HAT is that it keeps wiring to a minimum (check out my Raspberry Pi cluster roundup and you’ll see lots of wiring spaghetti for power and networking). The Cluster HAT includes a four port USB hub on board that the Zeros directly plug into and the Zeros are powered directly by the host Pi’s GPIO interface and can be controlled individually. If you’re SSH’ing into the controller Pi and using a Wi-Fi dongle for connectivity, the only cable connections required are for power to the controller, and a USB cable connecting the controller to the Cluster HAT.
In the US, the Cluster HAT is priced at $38.14 on eBay, while in the UK it’s £28 ex VAT on Pimoroni and ModMyPi. This means that for under $100 you can build a five node Raspberry Pi Zero cluster … how cool is that?! Once I get my hands on a Cluster HAT, I plan to do a review so sign up for my newsletter so you know when it becomes available.