AFM (Air Flow Meter) to MAF (Mass Air Flow)  conversion

Introduction - The components - Calibration - Air temperature compensation - The electronics - C code - On the car - Driving with the conversion - Want one? - Links - Thanks

Introduction

After the MAP conversion idea was shelved it was time to move on...there are two main stream air flow sensor technologies left to try, hot-wire and hot-film (mylar), both work on similar principles but the hot-film has the advantage of not needing any maintenance (the burning of the wire to remove deposits).   The hot-film MAF I used was from a Omega B C30XE MV6 engine, it should be able to flow a fair bit more air. Neglecting the MAF sensor itself the device is a cylinder with an internal diameter of 70.0mm. The cross sectional area is thus 3849mm2. The cross-sectional area of the AFM is 2925mm2 (45.0mm x 65.0mm). 

 

So that's an 24% increase in cross sectional area, so hopefully more air at WOT and so more fuel at WOT will equal more power at WOT! Although to be honest the main reason I want to do this conversion is for a hopefully sharper throttle response and it also looked like an interesting project to spend some time on.

 

The components

afm.jpg (37294 bytes) maf.jpg (18950 bytes)

AFM shown on left, MAF on right.

MAF terminals

Ter. 1 GND

Ter. 2 Signal GND 

Ter. 3 12V (this is routed via the injector relay in the original application) 

Ter. 4 MAF Signal

 

AFM terminals

Ter. 1 Intake air temperature Signal 

Ter. 2 AFM Signal 

Ter. 3 5V from ECU 

Ter. 4 GND   

 

 

 

Connectors for both types of unit are available from Tuneparts.

The standard AFM  needs just a 5.0v supply. This is applied to one end of the potentiometer (the other being connected to signal GND). This supply also serves the air temperature sensor (a NTC thermistor).

The range of output voltages produced by the AFM is 0.25 to 4.50v.

 

The MAF requires a 12V supply and GND for (I presume) the heating of the film and associated amplifier electronics. The signal and a separate signal GND is supplied on the two other pins, the signal is between 0v to 4.50v.

 

The plan was to convert output of the MAF to simulate the output of the AFM for the same air-flow.

The device chosen for the conversion was the humble Microchip PIC (you may have gathered by now I quite like them!). The design specification was quite simple and is outlined in detail below but basically the plan was;

 

Take the signal from the MAF into the 10-bit ADC of the PIC, use a look up table to convert this voltage to the voltage which the AFM would be outputting at the same air-flow rate, add compensation for air-temperature as read by the air-temperature sensor. 

 

What about that air temperature sensor? Due to the complete lack of information and datasheets on the AFM or the MAF response curves I have little idea as to the effect of the temperature sensor on the air flow calculation carried out by the ECU. I do know that the air temperature sensor is also used for ignition purposes so it will be left in the airflow. Interestingly on the original application for the MAF  (the Omega V6 engine) a intake air temperature is also included which is redundant in measuring air mass so I assume this is used for ignition calculations only.

 

I may need to connect the air temperature sensor into the PIC to compensate the look-up table for temperature in the future so a high impedance input has been included into the design and so can be implemented easily with a software change.

 

Calibration

The best way to determine the relationship curve between the AFM and MAF would be to hook them up to the car simultaneously and data-log the two signals. Unfortunately the space under the bonnet doesn't allow this to easily be achieved. So I decided to try it in our living room while the wife was at work!

First job was to hook up the two sensors with a length of ducting (I used a spare OE air intake hose). For an air supply I used a electric leaf blower borrowed from my boss! This was used in suck mode to bring air past the AFM, through the MAF and into the leaf blower. A car battery was used a source of 12V for the MAF. A 9v PP3 was dropped down to 5V for the AFM by using a standard 7805. A Picoscope data logger/oscilloscope was used to log the voltages with respect to time.

The leaf blower just wasn't man enough to get the AFM to full scale! I managed about 75% full deflection. The airflow rate 'v' signal is nearly linear and I would need a hell of a lot more air to fully calibrate the units on the bench! But I think I recorded enough data to extrapolate the full curve. I fitted a polynomial to the data and a calibration table was deduced converting ADC counts into DAC counts, producing the curve shown below:

 

curve.JPG (32517 bytes)

Conversion curve*

 

The curve is hard coded into program memory of the PIC.

*-Just to keep you on your toes, this curve is in fact incorrect! The axes are swapped, MAF should be AFM and vice a versa, the engine does not like running with this curve, it gets a little bit too much fuel! I've left it like this to remind me how stupid I am not to have noticed it earlier, for those copying this curve remember to swap the middle section around!

 

Air temperature compensation

Currently the original air temperature sensor is just poked into the air stream and connected into the original loom socket. Eventually a new air-temperature sensor will be utilised. I've measured the Bosch unit  used on early Omegas and this has the same temperature response and relatively cheap. It's looks very rugged and I will be using it for this conversion.

 

The electronics

It was decided to power the PIC from the switched 12V supply to the ECU, so it's only powered when the ECU is! Using the 12V supply (as opposed to the 5v supply output by the ECU) allows the use of a dedicated 4.5v precision reference which is used for both the 10bit A/D and D/A circuits.

A low drop-out version of the 7805 is used for the 5V supply to the PIC (PIC16F873). There are also protection diodes and high quality smoothing capacitors to try and tame the harsh power supplies found in automotive environments. An 8v voltage regulator is used to run the op-amp and a second voltage reference IC (4.5v). The two analogue inputs are also diode protected and take signals from the new MAF and piggy back onto the current air temperature sensor, both inputs are high impendence, buffered by a quality op-amp.

The MAF output then goes to pin AN0, the air temperature sensor goes to pin AN1. Vref (4.5v) goes to AN3 (set in software to be used as the reference voltage for the ADC module).

The voltage output to the ECU is provided by a high quality 10bit  DAC (AD7390) connected to the PIC via an SPI interface, this IC also contains a op-amp buffer whose output goes straight to the Motronic (no need for additional buffering). I've used it on a number of projects and it can't be beaten for stability it is highly resistant to lock up, you can also drop in a AD7391 for 12bit resolution.

Connections to the outside world are via a filtered D9 plug, this brings the signals in and out and power into the device.

An LED is used to indicate the status of the device (99% of the time it will be hidden out of sight). The LED is used to signify that the power is applied to the unit (the PIC is powered) and the current conversion voltage applied to the Motronic (rate of flash!). I have resisted the temptation to include LED bar graphs and the like to keep the PIC code as fast and concise as possible and also to keep costs down.

The schematic and PCB design was drawn/laid out in Protel and sent to PCB-pool for manufacture.

 

angle.jpg (26987 bytes) pcb.jpg (37651 bytes)

The populated PCB, designed to fit into a die-cast box, and used with a locking 9way D connector.

 

box1.jpg (27230 bytes) box2.jpg (41237 bytes)

 

The finished prototype, locking connector and flashing LED!

 

C code

The code was written in C using the CCS compiler. I am keeping this under my hat for the moment while I decide what to do with the unit. I think you need at least a years worth of good running to test the durability of the kit anyway. I also want to correctly utilise the air temperature reading. There is scope for optimising the look up curve/table as well, it's very sensitive, especially with the engine running in open-loop fuel mode. All the development was done on the bench where it worked perfectly! However, on the car, it was found that some noise filtering was needed, both in hardware via a low pass filter on the inputs of the op-amps (a 1k resistor was already there so a 100nF cap was taken to ground just after it) and software; the program was re-written to take ADC readings on a 300us interrupt and the DAC routine called by a 2ms interrupt which averages the last 8 ADC readings and outputs the value to the DAC. This did the job, in fact I was amazed how good the 10bit ADC was behaving, true +/-1bit resolution.

 

On the car

The other problem to overcome was how to plumb the system into the car! It was decided that the easiest way was to keep the existing large air hose before the throttle body and position the MAF in roughly the same position as the original AFM. This just left the problem of how to filter the air. The common way is to use a simple bolt on filter, however the Carlton runs quite high under bonnet temperatures and I didn't want to ruin any gain in air flow with a hotter air intake. There is already a cold air feed from the front bumper (which originally fed pretty close to the air-box input pipe) I wanted to install the new filter so this air intake would blow over the it. K and N do a range of universal filters. 

The idea was the MAF and filter would be connected with a length of 80mm diameter hose held snugly with jubilee clips.

I thought about getting a heat shield made to try and shield the filter from heat. Another problem with these types of filter is the noise, open K&N's are a lot more noisy than the standard air box.

 

To K&N or not to K&N that is the question

Searching about these conversions on the web brought up the question of K&N, MAF sensors and the "alleged" oil contamination problem (see links). You've just bought a very expensive, delicate, heated mylar film to measure the air flow into your engine do you want oil mist contaminating it? .  I thought again and went back to the paper filter in the standard air-box. I have always run a K&N or a ITG filter element in the box when I had the standard AFM on the car, but there was no delicate sensor to damage. So modify the standard air-box it was. This has the added benefit (or disadvantage if you are that way inclined) or subduing induction roar. I like a nice quiet engine! Richard knocked me up (understatement as it took a lot of time and skill) a fantastic bolt on plate and clamp for the top of the standard air filter box, made from laser cut steel sheet and a welder! The box itself is also modified  modified to accommodate the larger pipe as you can see below.

 

filterboxbits.jpg (30793 bytes) filterbox.jpg (44026 bytes)

The modified air box assembly.

 

Wiring

The new electronics box wires into the main loom just before the Motronic ECU under the drivers kick panel. The fuel pump relay is also located here so this is also where the power feed for the MAF is picked up. The input to the ECU for the AFM is now connected to the output of the MAF controller. A 'scotchlok' is connected to the air temperature wire and connected to the air temperature input of the controller. The MAF signal is wired via a new run of screened cable. 12v and GND is also 'scotchlok' out of the ECU loom to power the MAF controller.

 

ECU map modification

To compensate for the increase air-flow at WOT the ECU WOT fuel maps have had to be increased to maintain around 12:1 air/fuel ratio (see the Lambda meter pages), so a result here!

 

Driving with the conversion

It's too early to report what it's like to drive as the maps are still being optimised and I only get one cold start a day! But initial feel is fantastic, the throttle response is snappier, and fuel consumption is slightly up. One thing that is improved is throttle response at more than 50% open, before all the response was limited to the first 50% throttle travel, pushing harder didn't used to accelerate much faster!

 

Rolling road tune

What this space, ECU maps and the AFM/MAF look-up table to optimise!

 

Want one?

A kit of parts may be available depending on demand; drop an email to maf@carlton24v.co.uk with your details.

 

Version 2.0

I've had a lot of emails wanting this conversion, but it just wasn't perfected enough to release it! Version 2.0 is now in testing. I was not able to find a supply of a suitable ATS with the same characteristics to that of the one contained in the old AFM, so the new version had to use a different sensot. It uses a new ATS which is fitted to the later Vauxhall/Opel cars, unfortunately this is a different type and needs a look up table to convert its reading to the old type. Features:

 

2 channel 10bit DAC, 0 to 4.5volts out:

This allows both a AFM and a ATS signal to be presented to the ECU, completely under the control of the unit.

2 channel 10bit ADC, 0 to 4.5volts in:

This allows a signal to be read from the MAF sensor and the new ATS

5v ATS feed:

Allows 5v to be fed to the new ATS

Switch Output:

This is peculiar to the M1.5 system. To make the system run in open-loop mode you can ground an ECU pin. This output is under PIC control and allows the switching of the M1.5 to open loop under certain conditions (currently an un-implemented feature). This pin is connected to GND via a small reed-relay.

12v Input:

This is connected to a switched ignition 12v supply.

12v Output:

This is used to power the internal MAF circuits, it is connected to the 12v Input above.

Communications link:

Provision for two way communication with the unit have been incorporated in the hardware, this will allow diagnostic and programming functions at a later date.

Dual LED output:

Slow flashing green LED signified power, flashing red LED whos rate changes with MAF signal.

Connector

To accommodate the additional connections a HD D socket is now used.

 

 

Wiring

All wiring is done around the ECU area. A separate loom is used to connect to the new components under the engine bay. A screened cable is used to return the MAF signal, a 12v supply and GND are also required by the MAF. The new ATS has a 5v feed and a return. I enclosed this small new loom in a 'Helagaine' braided sleeve.

The AFM wire is found and broken and two bullet connectors added. The ATS wire is coloured XXXX and also split and two bullet connectors crimped in place. the GND feed (thick brown wire) is shocklocked off the loom and connected to the unit. The 12V feed (thick black wire) is also hooked up. This approach allows the car to be very quickly returned to standard state, only two wires need to be swapped over and the old AFM/ATS assembly re-installed.

 

A way to inserting the new AFM into the air path was required. As luck would have it the old Vauxhall Cavalier (Vectra A to you Europeans!) used a small section of straight rubber hose with the correct fitting it in (the Vectra B and Omega B have curved hoses). This works perfectly and makes the conversion look very professional.

Number 16: Connector, p/n 90448743

Number 15: ATS, p/n 90442182

 

Software

The new ATS is read every second and the value converted to the equlivent voltage given by the old sensor. The MAF sensor is sampled every 100ms and the same conversion as used in Version 1 is applied. Currently no air temperature conversion is carried out on the MAF signal. Likewise the M1.5 open-loop facility switch is not yet implemented.

 

Links

http://www.bmwe34.net/E34main/Upgrade/Air_filter.htm

From the BMW E34 owners website, advice from Jim Conforti

 

 

http://www.knfilters.com/faq.htm#6

From the K&N website, no problem with oil found.

 

 

http://www.picotech.co.uk  

Picoscope PC oscilloscopes.

 

 

http://www.tuneparts.co.uk

HGL motors internet sales site (4 pin connector for MAF sensor and two pin for ATS).

 

 

http://www.samco.co.uk

Silicon hose manufactures, used for the non-ATS equiped version.

 

 

http://www.itg.co.uk

http://www.knfilters.com

Air filter manufactures. Two good established manufactures. Do you use them with a MAF?

 

 

http://www.microchip.com

The heart of the unit. PIC controller manufacturer.  

 

 

http://www.ccsinfo.com  

PIC C compiler.

 

 

http://www.protel.com  

Schematics and PCB software.

 

 

http://www.pcbtrain.co.uk

PCB manufacture, cheap and very high quality PCB's.

 

 

http://www.senator24v.co.uk

Richard Brunt's site, Stainless steel bits for Vauxhall straight six 24v cars.

 

 

http://www.demon-tweeks.co.uk

Supplier of Samco hoses.

 

 

http://home.golden.net/~trinity/massair/massair.htm

Someone who has had a go at the same thing with their Ford Probe (and gave me inspiration!)

 

http://forums.bimmerforums.com/forum/showthread.php?s=&postid=2051144#post2051144

Someone who has done this on their BMW

 

Thanks  

Big thanks for Jonathan for supply the MAF filter from his 3.0l V6 Vauxhall Omega, it was used for all the development work and is still working well, and again thanks to Richard Brunt for his encouragement and stainless steel wonders. Thanks also to all the Autobahnstormer members who has helped with ideas as well (Dave, Malcolm and Steve spring to mind).