James Fowkes' Raspberry Pi Mains Power HAT Aims to Reduce the Board's Total Footprint

Designed as an alternative to a separate USB power supply, this Hardware Attached on Top (HAT) accessory takes a straight mains input.

Gareth Halfacree
21 days agoHW101

Maker James Fowkes has designed a Raspberry Pi add-on that aims to reduce the device's footprint in a mains-powered installation — by replacing the usual USB power supply block with a Hardware Attached on Top (HAT) board instead.

"This PCB is meant for Raspberry Pi applications where space is at a premium and/or mains connections are limited," Fowkes explains of the aptly-named Raspberry Pi Mains Power HAT. "It means you can supply the Pi directly from the mains without the bulk of a mains socket and plug-in transformer. The PCB has the recommended protection circuit for back-powering the [Raspberry] Pi via the GPIO [General-Purpose Input/Output] header. It also has a power indicator LED."

The idea behind the add-on board is simple: take the hardware that would normally be found in an external USB power supply connected to the Raspberry Pi's USB Type-C or micro-USB input, model dependent, and put it on top of the Raspberry Pi instead. A Hi-Link transformer takes mains power from a set of screw terminals and converts it to 5V 3A before it's fed into the Raspberry Pi's GPIO header — and there's a second set of screw headers that act as a mains output for another device up drawing up to 1A.

That 5V 3A transformer, though, is not quite up to spec for the latest Raspberry Pi 5, which officially requires a 5V 5A power supply. "This is 15W maximum output power," Fowkes explains, "enough for the Raspberry Pi 4 and for a lot of Raspberry Pi 5 applications too" — merely meaning that Raspberry Pi 5 users will find the USB ports restricted to 600mA output, as with any other 5V 3A supply.

"This PCB exposes mains voltages," Fowkes warns anyone interested in picking one up for themselves. "Handle with extreme care and ensure appropriate safety measures are taken to prevent electrical shock. Do not remove the protective cover. Use of a secondary enclosure is strongly recommended. This PCB is sold as a component, buyers are responsible for safe installation and usage. Always assume the PCB is live and do not work on or handle without isolating."

The Raspberry Pi Mains Power HAT is available on Fowkes' Tindie store for $20 fully-assembled. "It is very strongly recommended that you put this product in an enclosure or within a cover," he notes, "to prevent exposure to the mains."

Those nervous about playing with mains voltages, meanwhile, could look into the Raspberry Pi PoE+ HAT for the Raspberry Pi 3 and 4 or a third-party version for the Raspberry Pi 5 — pending the release of Raspberry Pi's first-party HAT.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles