Banana Pi BPI-R3: Everything you need to know

by androidpimp
16 comments

Table of Contents

Part 4: Installing a Fan-Cooled Heat Sink

The Banana Pi R3 comes with three onboard connectors, as shown in the photo below. You got two FAN PH2.0 (2PINS + 4PINS) connectors. an Input 12V power DC input source (VH3.96 2PINS) and third XH2.54 4PIN SATA power connector that can be used to power a 12V FAN.

Banana Pi R3 Connectors

FAN Wiring Configurations (Options)

Banana Pi R3 Fan Wiring

Configuration Option No. 1 (Passive Cooling)

If you don’t need the cooling fan option, you can order the following Heatsink from AliExpress and cut 20 mm from the 100 mm length. If 60 mm is too long, you will need to cut 3 mm of material using a circular saw. A Heatsink with dimensions of 80x57x10 should fit well and cover most of the R3 board components (Chips).

Passive Cooled Heat Sink Setup (Items list)

Item No'

Description

QTY

Buy Links

1

100x60x10mm  Aluminium Heat sink

1

2

Thermal Silicone Adhesive Cooling Paste

1

3

Circular Saw

1

-

AndroidPIMP.COM will not be liable or responsible for any loss or damage caused by improper wiring/assembly of the above components.

Cooled FAN Heatsink

This part might be a bit tricky. Because there is currently no official Heatsink with a built-in FAN that is fully compatible with the R3 board, and this Heatsink Cooling Fan is designed to fit into a video card, you will have to buy a suitable four or two pin type and replace the wire connector of the FAN with an XH2.54-4P / VH3.96 connector. This can be done by crimping, or the fastest method, in our opinion, is buying a pre-made cable with a connector included and soldering the wires together.

Preparing Conductive Silicone Thermal Pad

Based on the size of the chips, you can use scissors and cut the necessary width and height for the pads. Remember that the Heatsink’s 55 mm length is slightly smaller, so it will not fully cover most chips on the R3 board. It will comprehensively cover the 2GB DDR4 and the MediaTek MT7986A SoC Chip.

Cutting Conductive Silicone Thermal Pad

There are better solutions than this option, but it’s better than nothing. Plus, it’s fast, and you also have four mounting screws, which provide reasonable clamping force against the chips, helping to improve heat convection more effectively.


Configuration Option No. 2

Using the CN34 (XH2.54-4PIN) Connector as the fan 5V/12V power source.

 Setting Up Fan Cooled Heat Sink (Items list)

Item No'

Item Photo

Description

QTY

Buy Link

1

Zotac 9400GT GT210 GT520 graphics card with 2 or 4Pin Connector.

1

2

XH2.54 4PIN Terminal wire

1

3

Conductive Silicone Thermal Pad

1

4

Heat Shrink Sleeving Tubing Kit

1

Tools

Soldering iron 

-

For Soldering the wires

1

-

AndroidPIMP.COM will not be liable or responsible for any loss or damage caused by improper wiring/assembly of the above components.

Connecting 4 Pins Cooled Heatsink wires w/ the XH2.54 4 PIN wires

XH2.54-4PIN Color FAN Wire Color
White Black
YellowYellow
BlackNo need to connect
RedNo need to connect

Final Step (Powering/Operating the FAN)

To check that everything is working and to power the FAN on using the GPIO Interface controller, you will need to execute the following commands:

echo 419 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio419/direction
echo 1 > /sys/class/gpio/gpio419/value

Option #1

You don’t want to turn the FAN on constantly. You can also create a script to time the FAN operation when reaching a specific temperature. For example, when the CPU temperature is above 45 °C, as shown below, the Fan starts to power for 30 seconds.

Creating THE bash script file
Steps:
Creating a bash script name using the vi editor under the path /etc/init.d/
vi /etc/init.d/Fan.sh
Copy script code into the file we created with the vi editor
Copy & Paste the code in the “Fan Control bash script” section.
Change the file attributes to executable by running the command
chmod u+x Fan.sh
To manually run the script in the background, execute the following command:
./Fan.sh &

Fan Control bash script:

#!/bin/sh

pin_num=8
sleep_time=5 #seconds
fan_time=30 #seconds
fan_temp_threshold=45

gpio_num=$((pin_num + 411))
echo $gpio_num > /sys/class/gpio/export
gpio_sys_path='/sys/class/gpio/gpio'
gpio_sys_path="${gpio_sys_path}${gpio_num}"
current_dir="`cat ${gpio_sys_path}/direction`"
if [ "$current_dir" = "in" ]; then
	echo out > "${gpio_sys_path}"/direction
fi
echo 0 > ${gpio_sys_path}/value
while [ true ]
do
temp=$((`cat /sys/class/thermal/thermal_zone0/temp`/1000))
if [ "$temp" -gt "$fan_temp_threshold" ]; then
	echo 1 > ${gpio_sys_path}/value
	sleep $fan_time
	echo 0 > ${gpio_sys_path}/value
else
	sleep $sleep_time
fi
done

How to Automatically load the script

If you have already created the script file Fan.sh under /etc/init.d/ you will need to follow these steps:

  • Step #1: Invoke the “enable” command to run the init script on boot: /etc/init.d/Fan.sh enable
  • Step #2: Now, the script will automatically run on boot. You can check to make sure it’s running in the background by issuing the command: top
#!/bin/sh /etc/rc.common

pin_num=8
sleep_time=5 #seconds
fan_time=30 #seconds
fan_temp_threshold=45

gpio_num=$((pin_num + 411))
echo $gpio_num > /sys/class/gpio/export
gpio_sys_path='/sys/class/gpio/gpio'
gpio_sys_path="${gpio_sys_path}${gpio_num}"
current_dir="`cat ${gpio_sys_path}/direction`"
if [ "$current_dir" = "in" ]; then
	echo out > "${gpio_sys_path}"/direction
fi
echo 0 > ${gpio_sys_path}/value
while [ true ]
do
temp=$((`cat /sys/class/thermal/thermal_zone0/temp`/1000))
if [ "$temp" -gt "$fan_temp_threshold" ]; then
	echo 1 > ${gpio_sys_path}/value
	sleep $fan_time
	echo 0 > ${gpio_sys_path}/value
else
	sleep $sleep_time
fi
done

Option #2

To automatically control the speed of your fan base on Pulse-width modulation (PWM), you can install the Module and script according to the following steps:

Installing the pwm Module & SCRIPT
Steps:
Before Installing: Make sure that your 12V fan is connected to the Banana Pi R3 CN34 Connector.
Install the following OpenWrt Snapshot & OpenWrt Module packages from our download links:
OpenWrt snapshot image: Click Here to Download
OpenWrt module/ package: Click Here to Download
Make sure you have kmod-hwmon-pwmfan package installed.
Select & install the kmod-soft_pwm_5.15.89-1_aarch64_cortex-a53 package file:
System -> Sotfware -> Upload Package -> Browse -> Select the package file
Create a new Bash file via vi Editor inside a directory.
for Example: /etc/init.d
vi /etc/init.d/fan.sh

The script file content:

#!/bin/bash
echo 419 > /sys/class/soft_pwm/export
echo 6000 > /sys/class/soft_pwm/pwm419/period
echo 1200 > /sys/class/soft_pwm/pwm419/duty_cycle
echo 1 > /sys/class/soft_pwm/pwm419/enable
After saving the file, change the file attributes to executable:
chmod +x /etc/init.d/fan.sh
Running the script
/etc/init.d/fan.sh &

(It’s important to add the & symbol at the end of the line, as it will run the script in the background, allowing the boot process to continue without waiting for the script to finish).
To automatically run the script when the computer starts up. Add the following line to /etc/rc.local
vi /etc/rc.local

rc.local file should look like this:

!/bin/sh
@reboot /etc/rc.local/Fan.sh
exit 0

**Special Credits to elxyzad from HT magazine website (htmag.co.il) for writing the script & module**


Configuration Option No. 3

Using the CN22 (PH-2PIN) Connector as the fan 12V constant power source.

 Setting Up Fan Cooled Heat Sink (Items list)


Item No'

Item Photo

Description

QTY

Buy Link

1

Zotac 9400GT GT210 GT520 graphics card with 2 or 4Pin Connector.

1

2

VH3.96- 2PIN Terminal wire

1

3

Conductive Silicone Thermal Pad

1

4

Heat Shrink Sleeving Tubing Kit

1

Tools

Soldering iron 

-

For Soldering the wires

1

-

AndroidPIMP.COM will not be liable or responsible for any loss or damage caused by improper wiring/assembly of the above components.

Connecting 4 Pins Cooled Heatsink wires w/ the VH3.96-2PIN wires

For a constant (Always on) 12V power source, you can use the VH3.96-2PIN DC input connector. We tested it, and it worked fine for us.

VH3.96-2PIN Wire ColorFAN Wire Color
BlackBlack
RedYellow

Configuration Option No. 3 (With Support for PWM)

This wiring should work only with a 5V Fan with 3 or 4 wires, as it has a separate PWM wire colored in blue. We tried to power a 12V FAN, but we were unsuccessful. The FAN started working every few seconds and stopped, and vice versa. If the FAN spinning is correlated with the thermal sensor operation, it’s an annoying configuration we prefer to avoid.

Instead of using the 5V power source, If you order the Heatsink with the 12V Fan included, you should get the necessary “full” voltage from the XH2.54-4PIN SATA connector or the DC IN 12V VH3.96 connector.

Configuration Option No. 4 (Without PWM Support)

Connecting the 3-pin cooled heat sink wires with the XH2.54-3PIN wires is the simplest installation option. Just plug the fan power into the 5V 3PIN power socket and enjoy the added convenience of setting a maximum temperature threshold. Once this threshold is reached, the fan will automatically start spinning, ensuring effective heat dissipation.

Adjusting these trip points

These trip points are predefined temperature values at which the system triggers certain actions, such as adjusting fan speeds or activating cooling mechanisms, to prevent overheating and maintain safe operating temperatures.

Specifically, trips are numbered. For example, a “trip_point_4_temp” indicates the fourth thermal trip point temperature for the system. When the temperature sensor in the system detects that the temperature has reached or exceeded this specified trip point temperature, it triggers a response, such as increasing fan speed, to help cool down the system and prevent damage from excessive heat.

By setting and adjusting these trip points, users can customize how their system responds to temperature changes, ensuring optimal performance and preventing overheating issues.


Controlling the fan rotation speeds:

  • You can essentially set a temperature threshold (in this case, 70000) at which the fan will adjust its speed.

echo 70000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp

To lower the fan rotation speed, you can increase the temperature value in the command. For example, to make the fan rotate slower, you can set a higher temperature threshold. Here’s an example:

You can change the command to: echo 80000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp

By increasing the temperature threshold to 80000, the fan will trigger at a higher temperature, causing it to rotate at a lower speed compared to when it was set at 70000. This adjustment can help regulate the fan’s rotation speed based on your system’s temperature needs.

In this example, we have set the tipping point temperature to be 50 °C. Once the CPU temperature reaches this temperature, the fan will automatically start spinning. Considering the temperature inside the case is high, especially in a closed case, the temp will be equal or exceed this threshold, therefore our fan to continuously spin.

echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp
echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp

Setting the trip points to load automatically when the OpenWrt OS boots is simple. You can copy and paste the command above into the Local Startup tab accessible under System -> Startup as shown in the photo below.

Banana Pi R3 OpenWrt trip points
Banana Pi R3 OpenWrt trip points

Related Posts

0 0 votes
Article Rating
Subscribe
Notify of
16 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
1 year ago

When you do recommend installing a passive (or active) heat sink to this setup? Passive cooling is I think a no brainer, it’s cheap and silent. Strange they don’t add passive heat sink to their package product, as part of the package.

1 year ago

“Strange they don’t add passive heat sink to their package product, as part of the package”.
They had some supply problems because of COVID.

If you have a large heatsink that will fit and cover all chips, it might be worth trying the passive cooling option. Just use a lower in height so you have the option to add a fan.

1 year ago
Reply to  androidpimp

I just noticed that the “complete kit” also comes with heat sinks. Seperate heatsinks for each chip. If you buy a large heatsink, that will work as well, BUT keep in mind that the chips have different heights, meaning you should use different heat pads (1.5 mm and 0.5 mm) to have a good coverage of the heat sink on the different chips. I did read about performance issues on forum.banana-pi.org forum, when you don’t cool the chips enough. Especially with passive cooling, it might still be a good idea to add additional vent holes manually in the casing. Since… Read more »

1 year ago

So use 1.5-2 mm thermal pads. Nothing will happen. They are elastic, so it does not matter if you are using the highest type for all chips. It’s not rocket science. I agree about the vent holes. You can drill a few holes.. or you can also glue a small fan to the bottom of the case. And maybe use the GPIO header pins as a power source. Just to get the hot air out of the case.

1 year ago
Reply to  androidpimp

Actually there is a fan header connnector on the R3 board. Which can do PWM.

1 year ago

Kindly Try it, and let me know if it works well.
you can email me with the info. Thanks

1 year ago

Ps. also add a link to the package deal of the Banana Pi BPI-R3? https://www.aliexpress.com/item/1005004886608696.html.

Since you mentioned the single board computer only on your last page.

1 year ago

Thanks. I added the link for the complete kit.

Ivan
1 year ago

Which version of PCIe does the board support?

1 year ago
Reply to  Ivan

According to MediaTek website >> M.2 M-Key PCIe interface (2-lane PCIe 2.0)

Hattan
1 year ago

Is there any nas software or docker image that will handle those multiple hdds ? Exampme if i want to raid, zfs or btrfs

1 year ago
Reply to  Hattan

1) OpenWrt has NAS support.
2) You can also try CasaOS.
3) OpenMediaVault should run on Debian.

Pablo
1 year ago
1 year ago
Reply to  Pablo

This module is not compatible with GPON technology.
If the module information / specifications do not indicate it’s a GPON compliance, then it is safe to say that it is not GPON compliant.

Miles
1 year ago

Did you use anything to glue the copper-made sheet plates on chips?

Last edited 1 year ago by Miles
1 year ago
Reply to  Miles

I used a thermal silicone adhesive plaster.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy