Go Down

Topic: PC case fan as air flow meter? (Read 1 time) previous topic - next topic

Hi,

I've done quite a bit of searching but only come up with projects that measure the speed of a running/powered fan.

My project is building a gas flow rig for measuring the airflow through car cylinder heads after porting work has been carried out to ensure equal air flows and any improvements, i intend to use a vacuum cleaner and case fan, connecting the fan to the Arduino to measure the rpm at different valve lifts.  Any advice on if the code for measuring running fans will work if i don't connect the live feed to power the fan.

Thank you

Karl

GoForSmoke

If there is more than one channel that air can flow through, sticking a fan in just one will cause more air to flow down the others. It's parallel resistance, can you find the ohms? Or you could set multiple fans at the same time to balance out the disturbance.

Could you do better with pitot tubes? If you have small dia plastic tubing with one end in a water bucket and the other end crossways in an airstream, you can tell the pressure drop by how high the water raises from the surface of the bucket. Too much drop though and you could empty the bucket.



Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Hi,

I will only be measuring one cylinder at a time. The cylinder head will sit on a
Table with a hole cut in the same diameter as the engine bore. With
PVC piping connected with the fan sealed in the pipe
And the vacuum connected through step down pipes. The table
Will have a rubber seal creating a good air tight seal
With the weight of the head on it. I know the cubic feet per minute of a
Standard inlet and exhaust port so I could match this
To a rpm figure using the hall effect sensor in
a fan, then after porting and some math could work
Out the cf/m gains. Hopefully!

afremont

Depending upon the fan, you might be able to supply 5V thru a pullup to the RPM pulse wire and connect ground to get pulses from the hall sensor when the fan spins.  Try it and see.  Otherwise, you'll have to open it up and make some connections.
Experience, it's what you get when you were expecting something else.

afremont

I hooked up a spare 80mm PC fan I had laying around.  I grounded it and put an LED and resistor between +5V and the RPM pulse pin.  It flashes the LED when I spin the fan, but it doesn't if I turn it slowly so it seems to have a minimum RPM before the hall sensor fires.
Experience, it's what you get when you were expecting something else.

Cheers, I remember having a pc and when it was switch off I used a Hoover to clean dust from the fans, the fans spun up and lit the LEDs in the fans, guessing this is just the motor acting as a genny. I'll try and buy and fan Tonight and see if I can get the arduino to sense the square wave from the hall sensor.

Thanks will let you know how it goes.

afremont

I didn't connect the fan power lead to anything.  Just the hall output and ground.  From the brightness of the flashes, I'd say the hall was firing and not the motor generating electricity, it just seemed to want a minimum speed to fire.
Experience, it's what you get when you were expecting something else.

Cheers that's good news, should be able to use that signal to some effect!

So bought a $7 fan today! Hooked it up to arduino using ground and signal. Found a simple fan controller code and used that to read the signal through the serial output. It works, not sure how accurate it is need to get the fan spinning faster and at a stable speed to determine if it's working. Anyone got any advice on how to get it to display the serial output on to a 20x4 serial LCD?

Thank you

Karl

afremont


So bought a $7 fan today! Hooked it up to arduino using ground and signal. Found a simple fan controller code and used that to read the signal through the serial output. It works, not sure how accurate it is need to get the fan spinning faster and at a stable speed to determine if it's working. Anyone got any advice on how to get it to display the serial output on to a 20x4 serial LCD?

Thank you

Karl


Cool, I can give you some code that will take a signal on P8 and output the period of the waveform in uS.  Calculating RPM is a simple inversion of the period.  My code hijacks Timer1 so you won't be able to use the built in PWM on pins 9 and 10.  I can tell you that it gives very precise measurements since it is captured by the hardware and not some polling loop in software and it doesn't disable interrupts.  It also frees up the foreground so you can do what you like and process the captured time at your convenience.  It sticks that timer readings in a circular buffer that you can easily eliminate if you don't need it.  I added it because I was using this to determine how much switch bounce was occurring on a push-button switch.  I also use it for other timing purposes.

Code: [Select]

#include "Arduino.h"

volatile unsigned t1captured = 0;
volatile unsigned t1capval = 0;
volatile unsigned t1ovfcnt = 0;
volatile unsigned long t1time;
volatile unsigned long t1last = 0;

#define BUFFER_SIZE 32

volatile unsigned long int buffer[BUFFER_SIZE];
volatile int head = 0;
volatile int tail = 0;

void setup() {

  Serial.begin(9600); 

  TCCR1A = 0x0;    // put timer1 in normal mode
  TCCR1B = 0x2;    // change prescaler to divide clock by 8

  // clear any pending capture or overflow interrupts
  TIFR1 = (1<<ICF1) | (1<<TOV1);
  // Enable input capture and overflow interrupts
  TIMSK1 |= (1<<ICIE1) | (1<<TOIE1);
 
  pinMode(8, INPUT);
}

void loop() {

  if(head != tail) {
    head = (head + 1) % BUFFER_SIZE;
    Serial.println(buffer[head]);
  }
 
}

ISR(TIMER1_OVF_vect) {
 
   t1ovfcnt++;              // keep track of overflows

}


ISR(TIMER1_CAPT_vect) {
 
  unsigned long t1temp;

  // combine overflow count with capture value to create 32 bit count
  //  calculate how long it has been since the last capture
  //   stick the result in the global variable t1time in 1uS precision
  t1capval = ICR1;
  t1temp = ((unsigned long)t1ovfcnt << 16) | t1capval;
  t1time = (t1temp - t1last) >> 1;
  t1last = t1temp;
 
  tail = (tail + 1) % BUFFER_SIZE;
  buffer[tail] = t1time;


}

Experience, it's what you get when you were expecting something else.

sam_cqdx

Hi there

Does any body have a diagram for the fan sensor ?

Thanks

Go Up