Super Street Network

Due to the EU’s Global Data Protection Regulation, our website is currently unavailable to visitors from most European countries. We apologize for this inconvenience and encourage you to visit for the latest on new cars, car reviews and news, concept cars and auto show coverage, awards and much more.MOTORTREND.COM
 |   |   |  Project Miata Generation I: Part VII
Subscribe to the Free

Project Miata Generation I: Part VII

Advanced Engine Management

Sep 16, 2003
0310_01z+1995_mazda_miata_convertible+front_left Photo 1/9   |   Project Miata Generation I: Part VII

It's been a long time since you've seen Project Miata. There's a string of logic longer than this story explaining why it's been several years since this car's last appearance. We'll spare you the gory details.

For those of you who missed out on the first six installments on this project car, you should know that it's using an FMII turbo kit and until now has been running on a Link ECU. It's also got loads of other mods, including GAB shocks, Flying Miata springs, SSR wheels, Falken Azenis Sport tires and an HKS exhaust.

0310scc_projectmiata02_z Photo 2/9   |   The AEM ECU mounts in the same location as the stock ECU with heavy-duty Velcro. The ballast resistors, which were wired in with the Link ECU, were attached to the ECU with Velcro as well.

We've been waiting for AEM's Engine Management System to go into production and for the Miata-specific application to become available. That happened last February and our car has been running on it since. In the last six months, we've refined our calibration with help from the EMS engineers at AEM and sorted the specific details of installing EMS in a turbo Miata.

This month, we'll focus on the basics of installing the EMS in the car and getting it to start on the base calibration. AEM's version 1.0 software is only just being released as we go to press, so we haven't yet tried it on the Miata. We're told it should dramatically simplify the setup and configuration necessary for this application. With luck, we'll report on it soon.

0310scc_projectmiata03_z Photo 3/9   |   We mounted AEM's 2.0-bar MAP sensor to the firewall with an adell clamp. The MAP sensor is wired using the stock MAF harness for ground and signal. This eliminates running extra wires to the ECU. Power comes from the throttle position sensor through the red wire on the left.

AEM touts its EMS as a complete plug-and-play system, which means the time and effort usually associated with wiring in a stand-alone ECU should be virtually eliminated. The EMS ECU replaces the stock ECU and relies on stock sensors and actuators to control all engine parameters. In the world of stand-alone engine management, AEM's EMS should be as easy as it gets.

However, because our Miata is turbocharged, there was some relatively simple rewiring involved. Additionally, because of wiring differences between 1995 and other first-generation Miatas, the specifics given here aren't accurate in every detail for any other model years.

However, the methodology still applies. Following these fundamentals with the specifics from your 1.8-liter first-generation Miata will produce a running car.

0310scc_projectmiata04_z Photo 4/9   |   The GM boost control solenoid and mounts in the same location as the Denso unit used with the Link ECU. Wiring is also the same, utilizing the "B+" and "TEN" terminals in the diagnostic port.

First, we had to replace the ECU. This operation was easy as the ECU in our Miata (a 1995 model) is located behind the passenger seat. The EMS unit is designed to drive the stock high-impedance injectors, but we were already running low-impedance 550 cc/min injectors from RC Engineering. Luckily, the Link ECU we were using before was also designed for high-impedance injectors, so we already had ballast resistors wired into the injector harness to adapt the signal. We left the resistors and wiring as before and simply plugged the EMS ECU into our stock harness. The ECU was attached to the rear shelf with the supplied Velcro and the harness plugs in the same as stock.

0310scc_projectmiata05_z Photo 5/9   |   The UEGO controller can be mounted to any flat surface that is reasonably dry and away from extreme heat. We chose the passenger side of the firewall. The UEGO is wired into the Miata's ECU using only three wires (power, ground and signal).

The stock Miata engine management uses a Mass Airflow Sensor (MAF), but we had already discarded the stock MAF because it couldn't read the much-higher flow rates our turbo produced and would be very restrictive at high flow as well. Instead, we had been using a Manifold Air Pressure sensor and letting the Link ECU calculate air flow. The AEM EMS can be set up either way. To keep wiring as simple as possible, we rewired the stock MAF sensor harness to work with the AEM 2.0-bar MAP sensor. The AEM sensor has three wires, two of which need to be spliced into the appropriate wires from the stock harness. The green sensor wire carries the signal that needs to go to the ECU. We spliced it into the red wire with a white stripe from the stock MAF sensor harness. This wire terminates at the ECU since it was used to carry the stock MAF sensor signal. However, it must be moved from the MAF sensor location (pin 2O) to the MAP sensor pin (4F) on the EMS ECU.

0310scc_projectmiata06_z Photo 6/9   |   Speed density screen
Telling the ECU to recognize the MAP sensor is done in the "Options-Speed Density" menu. Here's where to find it. Without this setting, the ECU will be looking for a nonexistent MAF sensor input. Enable the Speed/Density input by checking the box at the top of the window and enter the minimum and maximum voltages for the MAP sensor you're using. AEM's 2.0 bar MAP sensor has a minimum output of .49 volts and a maximum output of 4.49 volts.

The black sensor wire is ground. We spliced it into the black wire with a blue stripe from the stock MAF sensor harness that terminates in the correct location to be recognized by the EMS ECU. The MAP sensor requires a five-volt power supply through its red wire. We tapped power from the TPS power supply (the green wire going into the TPS). This requires running a wire around the engine bay from the TPS to the MAP sensor, which we mounted next to the firewall using an adell clamp. To control boost, we wired in a GM pulsewidth solenoid (part number 1997152) which can be purchased at a GM dealer for about $50 with the leads and plug (part number 12102747). AEM configured the ECU to control boost using a pulsewidth modulated output to the diagnostic port on the driver's side of the engine bay (see photo page 160).

This wiring method is the same as the Link ECU. Each pin on the diagnostic port is labeled, so wiring this solenoid is a simple matter of plugging the leads into the "B+" and "TEN" terminals--polarity doesn't matter. We used modified spade connectors on the solenoid leads, which we trimmed to fit inside the diagnostic port terminals. The port cover can then be closed over the connectors and secured with a zip tie.

The solenoid was plumbed conventionally with vacuum hose from the first intercooler pipe (ideally the compressor outlet) to the solenoid and another hose from the solenoid to the wastegate actuator. The solenoid will control boost by simply blocking the boost signal to the wastegate until the ECU decides to let it open.

MAP sensor wiring chart
MAP sensor wire color/purposeHarness wire colorPin location at ECU
Green/signalRed w/white stripe4F
Black/groundBlack w/blue stripe2D
Red/powerSpliced 5V from TPS not wired to harness 

Tuning any stand-alone system correctly requires a wideband O2 sensor. In most cases, you'll borrow one, plug it in, tune your car, and take it back out. AEM's UEGO (Universal Exhaust Gas Oxygen) sensor is one of the most compact and affordable widebands on the market. At about $400, it's less expensive than comparable sensors from NTK or FJO, and it rivals the cost of do-it-yourself kits without the need for assembling your own controller.

0310scc_projectmiata07_z Photo 7/9   |   Injector Screen
Injector size changes are made in the "Change Injectors/Pressure" menu, which can only be accessed, from the fuel table or chart. Pressing the M button and selecting the "Change Injector/Pressure" option from the pull down menu brings up this window. Entering the Miata's stock injector size and fuel pressure, as well as the size of your upgraded injectors and fuel pressure configures the ECU to drive them correctly. Stock 1.8-liter first generation Miatas use 230cc/min. injectors at 43 psi.

The AEM EMS is also equipped to use a wideband sensor all the time for closed-loop fuel trim and for self-tuning, so we elected to use it permanently in place of the conventional O2 sensor.

UEGO sensors require an electronic brain box to control the sensor and provide a usable signal. The AEM sensor's box is about the size of a credit card and it's durable enough to be mounted under the hood as long as it's not exposed to extreme heat or moisture. It ships with Velcro to mount the controller to the car, as well as a weld-on bung to mount the O2 sensor in the exhaust. Since we were replacing the stock O2 sensor, we didn't need to use the bung.

Wiring the UEGO controller is simple. The UEGO sensor itself plugs into the magic box, and the signal that comes out the other side needs to be wired into the ECU. The same harness also has power and ground wires that need to be connected. Since the stock O2 sensor plug is already connected to the appropriate pins on the ECU, we decided to feed the UEGO signal through that part of the stock harness. This eliminated the need to run any additional wires through the firewall.

0310scc_projectmiata08_z Photo 8/9   |   MAF screen
Disabling the MAF input to the ECU is done in the "Options 0-5v MAF" menu which is buried under multiple submenus. Once you've opened the right window, you'll need to uncheck the MAF box at the top.

Using the supplied Velcro, we stuck the UEGO controller to the firewall on the passenger side of the engine bay. The AEM UEGO sensor replaces the stock unit in the downpipe and plugs into the controller. To tap the UEGO signal into the harness, we cut the connector off the discarded O2 sensor and tapped it into the remaining UEGO harness.

Only three of the wires on the stock O2 connector matter for the UEGO. Since two of the wires are black, you'll need a multimeter to determine which one is power and which one is ground. The red wire (power) from the UEGO goes to the black power wire on the O2 sensor harness (remember to use your multimeter). The orange wire (signal) from the UEGO controller is spliced into blue wire on the O2 sensor harness.

0310scc_projectmiata09_z Photo 9/9   |   O2 setup screen
Calibrating the UEGO sensor is easy. Bring up the air/fuel ratio table #1 from this series of pulldown menus and enter the air/fuel ratio values to match given voltages. All necessary air/fuel ratio to voltage conversions are supplied in the UEGO instructions.

To complicate things, Mazda changed the wire colors on the harness side of the connector. Thanks, guys. See the wiring chart on page 160 for specifics on those wires. The black wire from the UEGO brain box must be grounded to the chassis. We grounded it with an eyelet connector through the same bolt we used to mount the MAP sensor on the firewall.

The remaining wires on the O2 harness (white, black) and the UEGO harness (white, green, brown and blue) are not used.

UEGO Wiring Chart
UEGO wire color/purposeMazda color before connectorMazda color after connector
Red/powerBlackBlack w/ yellow
Orange/signalBlueRed w/ black stripe
Black/groundTo chassis ground
WhiteNot used 
GreenNot used 
BrownNot used 
Blue Not used 

Ready to go
That was all the wiring we needed, but before starting the car, there are several other critical settings to be made. Because the Miata base calibration, which comes with the software, is designed to work with the Miata's stock sensors, the ECU must be configured to recognize the non-Mazda sensors and any other changes beyond stock which can affect engine function. But first, you have to load the base Miata calibration (1710-93CA-95.AEM15GEN.VO.94) from the base calibration file.

First, the ECU needs to know what injector size is being used. Injector size changes are made from the fuel map screen. The "Change injector/pressure" menu is accessed by pressing the "M" key from either the fuel table or chart. See the screen capture on this page. This menu then allows you to enter your old injector size and fuel pressure (for the 1.8-liter first-generation Miata, it's 230cc/min and 43 psi). Then, enter your new injector size and pressure. (Our Flying Miata kit uses 550cc/min injectors at the same pressure.) These settings make appropriate changes to the base fuel map and other critical parts of the calibration.

Since stock Miatas use a mass air flow meter to sense engine load, the ECU must also be configured to recognize the AEM 2.0-bar MAP sensor we installed earlier. It can also be configured for whatever MAP sensor you're using. Buried six sub menus deep (Setup; Load Setup; Speed Density; Options-Speed Density) is a menu, which configures the MAP sensor inputs and selects speed density instead of MAF input to the ECU. The AEM 2.0 bar MAP sensor uses a minimum voltage of .49 and a maximum of 4.49. If you're using this sensor, enter those values in the appropriate fields and check the speed density box at the top of the menu.

You'll also need to tell the ECU to ignore the MAF input. This menu is buried as laughably deep as the speed density menu (Setup; Basic System Setup; Load Setup; 0-5v Mass Air Flow; Options-0-5v Mass Air Flow). Simply uncheck the Mass Air Flow box at the top and close the window.

The UEGO must also be calibrated. This allows the ECU to match a given voltage output (between 0 and 5 volts) from the O2 sensor with a specific air/fuel ratio. Again, configuring this sensor requires searching through four submenus (Setup; Sensor Setup; 02 Sensor; Air Fuel Ratio #1 table). See the screen capture on page 164. Air/fuel ratio values must be manually entered from the conversion table in the UEGO installation instructions. Change the values in the AFR table window to match values in the conversion table from the UEGO instructions at all corresponding voltages.

Before starting the car, the throttle range must be calibrated. Throttle range calibration is only possible with the laptop online with the ECU. Under the "Configure" menu, select ECU setup/Set throttle range and follow the directions. You can now start the car. Before calibration can begin, you have to check the ignition timing to make sure the timing the ECU is sending out is actually the timing the engine is getting. Again, use the Configure menu to navigate to ECU Setup/Set ignition and follow the directions. You'll need a timing light to establish base timing.

So far, so good. Installation was simple for a full stand-alone system. We only had to solder seven wires and didn't have to punch anything through the firewall. The car also fired up and idled on the first try. Of course, starting and idling aren't really the point of a turbo Miata, so in the next installment, we'll concentrate on tuning, beginning with automapping from the base calibration, which comes with the EMS software. From there we'll work into more advanced tuning on the street and dyno testing. n

Previous Installments

December '99
Finding a used Miata. Installing Hard Dog roll bar

January '00
Making a '95 Miata as fast as a '99 Miata, part 1: Racing Beat intake, header and exhaust.

February '00
Making a '95 Miata as fast as a '99 Miata, part 2: GAB shocks, Eibach springs, Racing Beat bars, BFG g-Force T/A R1 tires. Including the actual lap-by-lap shootout.

July '00
Jackson Racing clutch and flywheel, skidpad testing (0.98 g on street tires), and the intake comparison test (Racing Beat, Jackson Racing, HKS.)

March '01
Installing and tuning the Link Engine Management system on a naturally aspirated engine

July '01
Installing and testing the FMII turbo kit.


Advanced Engine Management
Hawthorne, CA 90250
Flyin' Miata
GAB Shocks
Racing Beat, Inc



At its most basic level, porting the intake and exhaust ports on a rotary engine is the same as porting the cylinder head(s) on a piston engine, in that the objective is to improve airflow in and out of the combustion chambers.
David PratteJul 9, 2020
Air suspension systems may seem mysterious but they aren't a whole lot different than traditional suspensions. At their core, air suspensions just swap out coil springs for flexible, pressure-filled bags of air.
Aaron BonkJun 24, 2020
Sam has been itching to change things up on his Supra for awhile. Lucky for him, he got the chance when AR Motorwerkz called asking if he could help test fit a custom set of 20-inch BBS LM wheels.
Sam DuJun 17, 2020
Relocating the battery is a simple and easy way to get a big gain in handling and reduce overall weight for very little money.
Mike KojimaJun 11, 2020
These are the engines that Nissan fans who love to go fast love
Aaron BonkMay 28, 2020
Sponsored Links