Maybe the Pi doesn't need a fan, but sometimes it helps to go through an exercise like this because the application can be altered or extended- I learned a lot from this script for example because it shows how simple the logic is to program for the Pi and it opened the lid of the black box for me. Plus, I thought it was pretty cool to be able to use the Pi as a controller of sorts as well as the other applications I have in mind.
Take a look at the following link- I have also included the script below it for simplicity. Looks like al I have to do is to move my connector over one pin and this will work. Not only that, but I'm going to lay with it and see how the properties translate across- perhaps by flipping true ad false I can reverse the direction of the fan, and create a low-noise (albeit less efficient) airflow. I know there isn't a huge utility to it, but like I said, I'm in it for the geek appeal. Hoping this is helpful to others on this forum:
https://github.com/andrewkarch/Eleduino-Fan-Controller
A simple python script to control the fan of the Eleduino 2015 New Version Raspberry Pi 2 mode B Transparent Acrylic Case With Fan
Once the case is assembled connect the black wire to pin 6 and red pin to 8
Boot the Raspberry Pi
Download the script
git clone
https://github.com/andrewkarch/Eleduino ... roller.git
Open your rc.local file
sudo nano /etc/rc.local
Add this line to your /etc/rc.local If you didn't change the working directory (cd) when downloading the script, the directory will be be /home/pi/Eleduino-Fan-Controller
sudo python /directory/to/fanController.py &
Reboot and the fan will now turn on if the temperature gets above 45C. To change the temperature open the script in leafpad, and change maxTemp to the temperature you want the fan to turn on at in Celcius.
Script for Pi
import os
import time
import RPi.GPIO as GPIO
#Change this to whatever temperature you want the fan to kick on at.
maxTemp = 45 #Celsius
#Sets the time to wait in between checks
waitTime = 5 #seconds
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(8, GPIO.OUT)
while(True):
temperature = os.popen('vcgencmd measure_temp').readline()
tempInC = float(temperature.replace("temp=","").replace("'C\n",""))
if(tempInC >= maxTemp):
GPIO.output(8, True)
else:
GPIO.output(8, False)
time.sleep(waitTime)