MarcosCD
Posts: 1
Joined: Wed Jun 27, 2018 3:57 pm

Using fan on Pi

Wed Jun 27, 2018 4:05 pm

I want to use my Raspberry Pi to host a program and to prevent it to be at high temperature I want to put a fan on it. How I can make it efficient?
Not sure but I think I was a Raspberry Pi 3.

Thanks.

User avatar
topguy
Posts: 5685
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Using fan on Pi

Wed Jun 27, 2018 6:51 pm

What exactly do you mean by "efficient" ?
A good heatsink, and a small fan that blows the air trough the airsink will do what you need.

User avatar
HawaiianPi
Posts: 4535
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Using fan on Pi

Thu Jun 28, 2018 12:41 am

If efficiency is your goal, then not using a fan would be best (fans use power).

To keep my Pi3B(+) computers cool I put them in Flirc Gen2 cases. The aluminum alloy Flirc case not only looks cool,
Image
it acts as a huge heatsink to keep the Pi cool, without the additional power requirement or noise of a fan.

The 2nd generation Flirc fits the Raspberry Pi3 model B, as well as the newer Pi3B+ (it comes with thermal pads for each model).

If you really want to use a fan, find a low current 5V fan and connect it to the GPIO power pins.
The +5V DC power lead can go to either pin 2 or pin 4, and the ground pin can go to pin 6 (or any other ground pin).
pi3_gpio.jpg
pi3_gpio.jpg (88.86 KiB) Viewed 9742 times

Some 12V DC fans will also run at 5V at a lower speed/CFM, and with less noise.

Note that a direct connected fan will run all the time, even when the Pi has been shut down (unless you disconnect power).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

pcmanbob
Posts: 6662
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Using fan on Pi

Thu Jun 28, 2018 4:55 am

Hi.

if you really want to run a fan to help cool your pi, then use a small 5v one, and use this circuit to control its speed.

Image

you will need to write some code to monitor the cpu temp and then apply pwm to the gpio output pin to control the fan speed.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Using fan on Pi

Thu Jun 28, 2018 7:32 am

It is more important to have a diode across the transistor than it is across the fan motor. However, CPU fans use brushless motors which are electronically controlled internally and may not need external suppression at all.

Beginners Guide to Wiring Things to the GPIO
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

LTolledo
Posts: 1780
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Using fan on Pi

Thu Jun 28, 2018 11:43 am

My first RPi (RPi3B) set came with a case, fan and heatsinks (for the CPU, USB controller chip and memory)
Assembled as instructed.

During the cooler/bitterly cold months RPi ran cool (not more than 50C)
But during the summer/hot months, even the current fan/heatsink combo could not keep the RPi temp below 55C.(it was going 65C and up at times)

So I changed the heatsinks, from 12x12x5 to 20x20x6 for the CPU, and the 9x9x5 to 12x12x5 for the memory and USB controller chips

Still fits under the fan of the case. Modded the case as well. Got the RPi temp below 50C again. Goal is keep the temp hovering 40C +/-2C
I know its a cheap piece of "equipment"... but I don't want regrets later on. Its mine so I do what I want, not what others want/suggest.

I've seen RPi extreme cooling suggestions, like oversized heatsinks with fans (from old PCs), but will make it quite impractical.

I'd like to try out the FLIRC case if they have a version with access to GPIO....so I can put a HAT on it....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
davidcoton
Posts: 4027
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Using fan on Pi

Thu Jun 28, 2018 8:29 pm

MarcosCD wrote: I want to use my Raspberry Pi to host a program and to prevent it to be at high temperature I want to put a fan on it
What do you consider "high temperature"? The Pi will run safely to over 80C, and will protect itself above that temperature by throttling its own speed.
If you have very high ambient temperatures, or a heavy long term workload, or just a hot Pi, some cooling may be necessary. Usually a heatsink in clear air or a metal case is enough (particularly so with the newest model, Pi3B+).
If you do need a controlled fan, use pcmanbob's circuit.
Z80 Refugee wrote: It is more important to have a diode across the transistor than it is across the fan motor.
Why so? That will let the current caused by the back EMF of the motor flow all the way to the PSU and back, a potentially large loop that will radiate the pulse as EMI.
It would also allow the voltage generated to appear in unwanted places in the circuit.
The diode is correctly placed as close as possible across the motor (or other inductive load), in order to minimise the radiating loop and stop the potentially high back EMF (voltage) developing in the first place.
Signature retired

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Using fan on Pi

Thu Jun 28, 2018 9:50 pm

davidcoton wrote:
Thu Jun 28, 2018 8:29 pm
Z80 Refugee wrote: It is more important to have a diode across the transistor than it is across the fan motor.
Why so?
When the transistor turns off, there will be a large negative spike at the transistor collector as a result of the collapsing magnetic field in the motor windings (or any other inductive load). Currently, you have nothing protecting the transistor, and the spike can get back to the GPIO.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

User avatar
davidcoton
Posts: 4027
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Using fan on Pi

Thu Jun 28, 2018 10:10 pm

Z80 Refugee wrote: When the transistor turns off, there will be a large negative spike at the transistor collector as a result of the collapsing magnetic field in the motor windings (or any other inductive load).
An inductor (and, IIRC, a motor) wants to keep the current flowing in the same direction. When the transistor switches off, in the absence of the diode this produces a positive spike as the charge builds up at the transistor collector(remember the EMF comes from the inductor/motor, it is not an external voltage applied to it). That's why it is called reverse EMF. The diode across the motor or inductor clamps this voltage by allowing the reverse current to flow. Thus, with the diode in place, there is no voltage spike.
Or has the whole industry been doing it wrong for many years? :shock:
Signature retired

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Using fan on Pi

Thu Jun 28, 2018 10:37 pm

Well, the "whole industry", including makers of power darlingtons, have been putting a diode across the transistor - so make your own mind up. I'm not saying there won't be a positive spike, but a negative spike will kill the transistor.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

User avatar
davidcoton
Posts: 4027
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Using fan on Pi

Thu Jun 28, 2018 10:53 pm

Z80 Refugee wrote:
Thu Jun 28, 2018 10:37 pm
Well, the "whole industry", including makers of power darlingtons, have been putting a diode across the transistor - so make your own mind up. I'm not saying there won't be a positive spike, but a negative spike will kill the transistor.
So what causes a negative spike? Unless I have misunderstood the theory (always possible), it is not due to the action of switching off an inductive load. It may be good design practice to protect power switching elements from negativwe collector voltage, but surely the cause is different?
Signature retired

pcmanbob
Posts: 6662
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Using fan on Pi

Fri Jun 29, 2018 8:37 am

I included the fly back diode only because in the past people have commented about it being missing, even though most pc fans don't actually need it, now it seems including it has caused comments too.

So to try an please everyone.

1. you may not need the fly back diode if you are using a pc type fan.
2. if you are using some other fan using a normal DC motor you will need a fly back diode
3. you may also need further protection diode across the transistor.

Image

So lets have no more fighting children.. :lol: :lol: ( said with tongue in cheek )
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Using fan on Pi

Fri Jun 29, 2018 9:21 am

The only thing that schematic is missing now is a base to emitter resistor, which ensures the transistor cuts off if the input goes open circuit.

I think a negative spike is the result of ringing. If the diode across the transistor is a zenner, it will also protect the transistor from excessive positive voltages. The diode across the inductive load suppresses positive spikes at the collector to V+, but this spike is only a problem if it exceeds the breakdown voltage of the transistor. Whether the flywheel diode helps with EMC is a moot point - it's not so much voltages as currents which induce EM noise.

"Fly back" is definitely not the right term for it, that comes from CRT scan circuits (when the spot flies back to the beginning of the next line or frame).
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

pcmanbob
Posts: 6662
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Using fan on Pi

Fri Jun 29, 2018 9:27 am

You can continue to add more diodes and resistors for further protection and in an industrial setting this is probably required , but at hobbyist level which is what most people here are, the minimum number of components to get the circuit working is what most will use, rightly or wrongly.


This diode is known by many names, such as flyback diode, kickback diode, snubber diode, commutating diode, freewheeling diode, suppression diode, clamp diode, or catch diode
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Using fan on Pi

Fri Jun 29, 2018 9:38 am

Agreed, but I defend the transistor protection in particular because otherwise the circuit may stop working for no apparent reason. Integrated drivers have them built in.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

User avatar
davidcoton
Posts: 4027
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Using fan on Pi

Fri Jun 29, 2018 10:54 pm

Z80 Refugee wrote:
Fri Jun 29, 2018 9:21 am
The only thing that schematic is missing now is a base to emitter resistor, which ensures the transistor cuts off if the input goes open circuit.
Agreed for profesional, modular design. Not necessary in a permanently connected homebrew circuit -- unless there are serious consequences to accidental fan operation (in which case, I wonder if a Pi is a suitable controller?)
Z80 Refugee wrote: I think a negative spike is the result of ringing. If the diode across the transistor is a zenner, it will also protect the transistor from excessive positive voltages. The diode across the inductive load suppresses positive spikes at the collector to V+, but this spike is only a problem if it exceeds the breakdown voltage of the transistor. Whether the flywheel diode helps with EMC is a moot point - it's not so much voltages as currents which induce EM noise.
Ringing? That requires a degree of resonance, which is unlikely here, or driving some form of transmission line (again not likely here).
I can think of only one way to produce a negative spike. That is with a capacitative load, when the supply voltage fails while the load is still charged.
Unprotected back EMF voltages can easily exceed transistor breakdown voltages -- though as has been said, maybe not with a small fan.
Of the three possible protection components, I certainly rate back EMF protection as the one most likely to do something useful.
Z80 Refugee wrote: "Fly back" is definitely not the right term for it, that comes from CRT scan circuits (when the spot flies back to the beginning of the next line or frame).
Agreed.
Signature retired

boyoh
Posts: 1317
Joined: Fri Nov 23, 2012 3:30 pm
Location: Selby. North Yorkshire .UK

Re: Using fan on Pi

Sat Jun 30, 2018 8:30 am

MarcosCD wrote:
Wed Jun 27, 2018 4:05 pm
I want to use my Raspberry Pi to host a program and to prevent it to be at high temperature I want to put a fan on it. How I can make it efficient?
Not sure but I think I was a Raspberry Pi 3.

Thanks.

If you use the Pi as it should be , there is no need for a fan or extra heat sinks
You only have to look at the size of the Pi to tell you it is not meant to run power
hungary circuits directly,, Just use the Pi to switch low power signals to con troll
Buffer stages for high power circuits using a separate power supply.

Fitting a fan on the on the Pi is counter productive, as this will ad load to the
Pi power supply, If you still intend fitting a fan , use a separate power supply.

Regards BoyOh Retired Electrical / Electronic Technician
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong

User avatar
bensimmo
Posts: 4157
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Using fan on Pi

Sat Jun 30, 2018 9:09 am

So where do I put this third yellow lead from my fan...




;-)

pcmanbob
Posts: 6662
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Using fan on Pi

Sat Jun 30, 2018 4:07 pm

The yellow wire on a 3 wire pc fan is normally the tacho, it produces 2 pulses per revolution at the same voltage that the fan is be supplied with.

So if you are powering the fan with 5v the last thing you want to do is connect the yellow wire directly to the gpio.

If you want to monitor the speed of the fan you will need to reduce the pulse voltage to 3v before connecting it to the gpio , you will then need to count the pulses to enable a speed to be calculated.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Using fan on Pi

Sat Jun 30, 2018 4:10 pm

Didn't you get what the wink meant?
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

pcmanbob
Posts: 6662
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Using fan on Pi

Sat Jun 30, 2018 5:05 pm

Z80 Refugee wrote:
Sat Jun 30, 2018 4:10 pm
Didn't you get what the wink meant?
As I was viewing this in a small tablet it was off the screen unless i scrolled right down.
So did not even knowing was there until you mentioned it. :cry:
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
bensimmo
Posts: 4157
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Using fan on Pi

Sun Jul 01, 2018 3:45 pm

While it was said in jest, it is a very good answer.

The user could then count the pulses and feed that back into the program. It could also be used as a check to see if is spinning.

You would think that most computer fans have all the feedback protection circuit built in as they are designed as plug and play.
But it's been a long time since I used to play with them.

User avatar
Imperf3kt
Posts: 2652
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Using fan on Pi

Sun Jul 01, 2018 10:18 pm

boyoh wrote:
Sat Jun 30, 2018 8:30 am
MarcosCD wrote:
Wed Jun 27, 2018 4:05 pm
I want to use my Raspberry Pi to host a program and to prevent it to be at high temperature I want to put a fan on it. How I can make it efficient?
Not sure but I think I was a Raspberry Pi 3.

Thanks.

If you use the Pi as it should be , there is no need for a fan or extra heat sinks
You only have to look at the size of the Pi to tell you it is not meant to run power
hungary circuits directly,, Just use the Pi to switch low power signals to con troll
Buffer stages for high power circuits using a separate power supply.

Fitting a fan on the on the Pi is counter productive, as this will ad load to the
Pi power supply, If you still intend fitting a fan , use a separate power supply.

Regards BoyOh Retired Electrical / Electronic Technician
Sometimes you may not like your Pi to throttle while watching a youtube video via chromium.
For such situations, a fan sometimes helps.
55:55:44:44:4C
52:4C:52:42:41

Return to “Beginners”