Heat production varies with system load, where periods of compute-intensive activity generate much more heat than the idle time does. Computers emit this electrical power as heat generated by all major components. Need for fan control Īs modern PCs grow more powerful so do their requirements for electrical power. This is commonly accomplished by the motherboards having hardware monitoring circuitry, which can be configured by the end-user through BIOS or other software to perform fan control. In computers, various types of computer fans are used to provide adequate cooling, and different fan control mechanisms balance their cooling capacities and noise they generate. At the top of the case is a fan controller.įan control is the management of the rotational speed of an electric fan. Thanks to Edgar Bonet from stackexchange for 25kHz timer piece of code.Management of the rotational speed of a computer fan Full-tower computer cases may contain multiple cooling fans. map it to the range of the analog out: Output value should be between 0 and 320, inclusive. PWM output 25 kHz, only on pins 9 and 10. TCCR1A = _BV(COM1A1) // non-inverted PWM on ch. TCCR1A = 0 // undo the configuration done by. ![]() Int outputValue = 0 // value output to the PWM (analog out) Int sensorValue = 0 // value read from the pot ![]() const int analogInPin = A0 // Analog input pin that the potentiometer is attached to Arduino Uno and similar boards have only one 16-bit timer, that’s why only 2 outputs are available. This code is for ATmega168 or ATmega328 16 MHz. 10K is not needed on most of arduino boards, but it will ensure best mosfet operation. 150 ohm resistor can be omitted but it’s there to protect the mosfet. High PWM frequency will ensure quiet operation. The same PWM signal used to control 4-pin fans can be used to drive the mosfet and control 3-pin fan instead. ![]() To simplify the circuit even further, variable resistor can be omitted and PWM value 160 hardcoded in the code and the fan will run on 50% duty cycle. Potentiometer can be replaced for thermistor or any other temperature sensor, as long as sensor output is converted to 0 – 320 range.Įxample of map function converting 0 – 1023 sensor values to 0 – 320: outputValue = map(sensorValue, 0, 1023, 0, 320) Arduino pin D10 is connected to PWM pin on 4-pin pc fan connector. Fan is connected directly to 12V and GND from power supply, no mosfet is needed for 4-pin fans. Cheapest Arduino Pro Mini ATmega168 (5V, 16Mhz) can handle it.Ĭontrolling the speed of 4-pin fan is very simple. I used this circuit to control 2 groups of fans with different speeds, 4-pin fan connected to pin D9 and mosfet with 3-pin fans on pin D10. Arduino Uno or Arduino Pro Mini can generate 2 different PWM signals on pins D9 and D10. 3-pin circuit needs additional N-channel mosfet or some switching transistor. ![]() PWM frequency is 25 kHz, much higher than default timer frequency and the PWM speed control will be completely silent.Ĭode is the same for both type of fans. If you tried analogWrite() function with mosfet to generate PWM signal and the pc fans made weird sounds and beeps, than this code will solve the problem. Tested with Noctua 120mm, Noctua 140mm PWM, NZXT and Artic Cooling. Circuit will allow RPM control on any 12V pc fans. You can change the fan speed from off to max speed. How to make simple 3-pin and 4-pin PWM pc fan speed control with Arduino.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |