{"id":16760385,"url":"https://github.com/roccomuso/rpi-fan","last_synced_at":"2025-04-10T17:37:06.960Z","repository":{"id":66271816,"uuid":"47798431","full_name":"roccomuso/rpi-fan","owner":"roccomuso","description":"Basic Node.js Fan controller for Raspberry Pi.","archived":false,"fork":false,"pushed_at":"2016-09-24T11:49:28.000Z","size":460,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T15:11:24.421Z","etag":null,"topics":["circuit-scheme","fan","node","nodejs","raspberry-pi","temperature","transistor"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roccomuso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-11T01:47:20.000Z","updated_at":"2022-06-30T06:17:58.000Z","dependencies_parsed_at":"2023-06-13T21:16:36.021Z","dependency_job_id":null,"html_url":"https://github.com/roccomuso/rpi-fan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Frpi-fan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Frpi-fan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Frpi-fan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Frpi-fan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roccomuso","download_url":"https://codeload.github.com/roccomuso/rpi-fan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248262040,"owners_count":21074236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuit-scheme","fan","node","nodejs","raspberry-pi","temperature","transistor"],"created_at":"2024-10-13T04:23:20.510Z","updated_at":"2025-04-10T17:37:06.934Z","avatar_url":"https://github.com/roccomuso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpi-fan\n## Basic Node.js Fan controller for Raspberry Pi.\n\nWhen The temperature reachs a specific threshold value, the gpio is activated and the transistor lets the fan spin!\nYou can see the current RPi temperature and Fan status using the built-in server functionality or installing the basic RPi-Dashboard: https://github.com/roccomuso/rpi-dashboard\n\nOnce the fan starts to spin, there will not be a temperature check for 5 minutes. This behavior avoids too many fan switches in short periods of time.\n\n## Hardware\n\n1. Scheme (works on both Raspberry Pi and Raspberry Pi 2 model):\n\n![circuit scheme](https://github.com/roccomuso/rpi-fan/blob/master/img/scheme.png \"Circuit Scheme\")\n\nFor Raspberry Pi pinout, check out https://www.raspberrypi.org/documentation/usage/gpio-plus-and-raspi2/\n\n2. Recommended Transistor: 2N7000\n\n3. Recommended Fan: 5V - 0.2A\n\n## Software\n\n### Configuration\n\n1. You can edit the gpio number, temperature threshold, refresh time etc. directly in the \u003ccode\u003econfig.json\u003c/code\u003e file:\n\n        \"PIN_NUMBER\" : 18,\n        \"REFRESH_TIME\" : 60,\n        \"TEMPERATURE_THRESHOLD\" : 45.0\n        \n2. Optionally, you can also activate a web server to show the current temperature on \u003ccode\u003ehttp://ip_address:SERVER_PORT/\u003c/code\u003e. Make sure to choose a free port.\n\n        \"WEB_SERVER\": true,\n        \"SERVER_PORT\": 4949\n\nAnother available option is to pass these parameteres through the CLI:\n\n\t\tnode index.js -n 18    # 'Choose the GPIO number'\n\t\tnode index.js -p 4949  # 'Start the server on port 4949'\n\t\tnode index.js -t 45    # 'Set a temperature threshold of 45 degrees'\n\t\tnode index.js -r 60    # 'Check the temperature every 60 seconds'\n\n\n### Run on start up\n\n1. clone the repo on the \u003ccode\u003e/home/pi/Desktop\u003c/code\u003e:\n\n        git clone https://roccomuso@github.com/roccomuso/rpi-fan.git\n        cd rpi-fan \u0026\u0026 npm install\n    \n2. add this rule to crontab:\n\n  - Launch from CLI \u003ccode\u003ecrontab -e\u003c/code\u003e and add the following line:\n      \n          @reboot /usr/local/bin/node /home/pi/Desktop/rpi-fan/index.js \u003e/tmp/fan_output 2\u003e/tmp/fan_error\n  \n(General console.log and error messages are respectively in \u003ccode\u003e/tmp/fan_output\u003c/code\u003e and \u003ccode\u003e/tmp/fan_error\u003c/code\u003e - Update: /tmp/fan_output can now be seen on the web server page.)\n  \nYou can also better use a process manager (like PM2):\n\n    sudo pm2 start index.js --name=\"rpi-fan\"\n\n\n#### Author @ Rocco Musolino - hackerstribe.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Frpi-fan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froccomuso%2Frpi-fan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Frpi-fan/lists"}