PWM Fan Controller
hi there,
i have 4-pin fan control using pwm on wide range of rpm's arduino use in small wind tunnel . range of speeds i'm interested ranges fan off max fan rpm. in particular, able access lower range of rpm's of fan (if possible go low of rpm such can see blades spinning rather them being blur). have code i've pieced together seems doing trick extent. of relevant technical specs of fan , personal notes listed in code below well. hope notes show i've been doing plenty of research subject prior asking forum.
what i've noticed setup when run fan @ operating voltage of 12v pwm not appear change rpm @ 0% pwm duty cycle. however, when reduce source voltage lower values(i.e 1.00v) can use code turn fan on , off using 0% pwm duty cycle.
i aware of intel pwm fan technical specification sheet http://formfactors.org/developer%5cspecs%5crev1_2_public.pdf
of interest me 3 different types of pwm fan specifications( type a,b, , c). appears pwm fan type need type c, since able still reduce fan speed in linear fashion @ levels below minimum operating rpm , pwm.
my questions are:
1. verify whether arduino code changing rpm of fan change pwm duty cycle?
2. confirm whether hypothesis regarding fan type correct or incorrect? if correct how find fan need? i've googled around , seems manufacturers don't readily include pwm fan type.
3. third pin of fan can used tachometer understanding. can be used in conjunction arduino fan speed reading?
4. there pwm fans can achieve slow rpm's i'm after?
thank time! :]
i have 4-pin fan control using pwm on wide range of rpm's arduino use in small wind tunnel . range of speeds i'm interested ranges fan off max fan rpm. in particular, able access lower range of rpm's of fan (if possible go low of rpm such can see blades spinning rather them being blur). have code i've pieced together seems doing trick extent. of relevant technical specs of fan , personal notes listed in code below well. hope notes show i've been doing plenty of research subject prior asking forum.
what i've noticed setup when run fan @ operating voltage of 12v pwm not appear change rpm @ 0% pwm duty cycle. however, when reduce source voltage lower values(i.e 1.00v) can use code turn fan on , off using 0% pwm duty cycle.
i aware of intel pwm fan technical specification sheet http://formfactors.org/developer%5cspecs%5crev1_2_public.pdf
of interest me 3 different types of pwm fan specifications( type a,b, , c). appears pwm fan type need type c, since able still reduce fan speed in linear fashion @ levels below minimum operating rpm , pwm.
my questions are:
1. verify whether arduino code changing rpm of fan change pwm duty cycle?
2. confirm whether hypothesis regarding fan type correct or incorrect? if correct how find fan need? i've googled around , seems manufacturers don't readily include pwm fan type.
3. third pin of fan can used tachometer understanding. can be used in conjunction arduino fan speed reading?
4. there pwm fans can achieve slow rpm's i'm after?
thank time! :]
code: [select]
/*
purpose: control pwm of noctua nf-a8 pwm fan via user input achieve low fan speeds
fan properties:
pwm fan pin specifications:
pin id pin color pin purpose
1 black gnd
2 yellow 5v
3 green tachometer
4 blue pwm
general pwm fan specs:
operating voltage: 12 v
current 0.08 a
rpm range: 2200 rpm (max)
1750 rpm (max when using low noise adpater)
450 rpm (stall speed)
pwm frequency range: 21-28 khz
target pwm frequency: 25 khz
arduino pwm notes:
timer output arduino output chip pin pin name base frequency(hz) divisors available
oc0a 6 12 pd6 62500 1,8,64,256,1024
oc0b 5 11 pd5 62500 1,8,64,256,1024
oc1a 9 15 pb1 31250 1,8,64,256,1024
oc1b 10 16 pb2 31250 1,8,64,256,1024
oc2a 11 17 pb3 31250 1,8,32,64,128,256,1024
oc2b 3 5 pd3 31250 1,8,32,64,128,256,1024
instructions:
1.power arduino via usb connection
2.connect fan gnd psu , arduino gnd psu(i.e. common ground)
3.connect fan 5v directly arduino 5v
4.connect fan tach directly arduino digitalpin tx->1
5.connect fan pwm directly arduino digitalpin 3
6.upload code onto arduino uno board
7.open serial monitor
8.type in "pwm" quotations onto serial monitor
9.enter integer value between 0-255 regulate value of pwm (0 off , 255 max)
10. repeat step 9 needed
*/
// variable declarations
string command;
char werd;
int currentfan = 0;
int pwmpin = 3;
int pwmpinspeed = 0;
int commandcheck;
void setup() {
// fans
pinmode(3, output);//pwm pin
tccr2a = 0x23;
tccr2b = 0x09; // select clock
ocr2a = 79; // aiming 25khz
ocr2b = 62;
analogwrite(3,0);
serial.begin(9600);
serial.println();
}
void loop(){
ocr2b = 62;
delay(1000);
ocr2b = 120;
delay(1000);
// reads serial commands
while ( serial.available() > 0 ) {
// small delay because can deliver bytes quickly
delay(5);
// have read 1 byte (one character) @ time
werd = serial.read();
// append character "command" string
command += werd;
}
// clear serial it's ready next command
serial.flush();
if ( command.length() > 0 ) {
commandcheck = 0;
if ( command == "pwm" ) {
currentfan = 0;
}
else {
commandcheck = 1;
}
if ( commandcheck == 1 ) {
// ".toint()" appended command variable converts "command" string onto integer used regulate pwm
if ( currentfan == 0 ) {
//front
analogwrite(pwmpin, command.toint());
pwmpinspeed = command.toint();
}
else {
//unknown command
}
}
command = "";
serial.print(pwmpin);
serial.print("fan speed: ");
serial.println(pwmpinspeed);
clear();
}
}
void clear() {
serial.println();
}
[\code]
you unlikely see fan goes below 30%rpm when pwm zero. in event do, find doesn't operate @ levels.
0%rpm unusual requirement. last 20% going flow unmeasurable amount of air fans.
0%rpm unusual requirement. last 20% going flow unmeasurable amount of air fans.
Arduino Forum > Using Arduino > Project Guidance > PWM Fan Controller
arduino
Comments
Post a Comment