STFN

Powering PC fans from a USB port to cool my Raspberry Pi Cluster

10 minutes

I have a Raspberry Pi cluster (citation needed). One of the uses for it is crunching BOINC. Running the BOINC daemon means that the Pis’ CPUs are constantly running at almost 100% load. And so they make a lot of heat. The Pis are powered by POE+ HATs, which also produce heat themselves and at the same time restrict airflow. The HATs have their own fans, but those are noisy when they ramp up. All in all a situation far from perfect. A solution for that issue would be an additional source of cooling to make my cluster run quietly and reliably.

I could use those 5V tiny fans that are sold as dedicated for the Pi, but those are also whiny as a far-right person seeing happy people. And the HATs obstruct the GPIO pins, so that is not the way.

What I realized is that a cluster of three Pis has the height and the width of a typical 120mm case fan. And I have such a fan, leftover from the desktop PC I used to have.

I have a fan-header to 2.1 x 5.5mm barrel adapter that I bought during one of my Aliexpress-weird-stuff-under-dollar shopping sprees, and I used it to cool my Pis when I was doing BOINC Pi 5 vs Pi 4 testing.

But that was only a temporary measure, before I had the PoE HATs. Now I want a long-term, quiet fix, and no other cables coming to the Pi cluster apart from the Ethernet ones.

The solution dawned on me when I realized that the fan header has the same pin distance as any other pin header, be it on a Pi, any other microcontroller, or a breadboard. Which means I can just make my own adapters, and run them from USB. USB provides 5 volts, which means that a typical 12V would run slowly and quietly, while still providing some airflow.

And so I created my own USB-to-fan adapter.

Version 1.0

The first version was basically the USB-A connector and two pins connected by short lengths of cables. I was not happy with it, because the USB pins turned out to be very fragile, they would move with every touch, and I was concerned what would happen when 5V would short out with a data pin. I don’t know the USB specs enough* to know what would be the outcome of that.

Version 2.0

For version 2.0 I used a prototype board to securely solder all four pins of the USB connector, and so have the adapter more sturdy and safe. The additional advantage here is that it can power more than one fan, the only limitation is the maximum current a Pi can provide on a single USB port*

The build process is very simple. I took a prototype board, I have some with the perfect size, 6 pins wide. I cut it in half, and soldered the USB connector to one side of it. In a USB-A connector, there are four pins, the middle two ones are data, and the outer ones are +5V and GND.

I then soldered two pin headers of two pins each, with spacing between them to fit the fan connectors.

Finally I connected the USB pins with the fan pins using wire I had left from soldering some LEDs.

The important thing is to make sure that there is no short circuit, and the data pins are not connected to anything.

I first tested it using my cheapest powerbank, in case I did something very bad. It’s better to burn a cheap powerbank rather than an expensive Pi. But in my case there was no magic smoke, just a large fan running quietly. After letting it run for a while I took the connection of faith, and connected the whole contraption to one of the Pis in my cluster.

And hey, it works like a charm, there are no additional cables coming from the cluster, the fan is running, the Pis are cool as a cucumber*, and all is fine in the world (if you ignore the news from a certain Western superpower).

The adapter from the top…

…and from the bottom. Yes, I know my soldering is bad.

And from the side.

Powering two 5V fans.

And doing what’s it intended for. I still need to tidy the fan cable, and maybe secure the fan to the cluster case.

One more thing, this board is universal enough that it can power anything that uses 5V and can use typical 2.54mm pins.

I know, it’s not something groundbreaking, not specially interesting, but it does what it’s intended to do, and I am happy with it. And it is a good day when I can use my AK soldering iron.

Thanks for reading!

* at all.

* It’s 1.2A for a Pi 4b, but it shared among all USB ports. So one port can provide 1.2A, but then the other ports are left with nothing. Or two ports can provide 0.6A each, etc, etc.

* Is any native speaker actually using this phrase, or is it just something that every foreign learner of English has to memorize?

If you enjoyed this post, please consider helping me make new projects by supporting me on the following crowdfunding sites: