- Unacceptable curve deviation, consequentially inaccurate air mass measurement:
- Increase of fuel consumption up to 20%
- Bad engine characteristic (driveability), loss of power/torque
- Danger of engine damages, due to thermal and mechanical overload (full load)
- Danger of exhaust system damages (catalytic converter)
- Increase of pollutant emissions, violation of emission standards, higher particulate emissions (Diesel), smoke emitting (full load)
All this can happen with my and your engine due to Bosch reproductions! After it will happen you can order another one and another … But I choose another way: MAF tuning.
I started my project in search of mass air-flow meter not manufactured by Bosch to avoid falsification and I found Siemens/VDO 5WK9 635 (HFM62C/11) or 20.3855.
This sensor doesn’t afraid fo engine oil or dirty filters because it’s sensitive element has another principle that’s why I choose it!
I found on Russian website information about replacement Bosch HFM5 sensor to Siemens for their vehicles. All needed to be done in my project is to convert Siemens MAF values into Bosch HFM5 values and send them to ECU (BMS46 in my case). I don’t want to do this by coding and flashing my ECU, I want to develop MAF value converter as standalone unit.
Let’s start with datasheet for Bosch HFM5 sensor. In the document we can find a table “Output voltage UA = f(Qm) of the air-mass meter“:
We have only eight points! It’s not enough to build whole curve, we need at least 256 points. We can only guess about exponential dependence of curve #1. On the web I found perfect application CurveExpert Professional which can find the equation for our MAF dependence. First, we have to load data into CurveExpert Professional:
X axis – liters per hour; Y axis – voltages. Then go to the Tools->Curve finder and uncheck all check boxes except Built-in non linear regressions and press OK. Application will find many equations for our data, we need only first in the left list
Equation helps us to approximate our curve with error equal 0.005852 volts. Here is our curve:
Then we need to do the same steps for Siemens MAF sensor. I found datasheet for Siemens/VDO HFM62C/11 only in Russian . All we need in this document is only voltage/mass dependence, it looks like Bosch HFM5 table:
In this case X axis – voltages and Y axis – air mass because we need expression Vb(Ms(Vs)), where:
- Vb – voltages on Bosch HFM5 sensor
- Ms – air mass on Siemens HFM62C/11 sensor
- Vs – voltages on Siemens HFM62C/11 sensor
After same steps as done above for Bosch we get approximation equation for Siemens:
The next step in MAF tuning is replacement table calculation using above two equations. I have an evaluation board with C8051 core CPU with 8-bit ADC (Analog to Digital Converter) and 12-bit DAC (Digital to Analog Converter) and 3.3 V power supply and 2.5 V reference supply for DAC and ADC. Siemens output voltages is from 0 to 5 V that’s why we need to put resistive divider with ratio equal two before ADC. Now we have to compute input Anti-aliasing filter. To do this we need to know MAF values frequency range. For example: my engine has 4 cylinders and 6000 crankshaft rpm. 6000 is equal 100 Hz, two valves opens and closes per revolution, it means 100*2=200 Hz – maximum frequency for my engine. So, to make input filter I use FilterLab application from Microchip. After I loaded data into the application, I got ready input filter circuit:
Output filter is computed with same tool and data, but only one difference we have for output filter: we must use multiplication to 2 due to divider above. Our output signal must be in range 0-5 V and our reference source is 2.5 V that’s why multiplication factor is 2 (2*2.5=5).
Here is the output filter circuit:
Each value in replacement table has equation:
(Vb/divider)/((5V/divider)/256) – 0.5/((5V/divider)/256) where:
- Vb – equation for Bosch(Ms)
- Ms – equation for Siemens(Vs)
- Vs – voltages form Siemens ->ADC with step equal 0.0095703125 V (2,5/256 = 0.0095703125)
- 256 – 8-bit ADC (2^8)
MAF tuning (homemade PCB for prototype)
Today I made measurement stand for Bosch and Siemens sensors:
It looks like BFG As you see it consists of two MAF sensors (on the left there is Bosch HFM5 sensor and on the right there is Siemens 20.3855 sensor). My vacuum cleaner with operated air draft makes up to 60 kg per hour of air. First measurement results are not what I expected ! Bosch output and converter output values are not same! Even if I make measurement without converter part they are different. OK, I set vacuum cleaner airstream intensity such that I measure 1.80 V on Siemens output. It means that air mass equal 41.31 kg/h (Siemens datasheet). Then I measure Bosch output and I see 2.1 V. This voltages is less than 30 kg/h. It confuses me. I don’t understand anything. Here are results:
On the left column there are Bosch values, in the middle – converter and on the right there are differences between Bosch and converter output.
Bingo! I think I understand reason of my fail. I have a replacement part for Bosch MAF sensor, not stock (BMW 13 62 1 433 565) and it’s curve is NOT curve #1 in HFM5 datasheet. I recalculated another replacement table for curve #2 and it works fine! I see the same output values from Bosch HFM5 sensor and my converter. IT WORKS!!! Here is curve #2:
kg/h curve #1 curve #2
8 1.4837 1.239
10 1.5819 1.3644
15 1.7898 1.5241
30 2.2739 1.8748
60 2.8868 2.371
120 3.6255 2.9998
250 4.4727 3.7494
370 4.9406 4.1695
Now I’m sure it works fine. Curve #2 is for part number Bosch 0 280 218 019 and for 0 280 218 037 too. Here are the results. Difference is 0.01 – 0.02 volts due to approximation error 0,016960 volts.
I don’t understand one thing: during measurements I see that Bosch 0 280 218 037 is equal to curve #2 (0 280 218 019). This part numbers differs only in last numbers 037 and 019. Official replacement part for BMW 13 62 1 433 565 is Bosch 0 280 217 124 and part number with curve #1 is 0 280 217 123. They also differs only in last numbers! But my engine works fine with 0 280 218 037. Maybe curve #1 is what I’m looking for? I’ll test it on my vehicle soon.
Filter prototype board and HFM5 connector:
Today everything been installed into my vehicle. It’s quite easy to do wiring in the DME box. Here is picture:
Siemens MAF sensor is shorter than Bosch HFM5 and I need to do something with that . My converter evaluation board will be next to the MAF sensor in this installation. It looks funny.
Here is video how my engine (M43TU) works with Siemens MAF sensor and converter.
Wow! Test drive gives better results than I expected! It seems like my converter works better with curve #2 than Bosch 0 280 218 037. The car runs perfect, idle is stable, at full throttle there is no feeling like passing another car on an uphill.
Curve #1 gives me the worst results. The idle drop down to around 300 rpms then back to a 1K rpms then settle and the car stalls every once in a while . I applied adaptations reset in INPA but it doesn’t help, curve #1 still works bad.
In two days I tested some replacement tables made of curves from HFM5 datasheet. It’s hard to say what curve is the best. Red curve in the picture is good enough for me, but I keep testing.
Red curve gives me very good results over 3000 rpms. My engine works very smooth at idle with this curve. Vehicle responds much better than Bosch 0 280 218 037 sensor. The engine performance is really better!
So, I decided to make final schematic of MAF TO MAF converter. I choose STM32F1xx as CPU. It’s very cheap, about $3 and powerful enough for this project. It has ARM Cortex M3 core, 12-bit DAC, 12-bit ADC and runs up to 72 MHz. This microcontroller doesn’t have 2.5 V reference source for DAC and ADC and we need to recalculate our replacement tables for 3.3 V source. I added jumpers into the schematic, they allow to select which replacement table use on start. There are up to 16 tables may be hardcoded into the converter memory! Schematic and PCB design made with DipTrace CAD software.
PCB top and bottom
How it has to look:
Here is homemade PCB for converter final version.
All I need is to rewrite my code and recalculate replacement tables.
First converter release is finished. It soldered at homemade PCB and tested with BFG test stand.
I know, you want to ask me how to make replacement table. To do this I have LibreOffice Calc document and all calculations were done there. Let’s have a look at the part of this document:
The red circle is parameters set which CurveExpert Proffesional gives us as result. We can change manually that four parameters (a, t, n, k) and resulting curve will change too. Zero based DAC column is our replacement table in HEX. It will change too with parameters changing. You should copy this column into array and include it into your software. The red oval on the left is converter output voltages at control points of air mass.
Resulting curve is dashed red line on the chart:
I used silicon sealant to cover converter board and protect it.
And in the car:
I’m sure, this project is able to replace not only HFM5 type MAF sensors, it can replace all MAF sensors with known curve characteristics.
Soon I’ll add some features into the project:
- It will be able to make visual configuration of the replacement table and load it into converter in runtime from the laptop or Android device via Bluetooth.
- Oxygen sensor monitoring will be added. I think it is very interesting to monitor current fuel/air ratio.
Now go to my download page and make your car life better with MAF2MAF converter!