Raspberry pi 4 how to connect the fan

PWM control of active cooling on Raspberry Pi, Orange Pi, Banana Pi

In many cases, minicomputers such as Raspberry Pi, Orange Pi, Banana Pi, etc.п., Comes with a small 5V fan so that you can cool the processor (or rather the SnC/SoC) of the computer. However, these fans are usually quite noisy, and many connect it to pin 3.3V to reduce the noise. The fans are usually rated at 200 mA, which is quite a lot for a 3.3 V on the Raspberry Pi.

This project teaches you how to adjust the fan speed depending on the temperature of the processor. Unlike most manuals covering this topic, we’ll not only turn the fan on or off, but also control its speed with PWM, as we do on a regular PC.

Raspberry Pi 4 how to connect the fan

The new Raspberry Pi 4 single-board computer was introduced not long ago, and it has a very high performance. According to the creators of the system, it is quite capable of providing most users with the performance level of an ordinary desktop PC. But with great power comes great heat. And enthusiast Jeff Geerling tells us how you can handle it pretty easily.

Usually the hottest element of a single board computer is the single-chip platform. But Raspberry Pi 4 heats up not only the main chip but also some other parts including power supply system. In the thermal image below you can see how the board heats up. After about five minutes of no load on the board.

Note that the central dark square is the processor, but its metal cover dissipates the infrared radiation quite effectively to the sides. The white spots on the bottom left are the power circuits from the USB Type-C connector. And the little red spot on the right side is the USB-controller, which under load “heats up” to white color corresponding to temperatures of 60-70 °C.

As a result, if you actively use Raspberry Pi 4 and subject it to different hard tasks, after a while the temperature of the processor and other components will reach 80 °C or higher. According to Geoff Girling, the clock frequency drops (trotting) after less than 10 minutes of running the Raspberry Pi 4 under load.

The heat is amplified by using a proprietary case for the Raspberry Pi 4, which is a closed plastic box without any ventilation. So Jeff decided to modify the case by making a hole in it and fitting the top lid with a fan. I used a Pi Fan which can be connected directly to the GPIO pins.

Processor temperatures without and with fan

After installing the fan in an hour-long stress test of the Raspberry Pi 4 processor, its temperature was kept at 60 °C and it didn’t even try to reset. But there is one disadvantage: the noise level of the fan is about 50 dBA at a distance of 30 cm. But as Jeff mentioned, you can’t use Raspberry Pi 4 without a fan in a brand-name case, it gets very hot.

See also  How to put a silicone shape in an oven

An alternative here can be third-party metal cases, which passively dissipate heat. Note that a full-fledged ICE Tower cooler with an aluminum radiator, heat pipe and fan was previously introduced for the new Raspberry.

If you see an error, just highlight it with your mouse and press CTRLENTER. | You can write better? New writers are always welcome.

Measuring of temperature

Let’s go further and do some in-depth research on this issue to determine whether active cooling is needed or whether most applications can “make do” with passive cooling only. Use the Python library vcgencmd to monitor and write the temperature and the current CPU clock speed to a file.

#!/usr/bin/env python3 import sys import OS import time import vcgencmd as vc def main: start_time = time.time fb = open (“/home/pi/readings.txt”, “a”) fb.write(“Elapsed Time (s),Temperature (°C),Clock Speed (MHz),Voltage Core (V)”) while True : clock = int(vc.measure_clock(‘arm’) / 1000000 ) string = ‘ %.0f. %s. %s. %s \n’ % ((time.time. start_time),vc.measure_temp,clock,vc.measure_volts(‘core’)) print (string, end =”) fb.write(string) time.sleep( 1 ) if name ‘main’: main

Passive and active cooling to thermoregulate the Raspberry Pi

Whenever a new Raspberry Pi board is released, there are articles about being careful about controlling the temperature of the new board. But this time, with the release of the Raspberry Pi 4, it seems that if the processor is under heavy load for long periods of time, you can’t do without adding some passive or active cooling to prevent it from thermal throttling (trotting).

Decreased CPU performance when heated up is observed by many respondents when performing tasks that require a heavy load on the Paspberry Pi 4 CPU.

When looking at the Raspberry Pi 4 performance tests done by Gareth Halfacree, we see unusually high heating of the board. The following conclusion can be drawn from these tests “. Of course this board can be used without additional cooling, but for heavy duty applications it makes sense to add active cooling to avoid thermal throttling”.

Working under constant high load, such as machine learning tasks, the Raspberry Pi 4 microcomputer’s processor will regularly skip work cycles due to overheating. Under heavy loads, thermal throttling can significantly increase task times. For example, in the example described above, the total computation time was reduced by 20% with passive cooling and by 30% with active cooling compared to the total execution time in non-cooled mode when the CPU was subjected to trotting.

Passive cooling is not sufficient for heavy loads longer than

200 seconds, active cooling is recommended for such tasks to prevent thermal throttling. Naturally, when using the Raspberry Pi 4 inside an enclosure, the situation will worsen, and additional cooling will be needed much earlier.

Addendum: some thermal images from Gareth Halfacree, Illustrating the difference between active and passive cooling.

Finishing off the week’s work with a little thermal imaging: a stock #RaspberryPi4 after a ten-minute CPU burn; the same Raspberry Pi 4 with a @pimoroni heatsink; and again with a @pimoroni Fan Shim. Biiiig difference, there! piccom/OrDj62qJlX

Keeping it cool

Electronic products, such as computers, give off heat when used, and too much heat can be harmful to the system. This is why we see cooling components such as fans and radiators inside our laptops and desktops.

Many people are happy with the performance of the Raspberry Pi 4. However, many have also noticed that the processor throttles when used for long periods of time or when the tiny board carries too much load, such as when running resource-intensive applications. One user’s test shows that the CPU reached 80° C in just a few minutes while watching videos or scrolling through complex websites. Once the temperature reaches 80° C, the CPU starts to throttle. [1] It’s the same with the graphics processor when the temperature rises to 85° C. Temperature control significantly affects Pi performance; reducing the CPU clock speed to 750 MHz from 1.5 GHz slows down processing time. Not only that, the whole board becomes too hot to work with because the other components get hot too.

See also  Air vessel check for air leaks

Other tests are conducted by different users, indicating that the Raspberry Pi 4 B’s CPU trotting rapidly reduces its performance. To reduce or eliminate thermal throttling, it’s best to integrate both a passive and active cooling system with the Pi. If you’re keeping the Pi in a casing, putting a heatsink on top of the processor may help a bit, but for better airflow and to prevent thermal throttling it’s best to install a fan. Better ventilation will prevent wear and tear on the processor and other components on the board, thus extending the life of your Pi.

However, this will also result in additional costs to set up your PC or projects, so buying a Pi won’t be as cheap as it used to be. Next question: when do you really need a fan for the RPi 4?

Measuring the temperature

Let’s go further and do some in-depth research on this to determine how much active cooling is needed or if most applications can “make do” with passive cooling only. Use the Python library vcgencmd to monitor and record the temperature and the current CPU clock speed into a file.

#!/usr/bin/env python3 import sys import OS import time import vcgencmd as vc def main: start_time = time.time fb = open (“/home/pi/readings.txt”, “a”) fb.write(“Elapsed Time (s),Temperature (°C),Clock Speed (MHz),Voltage Core (V)”) while True : clock = int(vc.measure_clock(‘arm’) / 1000000 ) string = ‘ %.0f. %s. %s. %s \n’ % ((time.time. start_time),vc.measure_temp,clock,vc.measure_volts(‘core’)) print (string, end =”) fb.write(string) time.sleep( 1 ) if name ‘main’: main

Modding the official Pi case

Without any ventilation the computer in the case turns into a sort of small furnace. A heat sink might help a little, but that heat has nowhere to go! So Jeff Girling decided to follow the example of this Reddit user and put a fan in the top cover.

Then Jeff Gehrling made a hole in the case for the fan with a 1 1/8″ circular saw.

raspberry, connect

Then we sanded the hole with sandpaper (up to 600 grit for a really good finish) to smooth out the cut after drilling. We put the fan in, drill four 7/64″ holes near it for the screws, connect the fan to the GPIO for power: pin 4 (5 volts) and pin 6 (ground), see the diagram. pinout diagram.

Should You Buy an All In One Computer?

All in One computers are very popular with users who appreciate miniaturization of electronic devices and want to reduce the number of cables. These are devices that have many advantages, but also have disadvantages.

Advantages of All In One computers:

  • They are compact devices. they take up as much space as a slightly thicker computer monitor.
  • It is a very aesthetic solution to minimize the number of cables around the desk.
  • All in One computers are easy to keep clean because they are on the desk, not under it, and there are not a lot of cables around them.
  • A computer built into a monitor usually requires less power than a standard PC.
See also  What to do if the machine skips stitches

Disadvantages of All In One computers:

  • Fewer choices of devices compared to standard computers and more complex hardware modifications.
  • Lower efficiency is possible, as well as cooling problems under high load.
  • Components are difficult to add or replace.
  • Limited choice of devices. there are simply far fewer than standard kits.

The main advantage of computers in monitors is that they simply take up less space than conventional computer sets. We don’t need to prepare space on or under the desk to house the central unit.

Another advantage comes from limiting the number of individual devices, which also gives you significantly less cables. If the computer will be equipped with a wireless mouse and keyboard, you can connect it with only one cable. This allows you to make better use of your workspace.

The computer in the monitor can be connected to a printer or other peripherals thanks to the appropriate inputs, and because of this the possibilities of use are as great as in the case of desktop computers.

An additional advantage is that All-in-One kits are usually of a pleasant design and are ideal for planning a modern and useful workspace.

Temperature tests

Time to plug in the power, and oh blue LEDs in the fan.

You might remember that we installed new VLI firmware which lowers the board temperature but unfortunately breaks the USB performance and stability, so before the tests we return to the old firmware. We also enabled ZRAM on the board to avoid using swap.

Radiator and fan

Executing 7. zip benchmark. This will take a long time / sbc. bench. sh : line 600 : 4899 Killed taskset. c 0 “” b. mmt 1 gt ; gt ;

We didn’t have enough memory for the 7-zip during our test, but we were able to get our data. With the heatsink, the Raspberry Pi 4 will idle at around 37°C and go up to 46.2°C when all four cores are in use (multi-threaded compression/decompression with 7-zip). Note: Room temperature was 27-28°C

Compare this with the same test without any radiator, conducted at room temperature 28 ° C.

The board will idle at around 65° C, rising well above 80° C and often throttling as the Broadcom BCM2711 processor will throttle if the temperature reaches 85° C.

So the fanink clearly does its job, but some users say that they didn’t buy their Raspberry Pi 4 to install a noisy fan on top, it increased the power consumption (by 0.4W).

raspberry, connect

Just the heatsink

No problem. We can disconnect the wires and even remove the fan completely, as it is simply attached with four screws. We lost the nice LED backlight, but we will be quiet.

Let’s do the test again [ Update: this section has been updated because the first time we did not wait for the idle temperature to stabilize because it took a long time]

| Denial of responsibility | Contacts |RSS