Coder Social home page Coder Social logo

allstone / lenovo-ideapad-z500-fan-controller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soberia/lenovo-ideapad-z500-fan-controller

0.0 0.0 0.0 35 KB

Lenovo IdeaPad Z500 Fan Controller

License: BSD 3-Clause "New" or "Revised" License

C++ 100.00%

lenovo-ideapad-z500-fan-controller's Introduction

๐Ÿ’ก About

Embedded Controller (EC) is a device responsible for feeding other parts of the system the electric voltage they need. Therefore if EC pass more voltage to the cooling system, this cause fan to spins at higher speed. Lenovo IdeaPad Z500 (all variants) uses ENE KB9012QF A3 EC. For controlling the EC we can change the EC registers to achieve functionality we want, but for this model and according to its datasheet, I couldn't find the registers which was dedicated to controlling the fan speed. So as a last resort, I reverse engineering the Lenovo Energy Manager (old version for Windows 8) software to find how Dust Removal feature of this app actually works and build this program with it. This software communicate to the EC through Lenovo ACPI-Compliant Virtual Power Controller kernel driver and if you're interested you can study the source code.

At the end this program only periodically active Dust Removal to force the fan to start spinning. Here's how this works:

Lenovo Energy Manager's default Dust Removal procedure takes 2 minute to complete. During this process every 7 second, fan will be stopped completely for 2 second before spins again for another 7 second until the whole procedure is over. The best we can do for reducing fan inactiveness time is to let the fan spins for 7 second and then stop the Dust Removal procedure and after 1 second continue the procedure again. By this way, during that 1 second, fan won't stop completely and still is spinning by normal speed. However Dust Removal procedure is controlled automatically by EC itself and sometimes may suddenly stop the procedure during that 7 second of spinning and this leads to fan stop spinning for something from 1 to 7 seconds. For workaround about this problem we can check the Dust Removal status registers in EC repeatedly during that 7 second of spinning and rewrite them when procedure is stopped, but I have found no evidence to prove this is actually working! All of this means the fan might stops working from 1 to 7 seconds sometimes!

๐Ÿ“‹ How to use

First you need Lenovo ACPI-Compliant Virtual Power Controller driver. If you installed Lenovo Energy Manager before, you should have it already. You can check it with Device Manager under System devices to make sure the driver is present. However if you don't have the driver, you can get it from Lenovo support website.
Second this program has to run with administrator privileges to work properly. You can download it from here.

Now you can just open FanController.exe and fan should start working and you should see this on the console:

FAN STATUS = ACTIVE
FAN SPEED  = 71%
CPU TEMP   = 52c

If you want the fan works only after CPU temperature exceeds certain value, you should run the program with this parameter:

FanController.exe --temperature 70

If you want the program always runs with system startup, create a scheduled task in PowerShell with administrator privileges: (you should insert compelete program path)

Register-ScheduledTask `
    -TaskName "FanController" `
    -Trigger (New-ScheduledTaskTrigger -AtLogOn) `
    -Principal (New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest) `
    -Settings (New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -Priority 0 -ExecutionTimeLimit (New-TimeSpan -Seconds 0)) `
    -Action (New-ScheduledTaskAction -Execute "C:\FanController.exe" -Argument "--interval 0 --temperature 70")

And now the program always runs at boot time and in background mode, and only enables the fan when CPU temperature exceeds 70ยฐC. For disable it run this in PowerShell to remove the created scheduled task:

Unregister-ScheduledTask -TaskName "FanController" -Confirm:$false

For more information about parameters, you can try this:

FanController.exe --help

๐Ÿ”จ Build from source

You need to compile your app with c++17 flag or newer versions.
You need WinRing0 driver to access the hardware, make sure you place WinRing0x64.sys or WinRing0.sys beside your binary files.

โš ๏ธ Disclaimer

Author of this software is not responsible for damage of any kind, use it at your own risk!
This program shouldn't be used with any Lenovo laptop model except IdeaPad Z500.
But if you're brave enough to test this on your system and that works for you, let me know to include your laptop model for other people that may come to this.

lenovo-ideapad-z500-fan-controller's People

Contributors

soberia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.