I got a Pi 3 for my birthday.
Installed OSMC and just started our new Media Center.
It works so fine and smooth.
Casing is with fan included.
But with the Pis GPIO, there is only 3.3V OUT and no 150 mA.
What to do, to let this fan run?
(And not constant on, yes, I could connect it to 5V adn GND, but I want the Pi running 24/7 and not the fan)
Well, I just transitored it:
(Pic I found on the net)
And here starts my trouble.
As you can see, there is a 6k Ohm resistor used.
Doesn’t work for me, my transistor is a N2222.
With the power of the internet, I calculated following values:
1,7k Ohm
0.5M Ohm
and 47 Ohm
Yes, 3 different values.
Started with 1k Ohm.
Not running.
220 Ohm, there you go.
So I settled with 470 Ohm, just because.
If anyone can explain, how to calculate it properly, I would be so glad!
Some soldering, and hacking it into the casing later, it is running!
And here is my dirty script:
#!/usr/bin/env python import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(14, GPIO.OUT,initial=GPIO.LOW) def getTemp(): f = open("/sys/class/thermal/thermal_zone0/temp", "r") temperature = f.read() cleantemp = temperature.rstrip() return int(cleantemp) fanset = False hightemp = 70000 lowtemp = 60000 try: while(True): curtemp = getTemp() if(curtemp>hightemp and not fanset): fanset = True GPIO.output(14,fanset) elif(curtemp < lowtemp and fanset): fanset = False GPIO.output(14,fanset) time.sleep(30) finally: GPIO.cleanup()
and the real miracle..it works!
starting at hightemp = 70000 (70°C) and stopping, if below lowtemp = 60000 (60°C)