52pi ICE Tower RPM and RGB controller

enter image description here

ICE Tower from 52pi is a beast but lacks RPM controls and RGB LEDs cannot be controlled. I thought I would fix that and add RPM controls and link the LED colours to CPU temperature

Features:

  • RPM control via PWM
  • 3 WS2818b RGB LEDs (programmable)
  • Custom Fan Profile
  • Temperature to Colour script

You will need the following nodes:

  • node-red-contrib-cpu
  • node-red-node-pi-gpio
  • node-red-node-pi-neopixel

Get your 52pi ICE Tower:

Settings

  • Colout1-7 HTML names of colours for each temp range
  • speed1-3 PWM value in % for fan RPM

More about me:

If you want to get the latest updates to this project you can follow me via your preferred social media:

And if you feeling like buying me a coffee or supporting me in a more continuous way:

I hope you have enjoyed the project!

[{"id":"64a96b1a.8e3d34","type":"subflow","name":"Fan Settngs","info":"","category":"","in":[{"x":100,"y":80,"wires":[{"id":"dfcb82df.24c84"}]}],"out":[{"x":440,"y":80,"wires":[{"id":"dfcb82df.24c84","port":0}]}],"env":[{"name":"colour1","type":"str","value":""},{"name":"colour2","type":"str","value":""},{"name":"colour3","type":"str","value":""},{"name":"colour4","type":"str","value":""},{"name":"colour5","type":"str","value":""},{"name":"colour6","type":"str","value":""},{"name":"colour7","type":"str","value":""},{"name":"speed1","type":"num","value":"30"},{"name":"speed2","type":"num","value":"50"},{"name":"speed3","type":"num","value":"100"}],"color":"#87A980","icon":"node-red/cog.svg"},{"id":"dfcb82df.24c84","type":"function","z":"64a96b1a.8e3d34","name":"Set Colours","func":"//color\nvar colour1 = env.get(\"colour1\");\nvar colour2 = env.get(\"colour2\");\nvar colour3 = env.get(\"colour3\");\nvar colour4 = env.get(\"colour4\");\nvar colour5 = env.get(\"colour5\");\nvar colour6 = env.get(\"colour6\");\nvar colour7 = env.get(\"colour7\");\n\nflow.set(\"$parent.colour1\", colour1);\nflow.set(\"$parent.colour2\", colour2);\nflow.set(\"$parent.colour3\", colour3);\nflow.set(\"$parent.colour4\", colour4);\nflow.set(\"$parent.colour5\", colour5);\nflow.set(\"$parent.colour6\", colour6);\nflow.set(\"$parent.colour7\", colour7);\n\n//fan RPM\nvar speed1 = env.get(\"speed1\");\nvar speed2 = env.get(\"speed2\");\nvar speed3 = env.get(\"speed3\");\n\nflow.set(\"$parent.speed1\", speed1);\nflow.set(\"$parent.speed2\", speed2);\nflow.set(\"$parent.speed3\", speed3);\n\n\nmsg.payload = \"Your colours are set\";\n\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":80,"wires":[[]]},{"id":"3accd94a.e28186","type":"tab","label":"ICE Cooling Tower Mod (RGB RPM)","disabled":false,"info":"\n![enter image description here](https://notenoughtech.com/wp-content/uploads/2019/11/maxresdefault-10-1024x576.jpg)\n\nICE Tower from 52pi is a beast but lacks RPM controls and RGB LEDs cannot be controlled.  I thought I would fix that and add RPM controls and link the LED colours to CPU temperature\n\n\n - [Complete instruction](https://notenoughtech.com/featured/the-coolest-heatsink-for-raspberry-pi-4/)\n\n\n**Features**:\n\n-   RPM control via PWM\n-   3 WS2818b RGB LEDs (programmable)\n-   Custom Fan Profile\n-   Temperature to Colour script\n\nYou will need the following nodes:\n\n - node-red-contrib-cpu\n - node-red-node-pi-gpio\n - node-red-node-pi-neopixel\n\n\n## Get your 52pi ICE Tower:\n\n - [Seed Studio](http://bit.ly/2WPeKos)\n - [Aliexpress](http://s.click.aliexpress.com/e/nZqXAo5K)\n - [Banggood](https://www.banggood.com/custlink/v3DD0AKY4u)\n - [Gearbest](https://www.gearbest.com/smart-home-controls/pp_1829203.html?wid=1433363&lkid=20102743)\n - [AmazonUK](https://amzn.to/36Ehiu4)\n - [AmazonUS](https://amzn.to/2JV8lTo) \n\n\n\n# Settings\n\n - **Colout1-7** HTML names of colours for each temp range\n - **speed1-3** PWM value in % for fan RPM"},{"id":"5adaa9a0.2d57b8","type":"rpi-gpio out","z":"3accd94a.e28186","name":"Fan RPM (GPIO23)","pin":"16","set":"","level":"0","freq":"30","out":"pwm","x":770,"y":180,"wires":[]},{"id":"ad7cbc04.408c4","type":"rpi-neopixels","z":"3accd94a.e28186","name":"Fan RGB LED (GPIO18)","pixels":"3","bgnd":"red","fgnd":"","wipe":"300","mode":"pcent","rgb":"rgb","brightness":"100","gamma":true,"x":790,"y":260,"wires":[]},{"id":"d32a1139.1fd92","type":"cpu","z":"3accd94a.e28186","name":"","msgCore":false,"msgOverall":false,"msgArray":false,"msgTemp":true,"x":330,"y":220,"wires":[["5ee033f9.e7920c","7c7bae90.a2f0b"]]},{"id":"49a3016a.a7c4b","type":"inject","z":"3accd94a.e28186","name":"","topic":"","payload":"","payloadType":"date","repeat":"5","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":220,"wires":[["d32a1139.1fd92"]]},{"id":"5ee033f9.e7920c","type":"function","z":"3accd94a.e28186","name":"Fan Colour Profile","func":"var colour1 = flow.get(\"colour1\");\nvar colour2 = flow.get(\"colour2\");\nvar colour3 = flow.get(\"colour3\");\nvar colour4 = flow.get(\"colour4\");\nvar colour5 = flow.get(\"colour5\");\nvar colour6 = flow.get(\"colour6\");\nvar colour7 = flow.get(\"colour7\");\n\n\n\n\nvar temp = msg.payload;\n\nif(temp<= 33){\n    msg.payload = colour1;\n}\n\nif(temp<= 35 && temp >33){\n    msg.payload = colour2;\n}\n\nif(temp<= 38 && temp >35){\n    msg.payload = colour3;\n}\n\nif(temp<= 42 && temp >38){\n    msg.payload = colour4;\n}\n\nif(temp<= 45 && temp >42){\n    msg.payload = colour5;\n}\n\nif(temp<= 48 && temp >45){\n    msg.payload = colour6;\n}\n\nif(temp >48){\n    msg.payload = colour7;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":260,"wires":[["ad7cbc04.408c4"]]},{"id":"819fada5.d8636","type":"subflow:64a96b1a.8e3d34","z":"3accd94a.e28186","name":"","env":[{"name":"colour1","value":"Navy","type":"str"},{"name":"colour2","value":"DeepSkyBlue","type":"str"},{"name":"colour3","value":"LightSeaGreen","type":"str"},{"name":"colour4","value":"LawnGreen","type":"str"},{"name":"colour5","value":"Yellow","type":"str"},{"name":"colour6","value":"OrangeRed","type":"str"},{"name":"colour7","value":"Red","type":"str"}],"x":290,"y":100,"wires":[["68c12b8b.2f1a74"]]},{"id":"68c12b8b.2f1a74","type":"debug","z":"3accd94a.e28186","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":470,"y":100,"wires":[]},{"id":"21e6a899.49f838","type":"inject","z":"3accd94a.e28186","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":100,"wires":[["819fada5.d8636"]]},{"id":"62362479.6ead4c","type":"comment","z":"3accd94a.e28186","name":"Settings","info":"","x":140,"y":60,"wires":[]},{"id":"7c7bae90.a2f0b","type":"function","z":"3accd94a.e28186","name":"Fan RPM Profile","func":"var speed1 = flow.get(\"speed1\");\nvar speed2 = flow.get(\"speed2\");\nvar speed3 = flow.get(\"speed3\");\n\nvar temp = msg.payload;\n\nif(temp<= 40){\n    msg.payload = 0;\n}\n\nif(temp<= 50 && temp >40){\n    msg.payload = speed1;\n}\n\nif(temp<= 60 && temp >50){\n    msg.payload = speed2;\n}\n\nif(temp >60){\n    msg.payload = speed3;\n}\n\n\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":180,"wires":[["5adaa9a0.2d57b8"]]}]

Flow Info

Created 3 years ago
Updated 2 years, 9 months ago
Rating: not yet rated

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x1)
  • function (x3)
  • inject (x2)
Other

Tags

  • Fan
  • RGB
  • ICE
  • Tower
  • 52pi
  • heatsink
  • controller
  • cooling
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option