This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RPI Cooling fan control
#2
Updated flow to incorporate basic PWM fan speed control
Just change values in the "PWM Fan control" function node to configure temperature thresholds

Code:
[{"id":"d3940991.1a2ef8","type":"inject","z":"2b47cf3c.1f345","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"x":110,"y":180,"wires":[["1b8455a0.d1cbfa"]]},{"id":"1b8455a0.d1cbfa","type":"exec","z":"2b47cf3c.1f345","command":"vcgencmd measure_temp","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"Read RPi Temp.","x":300,"y":180,"wires":[["c9389a57.3c92b8"],[],[]]},{"id":"c9389a57.3c92b8","type":"function","z":"2b47cf3c.1f345","name":"Convert to Number","func":"str = msg.payload\nmsg.payload = str.substring(5,9);\nmsg.payload = Number(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":180,"wires":[["dca36c2e.25785","d44efe8e.eccc7","e2829e61.1dca8"]]},{"id":"dca36c2e.25785","type":"ui_gauge","z":"2b47cf3c.1f345","name":"","group":"3067d01a.af5d4","order":2,"width":0,"height":0,"gtype":"gage","title":"CPU Temperature","label":"C","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"60","seg2":"65","x":770,"y":60,"wires":[]},{"id":"d44efe8e.eccc7","type":"ui_chart","z":"2b47cf3c.1f345","name":"","group":"2381998f.63b6d6","order":0,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"3","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":730,"y":120,"wires":[[],[]]},{"id":"e2829e61.1dca8","type":"function","z":"2b47cf3c.1f345","name":"PWM Fan Control","func":"if(msg.payload <=45) msg.payload = 0;\nelse if(msg.payload >45 && msg.payload <=55) msg.payload = 30;\nelse if(msg.payload >55 && msg.payload <=60) msg.payload = 50;\nelse if(msg.payload >60 && msg.payload <=65) msg.payload = 75;\nelse if(msg.payload >65) msg.payload = 100;\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":180,"wires":[["84179128.fd722"]]},{"id":"84179128.fd722","type":"rpi-gpio out","z":"2b47cf3c.1f345","name":"Fan Control","pin":"12","set":false,"level":"1","freq":"","out":"pwm","x":990,"y":180,"wires":[]},{"id":"3ae31bf5.f57c24","type":"ui_switch","z":"2b47cf3c.1f345","name":"Fan Override","label":"Fan Override","group":"693e1549.6d363c","order":0,"width":"3","height":"1","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"100","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":750,"y":240,"wires":[["84179128.fd722"]]},{"id":"3067d01a.af5d4","type":"ui_group","z":"","name":"Col1","tab":"7ae3bc3.4c07544","order":1,"disp":false,"width":"3"},{"id":"2381998f.63b6d6","type":"ui_group","z":"","name":"Temp Chart","tab":"8b537ae0.9e5938","disp":true,"width":"10"},{"id":"693e1549.6d363c","type":"ui_group","z":"","name":"Col3","tab":"7ae3bc3.4c07544","order":3,"disp":false,"width":"3"},{"id":"7ae3bc3.4c07544","type":"ui_tab","z":"","name":"RPi Control","icon":"dashboard","order":4},{"id":"8b537ae0.9e5938","type":"ui_tab","z":"","name":"CPU Temp","icon":"dashboard","order":5}]
Reply


Messages In This Thread
RPI Cooling fan control - by affinite - 2018-03-30, 04:52 PM
RE: RPI Cooling fan control - by affinite - 2018-03-31, 03:27 PM
RE: RPI Cooling fan control - by Didier B - 2019-04-22, 05:20 PM
RE: RPI Cooling fan control - by affinite - 2019-04-23, 07:53 AM
RE: RPI Cooling fan control - by jim321 - 2019-04-23, 01:00 PM
RE: RPI Cooling fan control - by affinite - 2019-04-23, 08:54 PM
RE: RPI Cooling fan control - by Didier B - 2019-04-23, 09:48 PM
RE: RPI Cooling fan control - by MatsA - 2019-07-08, 09:43 AM
RE: RPI Cooling fan control - by SkipperEarly - 2019-07-25, 05:14 PM
RE: RPI Cooling fan control - by MatsA - 2019-07-27, 05:13 PM
RE: RPI Cooling fan control - by Didier B - 2019-07-08, 11:54 AM
RPI Cooling fan control - by tkurki - 2019-07-08, 01:20 PM
RE: RPI Cooling fan control - by Didier B - 2019-07-08, 05:58 PM
RE: RPI Cooling fan control - by PaddyB - 2019-07-08, 10:14 PM
RPI Cooling fan control - by tkurki - 2019-07-10, 02:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)