Onion Omega as a Fan Controller

Final setup, up close.

I’m a really big fan of passive cooling rather than active cooling. In fact, as much as possible, I also prefer air cooling over water cooling. Not that I like to run my chips hot, it’s just that I don’t like the noise and moving parts that can fail. Plus fans usually result in an added maintenance cycle of cleaning the dust and ensuring optimal performance.

This was until I made my new NAS setup out of Pi4. Initially I figured out that Pi4 runs hot. Quite hot. Hence I decided to go for a passive cooling setup like this one. I use my old USB HDDs as a RAID 5 setup over mdadm, and the whole setup sits below my router, with good airflow.

Over the monsoon and winter, everything was running fine. But as the heat started increasing for the summer, Pi started touching very high temperatures (of above 65C) while 1 HDD died and I did a full test SMART test over it figure out that, yes indeed temperature was at 61C!

To fix this issue, I bought a generic fan from Amazon, that would fit inside my small stand. While the initial charger exploded as soon as I connected it, seller promptly replaced it, and the new charger works just fine. However, I’d a new issue, the combined air flow was too much. Also the noise made it seem like that a drone was getting started.

So I thought, I’ve an Onion Omega (Omega links are dead, hence adding link for Omega2 here), and if using the Relay Expansion, if I can control to turn on only one fan at a time, this will help ease out the noise and even help the life of the fans as well.

So I split the incoming 12V to the fan, and fed them to the relays. By doing this, I can now control each individual relay as well.

After some double sided and electrical tape (please ignore the black marks from my careless tape work ☹️), we have following:

Yes, I know it looks janky, but it works just fine! And it was worked on after this pic as well.

So the improvements, well the new temperatures are are almost the same.

Tartarus is the name of Pi4. Gaps in the data are from power cuts or long network failures. Peaks are from modifications to this project.

From this, we can see that running both fans, from 18th March to 3rd April, was better in cooling, we also see that running just a single is still quite effective (just a 5C increase, overall 15C reduction) and gives us half the power consumption and noise.

Since at the time of writing this, Python support is deprecated on Omega (please comment if this is possible as I want to build a temperature based fan control), I had to resort to Shell scripting. Following is my gist:

Final advantage comes with the ability to trigger both the fans, if required.

Both read and write are supported by Relay Expansion command.

You can also use the Onion dashboard to control your relays, however it is not able to load the initial state of the relay expansion, and thus reports it off when you first open the page.

Onion Relay Expansion Dashboard

Hopefully, in future I’ll be able to install python on this little guy, to help me control the fans based on temperature from Pi’s CPU and a DHT22 close by.