Arduino Flow Bench 2





I'm using an Arduino Nano as a micro controller to process the 5V signal from a ford Mass Air Flow (MAF) sensor. I have a LCD display that shows the information. This unit is not 100 percent accurate but good enough to show air flow changes as I port something. I do not take into account Barometric pressure and air temperature. These factors would change the real CFM reading as the airs density would change.

I wired a Ford 55mm MAF to an Arduino Nano analog input A0. With this input I can measure the 0-5V signal from the MAF. I use a look up table to get the know CFM measurements for the MAF  I use.

here is the code. Disclaimer: I am not a programmer just a hobbyist.

_________________________________________________________________________________

// include library
#include <LiquidCrystal.h>

// create int for program
int val = 0;
float volt = 0;
int cfm = 0;

//Create lookup tale for Ford Mass Air Sensor
float theArray[52]= {
0.1, 2,
0.6, 7,
0.8, 9,
0.9, 12,
1.1, 16,
1.2, 18,
1.3, 22,
1.5, 26,
1.6, 30,
1.7, 36,
1.8, 40,
1.9, 44,
2.0, 49,
2.2, 59,
2.3, 70,
2.4, 79,
2.6, 90,
2.7, 99,
2.9, 119,
3.1, 145,
3.4, 170,
3.5, 195,
3.9, 245,
4.2, 292,
4.4, 340,
4.8, 410};

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
/*
 * pin1 = gnd
 * pin2 = +5v
 * pin3 = gnd
 * pin4 = rs = pin 2 arduino
 * pin5 = r/w = gnd
 * pin6 = e = pin 3 arduino
 * pin7 = no connection
 * pin8 = no connection
 * pin9 = no connection
 * pin10 = nl connection
 * pin11 = db4 = pin 4 arduino
 * pin12 = db5 = pin 5 arduino
 * pin13 = db6 = pin 6 arduino
 * pin14 = db7 = pin 7 arduino
 * pin15 = ledA = +5v
 * pin16 = ledA = gnd
 *
 *
 *
volts, cfm
*/

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);



void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
}

void loop() {
int  val = analogRead(0);// read analog input

float volt = val * (5.0/1023.0);// convert to voltage
  //print header
  lcd.setCursor(2, 0);
  lcd.print("JOE'S FLOW BENCH");
  //print volts line
  lcd.setCursor(0, 2);
  lcd.print("VOLTS");
  lcd.setCursor(10,2);
  lcd.print(volt);
  //print cfm line
  lcd.setCursor(0, 4);
  lcd.print("CFM");

//create interpolation so we can convert voltage to cfm
for (int x= 0; x<52; x=x+2){
 if (volt >=theArray[x] && volt <=theArray[x+2])
{
   cfm = theArray[x+3] + ( (theArray[x+1] - theArray[x+3]) * ( (volt - theArray[x]) / (theArray[x+2] - theArray[x]) ) );
// temp = base temp + (high temp- base temp) * (Vread - Vbase) / (Vhigh - Vbase)
 }
}

// added this line because cfm would not go to 0 only the lowest value last read
if(volt <= 0.1)
  cfm = 0;
  else
  cfm = cfm;

lcd.setCursor(10, 4);
lcd.print(cfm);
delay(200);
lcd.clear();// clear the LCD screen so numbers disappear and don,t stack up to create false reading

}

I did some flow testing with a leaf blower and found that I could achieve 300 CFM by the meter.

Next post I will test on my intake and see how it will it flows and post the wiring diagram.






Comments