What the hell is MegaSquirt and why would I want it on my Miata?

Disclaimer – I’m going to use random values in some cases just to illustrate my point, if you manage to find a way to use these random, arbitrary values on your ECU, bad things will happen. I can’t imagine anyone actually being that stupid, but you never know. If you ARE that stupid, I’m not responsible.

This site uses income-earning affiliate links. When you click a link to a product on this website and make a purchase, I may receive a commission.

I keep rambling on about ordering a MegaSquirt, so I figured it might be worth it to do a quick explainer and let everyone know just what the hell it is I’m talking about.

This post (and accompanying video) are going to explain the basics of engine management and what an aftermarket ECU* gets you.

Let’s start with your factory ECU. Pretty much every car since the early 90’s has been equipped with electronically controlled fuel injection.

Here’s a (relatively) quick rundown of how it works.

The ECU is programmed from the factory with fuel maps. This tells the engine how much fuel needs to be injected for a given situation. This is expressed as an Air/Fuel ratio. Air/Fuel ratio is exactly what it sounds like, how much fuel you want to inject for a given amount of air, and this does actually change based on what exactly you’re asking the engine to do.

The “Ideal” air/fuel ratio for a gasoline engine is 14.7:1. That’s 14.7 units of air for every 1 unit of fuel. This is called “Stoichiometric”. It’s the most complete combustion possible. There’s exactly enough fuel for the volume of air with no extra fuel and no extra air. Perhaps counterintuitively, you don’t actually always want that. 14.7:1 is great for stuff like low load cruising, driving down a flat highway at a steady speed in a high gear without giving it much gas at all. This is when the ECU will target stoichiometric to try and deliver the best fuel economy.

However, when there’s a lot of load on the engine and higher throttle openings, you want a richer mixture. On a naturally aspirated engine, something probably in the neighborhood of 13.5:1.

You want more fuel to help prevent detonation. Detonation is uncontrolled combustion after you’ve fired off the spark plug. Basically the combustion is supposed to go out from the spark plug and move through the combustion chamber, but if your A/F ratio is too lean or your ignition timing is too advanced, it can cause combustion before the flame front. It’s also called “Knock” or “Ping” because of the sound it makes. You’re going to want to avoid this, as it can cause all kinds of problems.

A richer mixture helps to prevent detonation by cooling down temps in the combustion chamber.

So, back to our theoretical situation. As you’re driving down the road, the car looks at a variety of sensors on the engine (mass airflow, throttle position, intake air temp, among others) and determines that you’re just cruising down the street in 5th at 45 on flat ground at low throttle angle. It looks this up in the fuel table and says “Cool, you want 14.7:1” and commands the injectors to inject the correct amount of fuel for what it thinks will give you that air fuel ratio. Then the narrowband Oxygen Sensor in the exhaust checks the air fuel ratio of the exhaust and if it’s not what it’s supposed to be, will tell the ECU to “nudge” the AFR in whatever direction it needs to.

This all sounds like a pretty good system right? So what’s the point in an aftermarket ECU?

Well the factory ECU has limits on what it can handle. It will be designed to handle the stock output of the engine, plus a decent amount of overhead to account for stuff like production tolerances, air density due to altitude or temperature, etc. This is why you can usually put an exhaust on a car without having to buy a standalone ECU. The factory ECU will just see the extra airflow and compensate for it. But there’s a limit to what it can handle.

First, it’s only going to have headroom of another 20% or so over stock (just a general number, every car and ECU is different). There’s zero reason to size a system for a car that makes 150hp to support 300hp.

Also, if your car didn’t come from the factory with a turbo or supercharger, it likely has no way to even see boost. As I mentioned above, even for the same amount of airflow, you’re going to want a lot more fuel when you’re under boost. Boost increases both temperature and cylinder pressure, both things that can lean to detonation. A good air/fuel ratio when you’re in boost is going to be something closer to 12.5:1.

This is where MegaSquirt (Or really any decent programmable ECU) comes in. It has a built in MAP sensor, so it knows the difference between boost or vacuum, and you can request a richer and richer AFR as the boost pressure goes up.

Megasquirt will also use a Wideband O2. Your factory narrowband is really only accurate in a narrow range, as the name implies. Generally something like 14:1 to 15:1,. You can see why this would be a problem if you want something like 13.5:1 for an NA engine and 12.5:1 for a boosted engine at WOT. A Wideband is accurate between 9:1 and something like 20:1. I opted for the AEM X Series Wideband, but lots of people like the Innovate LC-2 and others.

Using the standalone, along with a Wideband, you can tell the car exactly how much fuel you want for every situation and properly fuel your car, even if it never had a turbo from the factory and you added one. This is why a programmable ECU is pretty much always the first step to adding a turbo to any engine that didn’t come with one.

The downside to this is that you either have to tune the ECU yourself, or pay someone to do it. It will come with a base map for your car that will get you up and running, but you have to fill in the details to actually make it run good. MegaSquirt and its tuning software TunerStudio do include autotune features, but there’s definitely still a learning curve. I’m pretty close to the bottom of that learning curve right now, I know how engines work but have like zero experience tuning a standalone, but you guys will get to follow along as I learn to tune…or give up and pay someone to do it for me.

For the camera nerds like me, I shot this video on my Hero 8 Black with GoPro Media mod at 4k24fps. Edited in lumafusion on my iPad Pro.

*I’m gonna use ECU, Engine Control Unit, in this article. It’s interchangeable with “EMS” – Engine Management System, and “ECM” – Engine Control Module. Different manufacturers call them different things, but they all just mean “computer that control the engine”.