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
#1
Here is my circuit and NodeRed flow to control a 12v cooling fan for the RPi
My Pi is used in a fairly high ambient temperature so a little cooling might be required in summer
(I actually solved the problem that was causing my Pi to overheat but Id put together the cooling controller so I went ahead and installed it anyway Smile ) 

Circuit diagram
   

NodeRed flow
   

NodeRed code
Code:
[{"id":"1189fc4b.908fa4","type":"ui_switch","z":"9793012f.3afaf","name":"Fan Override","label":"Fan switch","group":"693e1549.6d363c","order":0,"width":"0","height":"0","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":510,"y":1220,"wires":[["dfb0d3e9.3b755"]]},{"id":"dfb0d3e9.3b755","type":"rpi-gpio out","z":"9793012f.3afaf","name":"Fan control on GPIO18","pin":"12","set":true,"level":"0","freq":"","out":"out","x":850,"y":1260,"wires":[]},{"id":"234b0bca.01bb54","type":"function","z":"9793012f.3afaf","name":"CPU Fan threshold","func":"str = msg.payload;\nmsg.payload = str.substring(5,9);\nmsg.payload = Number(msg.payload);\nif(msg.payload >65) msg.payload = 1;\nelse if(msg.payload <=65) msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":1320,"wires":[["dfb0d3e9.3b755"]]},{"id":"32c875db.e8e48a","type":"exec","z":"9793012f.3afaf","command":"vcgencmd measure_temp","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"RPi Temp.","x":330,"y":1320,"wires":[["234b0bca.01bb54","cc33579b.e30ba8"],[],[]]},{"id":"cc33579b.e30ba8","type":"function","z":"9793012f.3afaf","name":"CPU Temp","func":"str = msg.payload\nmsg.payload = str.substring(5,9);\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":1360,"wires":[["e8101264.ed32e","318c3d17.88c2d2"]]},{"id":"504fcc1f.10ed74","type":"inject","z":"9793012f.3afaf","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"x":124.5,"y":1328.25,"wires":[["32c875db.e8e48a"]]},{"id":"e8101264.ed32e","type":"ui_gauge","z":"9793012f.3afaf","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"],"x":830,"y":1360,"wires":[]},{"id":"318c3d17.88c2d2","type":"ui_chart","z":"9793012f.3afaf","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":830,"y":1400,"wires":[[],[]]},{"id":"693e1549.6d363c","type":"ui_group","z":"","name":"Col3","tab":"7ae3bc3.4c07544","order":3,"disp":false,"width":"3"},{"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":"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)