Jump to content

Temperature and fan control on OPI5


pazzoide

Recommended Posts

Hello,

 

I installed lm-sensors on my Opi5 and I'm able to check temperatures, however I don't know how to make the little fan spin when the temperature rise. I know the temperature is not going to rise till critical levels, but I live in very hot country and I just don't want my device to become too hot.

 

And do you know how to make the fan start at certain temperature rise? Also I'm not sure which pins I should connect the fan to..

 

image.png.d953790643a619065b528830ef12277f.png

 

One pin should be the 3.3V to get the power, what about the other one?

 

I'm running Armbian 23.02.2 with kernel 5.10.110-rockchip-rk3588

 

Thanks in advance :)

Link to comment
Share on other sites

@pazzoide Are you sure your fan needs 3.3v?

if you want it to be controllable you'll need a pwm fan like this one:

https://www.amazon.com/GeeekPi-Raspberry-Controllable-Adjustment-40x40x10mm/dp/B092YXQMX5/

Or a transistor and resistors.

 

The way I did was using a pwm fan (3 pin)  and editing the dtb by making a patch with some lines copied from Radxa. Although it does only trigger the fan at a certain temperature, it doesn't regulate the speed as it should, it's missing some lines that were later added. I'll make a new one soon.

The pwm fan in this dtb is set at pwm13 and triggers the fan at 60C , pwm13 has to be enabled with the overlay.

 

The thermal policy has to be on step wise, you could check this with:

cat /sys/class/thermal/thermal_zone*/policy

 

If it's something else you could set the following line in /etc/rc.local before the last line (exit 0):

echo step_wise > /sys/class/thermal/thermal_zone*/policy

rk3588s-orangepi-5.dtb orangepi-5-pwm13.dtbo

Link to comment
Share on other sites

@OP5_PLUS It has a 5v driver,  the black wire to 5v and red wire to pwm. The result I had with the fan I've got is that the fan didn't spin at 50 and at 55 degrees it was spinning at 100%. I've just looked at it and to me it seems like the cooling-levels should be  between 0-100 instead of 0-255.

 

I've made an overlay which you could edit and compile/activate with:

sudo armbian-add-overlay orangepi-5-plus-pwmfan.dts

 

With this overlay it works correctly with my fan, so post your results here and perhaps it could be edited in the source.

orangepi-5-plus-pwmfan.dts

Edited by royk
Correction wiring
Link to comment
Share on other sites

@OP5_PLUS Hi, I can not make it work. The fan is either working on full load or not working. Can some explain how to wire an PWM fan? Mine has 4 wires and the fan connector has only 2 pins. Maybe I'm missing something but I think that it should be possible to control the speed of the fan.

Link to comment
Share on other sites

The connector is made for a 2 wire fan, so GND of the fan to PWM and the + wire to 5v.

 

Sorry I see I've made a mistake, actually I've connected: 

FAN                   Connector

Black wire    >     5V

Red wire       >    PWM

 

I've also just tested a pwm fan the same way without the yellow wire connected and does work correctly. But this fan needed different values than my other fan, so you'll need to test a few values.

 

Don't try to connect the red wire to another PWM pin than the one at the fan connector!

 

If it goes at full speed immediately at 50 degrees, lower the values of the following line:

cooling-levels = <0 65 75 85 95 100>;

 

If the fan only starts from 55 degrees, then raise the first value until it just starts to spin and add 1 or 2 to be more secure it will spin all the time at that level.

 

The following  overlay should work with a pwm fan that's compatible with the Raspberry Pi (3.3v).

In this case 5v to 5v, gnd to gnd and pwm to pwm14m2

 

sudo armbian-add-overlay orangepi-5-plus-pwm14m2-fan.dts

 

Don't forget to remove the previous overlay from /boot/armbianEnv.txt

 

After editing the values just run the above armbian-add-overlay command again and reboot.

 

orangepi-5-plus-pwm14m2-fan.dts

Edited by royk
Mistakes
Link to comment
Share on other sites

It turns out that the fan connector doesn't give a real PWM signal (tested with pwm signal tester for laser module) and needs PWM values between 0-100.

If you really want to use the PWM wire (be sure it's 3.3v and not 5v) and use the above overlay, with the other PWM pins it needs values between 0-255.

 

 

Link to comment
Share on other sites

@nihilowy It does work here with a 2 pins fan with LED and with a 3 pins fan of Noctua, both connected with the black wire to 5v on the fan header and red wire to PWM on the fan header. 

Did you use the first overlay I had posted? orangepi-5-plus-pwmfan.dts

Compiled/installed with  sudo armbian-add-overlay orangepi-5-plus-pwmfan.dts ?

Checked if the temperature was high enough to trigger the fan?

Perhaps you've still enabled all PWM pins? This could conflict with the fan PWM pin, the fan PWM pin is enabled by default.

 

Try to disable all other overlay files in /boot/armbianEnv.txt and see if that helps. (Except sata if you need that one of course)

 

You could rise the temp quickly with: stress --cpu 8 or less if you want to see how it behaves at lower temps.

With armbianmonitor -m you could see the temp. (C.St. is always 0/7 and doesn't matter)

 

If you do also want to edit the temp settings you could use this overlay

orangepi-5-plus-pwmfan.dts

Edited by royk
Link to comment
Share on other sites

ok now I know. There are two points: 

 

1)Disable all pwm in armbian-config (just dont turn them on )

2) Wiring  polarity . Becouse case that I bought from ali ( geekworm ) has fan adapter from 2,5mm to 1,25 mm , but to work you have to change wiring red to black

on this adapter . To make it  rather then pull I pushed them with tiny screw from the other side of connector   ,then placed in , with changed polarity and at the end 

taped for security ( cause now they  are loose and can jump out  - that is dangerous )     

 

and works fine, only   iam concern for  attaching wiring to case.

thx I am testing Your overlay , it  switchs on above 50 C

CAM00089.jpg

CAM00090.jpg

CAM00091.jpg

Edited by nihilowy
Link to comment
Share on other sites

No problem, btw you could enable other PWM pins except the PWM 3 pins. In the DTB you could see that PWM3 controls pin pwm3m1. When you enable the other PWM3 overlays PWM3 might have been pwm3m0, pwm3m2 or pwm3m3 (I believe the last one you've added). So always check which one you need and only activate that.

Link to comment
Share on other sites

@Royk

when you wrote for a normal 2 wires fan "the black wire to 5v on the fan header and red wire to PWM on the fan header."

I guess the fan header is the socket on the Pi5 plus, and the 5 v is the right pin when watching the Pi 5 from the front? ( front being  where there is an audio out connector and the 2 blue USB)

 

Like in the photo at the beginning of that thread.

 

Thanks in advance.

Link to comment
Share on other sites

@Tony3 Yes that's correct. At the moment I've got a Noctua pwm fan connected the same way (only the red and black wire). And with this overlay, because it's often about 51 degrees idle I've set the first trip at 53 but edit it as what works best for you. That Noctua fan you don't hear at all and it never runs hotter than 62-64 degrees (with an old router heatsink). 

/dts-v1/;
/plugin/;

/ {
        fragment@0 {
                target = <&fan>;

                __overlay__ {

                                cooling-levels = <0 72 74 78 85 100>;
                                rockchip,temp-trips = <
                                        53000   1
                                        58000   2
                                        62000   3
                                        67000   4
                                        75000   5
                                >;
                };
        };
};

 

Edited by royk
Link to comment
Share on other sites

@royk I tried with the dts file proposed, it indeed starts at the set temperature, but goes full speed. It does not seem to receive any PWM. May I ask why the other dts above have a line dealing with pwm and not the one you proposed? I am a bit new with these overlay!

 

I also tried with a native  orange Pi5 ubuntu installation l (without installing any overlay), and I get the same behavior on-off.

Edited by Tony3
Link to comment
Share on other sites

@Tony3 Did you install the overlay with: sudo armbian-add-overlay name-of-overlay.dts  ??

If so then try lower settings at cooling-levels like: cooling-levels = <0 50 55 60 65 70>;

 

monitor the temperature with: armbianmonitor -m

and try to raise the temperature a bit with: stress --cpu 1  or more cpus if 1 doesn't raise it enough

 

Not sure what you mean with that one file has a line that's dealing with pwm. The cooling levels are the pwm values, the temp-trips are the values at which temperature it has to trigger each cooling level.

An overlay overrules the setting in the dtb, so if you don't mention it in the overlay it uses the setting in the dtb.

 

Link to comment
Share on other sites

The fan starts spinning at pwm 85, and it sounds like full speed already. Maybe my fan does not support PWM? (it is a normal DC fan, thus not designed for PWM)

Anyway it stops and it starts depending on temperature, so it does not really matter if full speed or not. It is very silent, this is the important thing.

What I like is that the fan stops when the Pi5 is shutdown, this is a Plus compared to the normal Pi 5.

 

I think I will put all the pwms values to 100 now.

 

Thanks for having helped

Link to comment
Share on other sites

It doesn't have to be a PWM fan, before I used a 2 pins fan with LED which was delivered with the heat sink. With the PWM fan I've got now it didn't even work with the PWM fan connected to that fan header, so it's weird it doesn't work on yours. Do you have other overlays enabled? And you use both of these pins?

 

But yeah if you don't hear the fan is doesn't matter much.

And PWM normally goes up to 255, but at least on mine its max is at 100

Edited by royk
Link to comment
Share on other sites

I got my fan with the case. There are no other overlay enabled, and yes the 2 pins of the fan are connected. I wonder if there are some components in the fan that could interfere with the PWM signal.

Maybe I should swap the black and red wires....

I guess that with your PWM fan you connected the ground to the header? I wonder why the PI5 socket does not have  4 pins...

Edited by Tony3
Link to comment
Share on other sites

I'm not sure but don't think there could be something in then fan that interferes. The only thing I can imagine is that the range is very small. Have you tried different values between 80-85?

Swapping the wires probably doesn't work but doesn't hurt either to try.

You do see that a line is added in armbianEnv?

Something like: user_overlays=orangepi-5-plus-pwmfan

Edited by royk
Link to comment
Share on other sites

I did more tests 1 by 1 increment.

The fan starts at 84 at low speed (and very noisy!) and then at 85 get full speed.

 

I think it is a range issue indeed. I will put 255 for all values and start the fan at 40 degC, as the noise looks like there is a bird in the box!

Link to comment
Share on other sites

Can someone please help to find the right connection for a 4 Pin PWM Fan (NF-A4x10 5V) to the 40pin interface?

Yellow +5V -> 5V -> 1. pin right side

Black - GND -> 3rd pin right side

Blue PWM Signal -> 6. pin left side GIO04_B2 PWM14_M1

image.png.90c23968c887d6f7380c9ab62a75751c.pngimage.png.4badd7b44ebc64fcc627fd66532544bb.png

 

How does I configure wiringOP in this case?

 

Best wishes Greg

Link to comment
Share on other sites

@greg396 WiringOP? WiringOP isn't mentioned in this topic as it isn't necessary. AFAIK is the green wire (RPM) only feedback of the actual RPM which will not be used. In case of the OPI5 I'm not sure if there'll be 5v on the PWM wire, if that's the case you might break the OPI5 by connecting it to the GPIO pins (3.3v), otherwise you can try it. In case you have the OPI5 plus you can try to connect it as in:

 

Link to comment
Share on other sites

Thank you for your efforts royk!

Sorry, I mention the Opi5 Plus and this is the correct 40pin table (page 233 actual manual)

image.thumb.png.79dfb040531697a73a0c3953d0cf1e3a.png

 

Can someone please help to find the best connection for a 4 Pin PWM Fan (NF-A4x10 5V) to the 40pin interface?

Yellow +5V -> 5V -> pin2 or pin4

Black - GND -> pin6

???? Blue PWM Signal -> pin7 (GPIO_D6 / PWM14_M2 febf0020)

 

Link to comment
Share on other sites

20.02.2024 в 21:06, greg396 сказал:

Can someone please help to find the best connection for a 4 Pin PWM Fan (NF-A4x10 5V) to the 40pin interface?

 

19.02.2024 в 13:34, greg396 сказал:

Yellow +5V -> 5V -> 1. pin right side

Black - GND -> 3rd pin right side

Blue PWM Signal -> 6. pin left side GIO04_B2 PWM14_M1

image.png.90c23968c887d6f7380c9ab62a75751c.png

If you use this fan and want to connect to the 40-pin connector.

 

@greg396

Read this discussion. It's well written here.

5V+4+pin+PWM+Noctua+A4X10+on+Raspberry+Pi

 

P.S. My previous recommendation is not suitable for this fan.

Edited by going
Connection diagram. Link.
Link to comment
Share on other sites

Thank you going! Yes, I would prefer the 2pin fan connector, but I need to find out getting the right adapter from 4pin Noctua NF-A4x10 5V (black & blue wire to the left & right) to Molex PicoBlade 2pin connector

Link to comment
Share on other sites

22.02.2024 в 23:27, greg396 сказал:

Yes, I would prefer the 2pin fan connector, but I need to find out getting the right adapter from 4pin Noctua NF-A4x10 5V (black & blue wire to the left & right) to Molex PicoBlade 2pin connector

 

Noctua_PWM_specifications_white_paper.pdf

- The fans operate at full rated speed if there is no PWM input signal.

 

1) Only two wires. The fan rotates at maximum speed:

Yellow +5V -> 5V -> pin2 or pin4 (40pin con.)

Black - GND -> pin6 (40pin con.)

 

2) Three wires. The power is regulated by the internal fan circuit. It may be necessary to connect pins 1 and 2 with a 1 kohm resistor.
Yellow +5V -> 5V -> pin2 or pin4 (40pin con.)

Black - GND -> pin6 (40pin con.)

Blue PWM Signal -> => to right contact (2):

 

OPI-5-plus-fun-con-V2.png.650c3126f058971ddb65da328ea522b9.png

 

 

fan_power_opi5-plus.png.4edbf091dc234c62fdeacdf2945b3969.png

 

3) Two wires. The power is regulated by the internal OPI5-plus circuit:

OPI-5-plus-fun-con-V3.png.8144e956a9cbe7af3d8ada457464e4a1.png

 

Everything that is drawn here you use at your own risk.

There are no guarantees.

I do not know the internal circuit of the fan.

Edited by going
Add more variants
Link to comment
Share on other sites

Hello thank you for your efforts, it's very kind from you!

I bought an adapter and a Molex PicoBlade with two red and black wire and soldered that to the adapter.

The fan works well, but it's only active if the cpu temperature gets up I think 50 degrees Celsius

 

blue (PWM) to (1) and black (GND) to (2) to the two-pin connector

image.png.a1dbc837d2c96a581ef22423d0053802.png

 

 

It's safer to change this to

Yellow +5V -> fan 5V pin1

(Black - GND -> fan pin2)

And the fan wouldn't be active all the time and only if the cpu temperature raises to 50 degrees?

image.png.f7a65c995c8e3e7e76fa293f17d97b9b.png

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines