Electronics, coding and hacking. And ADD.

« A 68k sandwich Another C64FC run »

Cooling the Orange


I recently got my hands on an Orange Pi Zero, a Raspberry Pi Zero alternative, if you're unfamiliar with it. What I noticed, though, is the OPi's CPU gets hot. So hot that it would crash under heavy load. At first I tried passive cooling with a few stick-on-sinks, and they helped, but I decided to take it one step further and built this:

I drilled a hole in the case and attached the smallest 5v fan I could find on eBay. The fan can be a bit noisy at times, so I decided to control it with a switching PNP transistor, hooked up to pin PA11 and crammed everything inside the small case. This simple Python script is started in rc.local and runs in the background indefinitely:


from pyA20.gpio import gpio
from pyA20.gpio import port
from time import sleep

gpio.setcfg( port.PA11, gpio.OUTPUT)

while 1:
    with open( "/sys/devices/virtual/thermal/thermal_zone0/temp" ) as f:
        content = f.readlines()

    temp = int(content[0])

    if temp >= 50:
        gpio.output( port.PA11,gpio.LOW )

    if temp < 45:
        gpio.output( port.PA11, gpio.HIGH )


As you can see, when the CPU's internal temperature exceeds 50 degrees celcius, the fan is switched on. I have a hysteria of 5 degrees, so it will not switch off again until the temperature is less than 45 degrees celcius. This was tested using the cpuburn tools that really, really stress the CPU.

And, hey, I'm as surprised as you are: it actually works very well; when the fan starts running, the CPU temperature drops a few degrees in a matter of seconds.

I may not need this too often, but it was a fun (and cute) build. Besides, what's cooler than being cool? Ice cold!


to Cooling the Orange

Feed for this Entry


  • Great job, just bought a OPZero and having temp issues (same case as yourself). How'd you wire the fan and the PNP Transistor up?


    #1089 | Comment by Michael on Nov 8, 2017 09:22pm
  • I did exactly the same thing after reading your post (hole drilled) but just connected the fan to run all the time.
    Now the board is very stable :)

    #1124 | Comment by Przemek on Sep 22, 2018 07:45pm

About You

Email address is not published.

All messages must be validated by the admin.

Spam messages or messages containing URLs linking to spam, will never be published.

Add to the Discussion

Add to Google