Selutario / Raspberry-fan

Cool down your raspberry pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raspberry-fan

Raspberry

license


INSTALL

  1. Download the folder and open Raspberry-fan/src/fan.c.

  2. Modify the route where specified with the one of your folder (Write "pwd" on shell inside the folder to meet it).

  3. Write "make" (without the quotes) on Raspberry-fan/ (you will need gcc compiler installed).

  4. Write on shell: sudo nano /etc/systemd/system/fan.service

  5. 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

  1. Write: sudo chmod 755 /etc/systemd/system/ventilador.service

  2. Write: sudo systemctl enable fan.service

If you want to make sure it is running, write: ps aux | grep "Raspberry-fan"



WHAT YOU NEED (HARDWARE)

Components

  1. One fan. IMPORTANT: Following components are for a 5v 0,2A fan.

  2. One NPN 2222a transistor.

  3. One 680 ohms OR one 560 ohms resistance.

How to plug them

  1. Connect positive pole of the fan to 5v Raspberry pin (pin 2 or 4 in BOARD Numbering)

  2. Connect ground of the fan to collector of transistor

  3. Connect base of transistor to 680 or 560 ohms resistance.

  4. Connect resistance to pin 7 of raspberry pi (board). [GPIO4]

  5. Connect emitter to GND of your raspberry.

Raspberry



If you need any help, contact me: selutario@gmail.com

About

Cool down your raspberry pi.

License:MIT License


Languages

Language:C 91.2%Language:Makefile 8.8%