-
Download the folder and open Raspberry-fan/src/fan.c.
-
Modify the route where specified with the one of your folder (Write "pwd" on shell inside the folder to meet it).
-
Write "make" (without the quotes) on Raspberry-fan/ (you will need gcc compiler installed).
-
Write on shell: sudo nano /etc/systemd/system/fan.service
-
Paste and save this:
[Unit] Description=Turn on/off the fan depending on the temperature. [Service] Type=simple ExecStart=EDIT-WITH-FULL-ROUTE-TO-YOUR-EXECUTABLE* start Restart=Always TimeoutStopSec=300 [Install] WantedBy=multi-user.target
*Example: ExecStart=/home/osmc/Propios/Raspberry-fan/bin/raspberry-fan start
-
Write: sudo chmod 755 /etc/systemd/system/ventilador.service
-
Write: sudo systemctl enable fan.service
If you want to make sure it is running, write: ps aux | grep "Raspberry-fan"
-
One fan. IMPORTANT: Following components are for a 5v 0,2A fan.
-
One NPN 2222a transistor.
-
One 680 ohms OR one 560 ohms resistance.
-
Connect positive pole of the fan to 5v Raspberry pin (pin 2 or 4 in BOARD Numbering)
-
Connect ground of the fan to collector of transistor
-
Connect base of transistor to 680 or 560 ohms resistance.
-
Connect resistance to pin 7 of raspberry pi (board). [GPIO4]
-
Connect emitter to GND of your raspberry.
If you need any help, contact me: selutario@gmail.com