element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino As PC Fan Controller
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 16 replies
  • Subscribers 394 subscribers
  • Views 3255 views
  • Users 0 members are here
Related

Arduino As PC Fan Controller

nicolaoscon96
nicolaoscon96 over 7 years ago

Hello there,

 

It's been a while to write here and I came back with a question. I want to build a fan controller for my desktop pc and I wanted to build it with an Arduino (Just add some modes like gaming for full speed, office use for lower rpm and less noise)>>Where I will be able to control by sending a  number for example 1 for gaming mode 2 for office<<. I found some online and they are really cheap but I wanted to experiment with that. So I wanted to ask is this possible? Can I control (4 fans) with an Arduino and get feedback from them about the RPM and the voltage if it possible(have it connected with USB on my computer and read the output in Arduino IDE)? The fans that am using are 3 pins (black-red-yellow).

 

Thanks

nicolaoscon96

  • Sign in to reply
  • Cancel

Top Replies

  • koudelad
    koudelad over 7 years ago +7
    Hello, Honestly, the 8-bit microcontroller in Arduino won't have enough resources to do that. It only has 2 8-bit counters and one 16 bit counters. If you want to monitor 4 fans independently, you need…
  • shabaz
    shabaz over 7 years ago +6
    Hi Nicolas, If you want to do it accurately, as David says, you'll need different hardware. According to the link here: How PC Fans Work the three-wire fan uses it's third wire to provide speed feedback…
  • shabaz
    shabaz over 7 years ago in reply to gdstew +4
    Getting RPM feedback actually isn't the end goal. Why not sometimes actually try to understand the requirement, and form a more complete answer that helps the user? Just an opinion I've formed over the…
  • koudelad
    koudelad over 7 years ago

    Hello,

     

    Honestly, the 8-bit microcontroller in Arduino won't have enough resources to do that. It only has 2 8-bit counters and one 16 bit counters. If you want to monitor 4 fans independently, you need at least 4 counters that are able to capture external triggers (count edges from the microcontroller's pins), however, you also need 4 counters (or 1 counter with 4 period comparations) to independently drive them.

     

    I would recommend using a PSoC for this (32-bit core, Cortex M0), here is an ultra cheap kit: http://www.cypress.com/documentation/development-kitsboards/psoc-4-cy8ckit-049-4xxx-prototyping-kits

    It features a ready made component "FanController" with 4 channels, which allow you to independently control and monitor 4 fans (and I think there can be more of these components put into a design).

     

    Before you start, make sure you know your fans.

     

    Two wire fans: DC brush fans, can be driven at constant voltage and regulated using a PWM (pulsing the power pin). They provide no feedback, however, you can externally monitor the current going through the coil.

    Three wire fans: DC brushless fan, can be regulated using a variable DC voltage. The additional pin is for monitoring the revolutions (provides pulses that can be count). (They have some electronics circuitry inside.)

    Four wire fans: DC brushless fan, need constant voltage, but are provide one pin for driving using PWM (usually 25 kHz) and one pin for monitoring (the "same" as a three wire fan).

     

    If you want to build your own controller, then Arduino and one fan is OK.

    If you want to build something reliable (embedded PID regulation, error handling, etc), go for the PSoC (or similarly powerful MCU).

     

    David

    • Cancel
    • Vote Up +7 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 7 years ago

    Hi Nicolas,

     

    If you want to do it accurately, as David says, you'll need different hardware. According to the link here: How PC Fans Work the three-wire fan uses it's third wire to provide speed feedback (tacho). For something that could perhaps work with the Arduino, you could build a circuit to convert the tacho output into a voltage, and read it via the ADC. A 555 would do it (google '555 monostable' and append an RC integrator to it). But it is effort that may not be needed, if you don't care about the precise speed, and just want to have a slow fan, or a fast fan. It would likely be cheaper and easier to buy the fan controller. Also, I'm not sure it is good to play with fan speeds because I think usually the PC will do that, to keep itself cool, and also to power off if the fan fails.

     

    Anyway if you really do want to control the speed yourself, as mentioned the 4-pin option is easiest, otherwise you could use a MOSFET to chop the power (i.e. use PWM library on the Arduino) to the red and black wires on the 3-wire fan. For an example circuit (there are many ways to do it, this is just one example), see here:

    image

    The recommended part is IRLD120PBFIRLD120PBF.

    • Cancel
    • Vote Up +6 Vote Down
    • Sign in to reply
    • Cancel
  • gdstew
    gdstew over 7 years ago in reply to shabaz

    Tach outputs on fans are open collector transistor pulse outputs (usually one or two pulses per revolution). The only

      circuit they need is a pull up resistor (I used 4.7K on a 6 input fan monitor I built using a AT89c51) to +5V.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 7 years ago in reply to gdstew

    Yeah, I think the issue is with the coding. Sure you can do it, but this is a beginner asking how to do this with Arduino - nothing is impossible to code, even video output with an Arduino! but it's not pretty with the limited resources on the Arduino.

    And furthermore, technically it's not even needed, to meet the actual goal in the question "add some modes like gaming for full speed, office use for lower rpm and less noise". Context is everything.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • gdstew
    gdstew over 7 years ago in reply to shabaz

    "Yeah, I think the issue is with the coding."

     

    The original post is clearly hardware oriented and does not ask about the coding to do it. Your response is also hardware oriented with no mention at all about an issue with coding.

     

     

    "And furthermore, technically it's not even needed, to meet the actual goal in the question "add some modes like gaming for full speed, office use for lower rpm and less noise". Context is everything."

     

    From the original post:

    "Can I control (4 fans) with an Arduino and get feedback from them about the RPM and the voltage if it possible(have it connected with USB on my computer and read the output in Arduino IDE)?

     

    I directly responded to your reply about "extra circuitry needed to provide speed feedback (tacho)" so context was fully observed.

     

     

    As you mention a commercial fan controller is by far the easiest but I do not know if any of them offer a way to do the gaming/office mode selection Nicolas asks about. It would seem like something

    obvious to add to a standard fan controller.

     

     

    "Also, I'm not sure it is good to play with fan speeds because I think usually the PC will do that, to keep itself cool, and also to power off if the fan fails."

     

    As far as I know the only situation normally used to power down a PC is when the CPU overheats which relies on the CPU temperature sensor. Fan failure usually generates an audio alarm via the

    PC speaker and usually displays a fan failure message during boot unless fan monitoring is turned off in BIOS.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 7 years ago in reply to gdstew

    Getting RPM feedback actually isn't the end goal. Why not sometimes actually try to understand the requirement, and form a more complete answer that helps the user? Just an opinion I've formed over the years seeing your replies.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 7 years ago

    While this sounds like a great project, I'm surprised by the application.

     

    Most PC motherboards have fan control built in.

    They require a 3 wire fan (as you have identified), and control the speed according to the PC needs rather than the application.

     

    Most Video card fans are the same, they control the speed to suit the cooling need of the chip.

     

    I recently had a issue with killing hard drives in a box that had speed controlled fans.

    I switched to a Fractal R3 where the drives are across the front just behind the fans.

    Fractal Design

    You can't hear them running and there are zero temperature issues, which is good.

     

    So IMO it is better to allow the motherboard to dictate the speed, rather than the application.

    This will also allow for a speed hike if the heatsinks are getting blocked with dust, etc.

     

     

     

    Mark

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • gdstew
    gdstew over 7 years ago in reply to shabaz

    "Getting RPM feedback actually isn't the end goal"

     

    I never said it was, but it was clearly listed as something that he wanted to do (if possible, and it is) and you spent

    a full paragraph of your response on it. I replied to that response from you simply to point out what the tach output

    actually was and what kind of external circuit was needed to sense it. And for some inexplicable reason you have a

    problem with that.

     

     

    "Why not sometimes actually try to understand the requirement, and form a more complete answer that helps the user?

    Just an opinion I've formed over the years seeing your replies."

     

    Despite your "opinion" otherwise I had no problem understanding the requirements and I'm sure the description of the

    motor tach output did indeed help the user, please notice 4 of 4 people found it useful. Somehow I don't think you

    did. I will withhold any opinions I've formed over the years from your responses (especially to me, see first paragraph

    above) as I don't really see how it is any more relevant than yours is to this discussion.

     

    P.S. the circuit you gave to control the fan motor will not work very well. For many years now PC fans have used

    brushless motors with their own internal motor controller ICs and rapidly turning the voltage to the motor controller

    on and off as would happen with the circuit you gave is in general not a good idea and will almost certainly cause

    the fan motor to "rattle". This was a common complaint with some early commercial fan controllers. If you want

    to PWM a fan that does not have a PWM input you need to integrate the output of the transistor circuit to produce

    a variable the voltage to the motor. This has a limited range as most fan motors will not run below around 5V and

    they may require the full 12V to start. Still it would probably be good enough to fit the requirement given.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • baldengineer
    baldengineer over 7 years ago

    You should be able to do this from the system bus controller itself. For an idea of how to control a PC pan, I have a blog post (on my personal) blog that shows how to PWM a 3-pin PC fan with an Arduino.

     

    Arduino Controllering 3-Pin Fan

     

    If you are serious about doing this yourself, instead of letting SMBUS handle it, this will give you an idea of what is involved. That said, that post was meant to show why you should use a 4-pin fan when you want to control via PWM. (The 4-pin PC fans are designed to be controlled by PWM. 3-pin fans aren't.)

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 7 years ago in reply to gdstew

    What's with the quote-marks around "opinion" : ) I didn't ask you for your formed opinion, nor to withhold it. Open up and release it if you like. It's your choice.

    Here's mine: Gary, you've always had issues. Not just with me, but others who have sadly left over the years too.

     

    Just an example - it's clear what your opinion is/was of your peers here - this was one of your very first interactions on the forum with your peers or inmates at the asylum as you termed them:

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube