CH340-fan-control - USB fan control script


Recommended Posts

I own a few Android TV boxes that have poor thermal designs that are prone to overheating when under sustained load. This can either cause your device to significantly slow down or shut down entirely. This can be fixed by cutting a hole in the bottom on your TV box above the SoC and sticking a small USB fan on it. In my case I am using a AC Infinity 40mm x 20mm USB Fan that cost me £10.

 

CH340-fan-control is a python script to only activate my TV boxes USB fan when required by using a USB relay module. I'd expect somebody (or several somebodies) have already wrote a similar script for the same device but I failed to find it so here is my effort at fixing this common TV box issue. Hopefully someone else will find it useful.

https://github.com/danboid/CH340-fan-control

 

CH340+fan.jpg

X96-Air+fan.jpg

Link to post
Share on other sites
Armbian is a community driven open source project. Do you like to contribute your code?

That looks like a good start - but my "dream" is a PWM-controlled fan which will spin slowly/fast depending on the temperature.

I couldnt imagine that nobody before has built something like this.

The PWN controlled fan could be controlled by the SBC itself or by a small MCU like a arduino...

Link to post
Share on other sites
On 6/9/2021 at 2:26 PM, guidol said:

The PWN controlled fan could be controlled by the SBC itself or by a small MCU like a arduino...

 

I'm very rusty in electronics, but it should be easier than you might image, as long most SBC expose PWM pins.

What you need is a NPN transistor (or even better a logic-level mosfet) and a resistor.

The PWM pin controls the base of the transistor (the resistor goes in the middle between), the emitter of the transistor goes to ground and the collector of the transistor goes to the negative of the fan.

The positive of the fan goes straight to power source.

 

Correctly dimensioning the thing is the challenge, but if you use a logic-level mosfet in place of the transistor you don't need to do any calculation and you may omit the resistor too (but it's better to place it anyway, a 470ohm should be suitable there).

 

Link to post
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...