azgooon wrote: ↑
Sun May 20, 2018 3:22 pm
After reading a number of articles, I think I have finally got my head around this subject however as I have pretty much no knowledge about the electronic, I would really appreciate if someone could give me a little bit of reassurance/confirm my thinking is correct.
I have followed steps from this article https://hackernoon.com/how-to-control-a ... 13b6e7f92c
and managed to successfully run 5V fan of the GPIO pins with a fairly good effectiveness but at the cost of not acceptable noise level.
I search for a quiter fans/type of fans and discovered hydro dynamic bearing system used in fan design. however I could not find a 5V version of the fan I hope will deliver noise level improvement - this is the 12V model which I eventually purchased http://gelidsolutions.com/thermal-solut ... -silent-4/
- I couldn't find any nice small (40mmx40mm fans with PWM so I decided to sacrifice ability to control fan speed, lets hope its silent enough). After reading more about powering 12V fans from the 5V GPIO pin it turned out that I need DC-DC 5V to 12V booster, I got one on eBay at a sensible price (https://www.ebay.co.uk/itm/XL6009-LED-D ... e-for-Ras/
. However that particular set up requires NPN transistor that supports at least 300mA, like a 2N2222A https://www.centralsemi.com/get_documen ... 2N2221.PDF
. I got at home S8050 https://www.fairchildsemi.com/datasheets/SS/SS8050.pdf
and they look similar spec wise (at least for me
). And here are the questions which I can't find an answer without deeping into understanding basic of electronic.
- Can I use S8050 instead of 2N2222A?
- Since I will not be using PWM, do I still need 1K resistor and diode?
- am I right in thinking that DC-DC booster should be connected between the transistor and the fan? or does it have to be between GPIO and transistor?
- Would it be easy enough to prepare a hardware set up which will be universal and work with my current fan without PWM but If I ever change the fan to something with PWM and to get PWM, it would be as easy replacing fan and perhaps connecting one extra wire?
There are a few misconceptions here.
DC fans: Most fans can be operated PWM. This is the standard means for their speed (and therefore noise) to be regulated according to cooling demand. If noise is not a problem, you just operate a fan at full whack and get maximum cooling. When noise is a problem, you operate the fan thermostatically (ie regulate the fan according to the measured temperature of the item to be kept cool) by either turning it on and off, or running it from a supply that is modulated so that it averages at an intermediate voltage.
Some fans have a third wire: that is a speed sensor feedback signal. You don't need that. The fan you have can be operated PWM. You would probably have found that a 5V fan would have been quiet enough if you slowed it down (by PWM).
DC booster: Neat unit. To run the 12V fan from it, all you need to do is wire the 5V from the RPi to the booster, adjust the booster to give 12V out, and wire the fan to the booster output. I see no problem with that, the current requirement won't be ridiculous. You will be able to adjust the fan speed manually, simply by turning down the booster's output voltage.
PWM: Regardless, you can still operate the 12V fan PWM by RPi control if you want. 5V to booster, 12V from booster to fan, fan to transistor collector terminal, transistor emitter to 0V, PWM GPIO output signal via resistor to transistor base terminal.
Either of the transistors you have mentioned should work, but may get a bit hot. I would prefer a TO126 (package type) Darlington transistor such as BD679A https://www.ebay.co.uk/itm/BD679A-Trans ... Sw7z1Z6dFH
(Darlingtons have high current gain and therefore won't struggle to drive the load from the current available out of a GPIO output). The TO126 package will be better at dissipating heat, and can easily have a heat sink fitted if further cooling is needed.
More info here, see "Hardware Interfacing": viewtopic.php?f=34&t=207597
A picture is worth a thousand words, so:
You need to check that the booster module has its 0V input terminal directly connected to its 0V output terminal for this circuit to work. The 1kohm resistor is to limit the current from the GPIO output pin, and the 10kohm resistor is to ensure the transistor turns off properly if the GPIO pin happens to be configured as an input (not necessary for BD679A).