Close

Using the Meter to calibrate automotive MAF

A project log for Open Source Spirometer using ESP32

An open source standalone spirometer (measures tidal volume) made using Olimex ESP32-POE-ISO and Sensirion SFM3300 Flow Sensor.

patrickPatrick 04/21/2020 at 02:340 Comments

Seeing that the Sensirion meters have disappeared from stock and gone into long-leadtime mode, as expected, we had a parallel effort to develop flow meters using other sensors.

Steve Glow stated working on a venturi design, check out his work here

Thomas Hydronics started working on an automotive MAF, check out his work here

Thomas sent me a couple of his sensors for test. The initial thought was to use the Sensirion sensor to calibrate the MAF.  That's what this update is all about.

Here is the test setup: BK Precision Power Supply driving an Ametek Microjammer Blower, MAF connected to Thomas's PCBA, inline with my ESP32 Sensirion SFM3300 meter, reading out average flow in SLM, voltage being read by Siglent SDS1104X-E Scope.

The blower struggles under 4V, so I used a 3way valve to get readings below 30SLM. The MAF also outputs more than 3.3V, so for measurements, I removed the sensor output wire from the PCB and just connected it to the scope. 

The ESP code was streaming 2 flow values, one heavily averaged over 1000 readings, the other was latest  sensor value (updated to the serial port every 200ms) , and the time in microseconds. 

I used the web connection to the scope to read the voltage. I was getting a bunch of noise on the analog output, so I took the Mean[1] reading from the scope as my voltage reading.

Then I proceeded to adjust the voltage on the power supply until I hit the desired flow rates, and recorded the voltages. This resulted in this table and XY plot in excel. There are a few bumps in the data, which is due to the airflow data being a bit jumpy and noise on the analog output. 

Next I flipped the axis, as I want to calculate the flowrate based on voltage. Here, I found a 5th order polynomial that fit the data with a standard error of 1.945 SLM. 

Since the ADC has a range of 0 - 3.3V, (12 bits) and the sensor has a range of .96V to 4.15V (at one point I observed 4.15 V when overvolting the blower at 244SLM).  

The sensor will require some signal conditioning if we want to be able to sense the full range and make use of all the available bits on the ADC. This can be accomplished with a .9V analog level shifter, something like this: 

Being that the ADC can only handle up to 3.3V, I extracted a data set from 0-3.33, converted voltages to ADC values and then curve fit that.

This resulted in a much cleaner polynomial with a standard error of 1.063 SLM. 

int SLM = constrain(10.164294 - .021739655 * flowSensorValue + 1.0683699E-5 * sq(flowSensorValue),0,100);

Discussions