← Guides
Fundamentals8 min read

How an ECU Works

An engine control unit (ECU) is the small computer that runs a modern engine. Many times every second it reads a set of sensors, decides how much fuel to inject and exactly when to fire the spark, and drives the actuators that carry those decisions out.

01What it actually controls

Think of the ECU as the bridge between what the driver asks for and what the engine can safely deliver. The systems it manages include:

  • Air — throttle position and, on turbo engines, boost pressure.
  • Fuel — how long each injector stays open.
  • Ignition — when each spark plug fires (petrol engines).
  • Emissions — the systems that keep the exhaust within legal limits.

02Inside the box

Open an ECU and the parts that matter to a tuner are the memory chips. Three pieces do the heavy lifting:

  • Microcontroller— does the maths, runs the firmware (the ECU's operating system), and talks to the outside world.
  • Flash memory— stores the calibration: the maps and functions that define how the engine behaves. This "original file" is what tuners read out and modify.
  • EEPROM — vehicle-specific data such as the VIN, immobiliser codes and mileage. You generally leave this alone.
Common file size
8 kB – 4 MB
Diesel ECU example
Bosch EDC17
Petrol ECU example
Bosch MED17
Diagnostic port
OBD-II / CAN bus

03Sensors in, actuators out

The ECU can only be as good as what it can measure. Key inputs include airflow (MAF), manifold pressure (MAP), intake air temperature (IAT), throttle position (TPS), coolant temperature, crank and cam position, the knock sensor, and the oxygen (lambda) sensor. From those readings it commands the injectors, the ignition coils, the electronic throttle and the boost control.

04Open loop vs closed loop

At light load the ECU runs closed loop: it watches the oxygen sensor and constantly trims fuelling to hit a target air–fuel ratio — a feedback loop. Under hard load or wide-open throttle it switches to open loop, stops trimming, and simply follows the values baked into its tables (usually richer, for power and safety). Drag the gauge to see what "richer" and "leaner" mean.

AFR — try it
14.7:1 AFR
Stoichiometric
Rich · more fuel14.7 stoichLean · less fuel

Chemically complete burn — what closed-loop targets at light load.

14.7:1 is the chemically complete (stoichiometric) ratio for petrol. Closed loop hunts around it; under load the ECU deliberately runs richer.

05It's all tables

The calibration is stored as lookup tables (maps): fuel against rpm and load, ignition timing against rpm and load, boost targets, and many more. When the engine sits between two cells, the ECU interpolates between them. Tuning is, at its core, carefully changing the numbers in these tables.

Checksums

After you edit the file, its internal checksummust be recalculated or the ECU will reject the file and the car won't run. Proper tools handle this for you.

Test yourself

Quick check

5 questions. Answer them all, then submit to see how you did.

  1. 01Which memory chip stores the tunable maps (the 'original file')?

  2. 02In closed-loop operation, the ECU adjusts fuelling based on which sensor?

  3. 03When does an engine typically switch to open loop?

  4. 04What does the ECU do when engine conditions fall between two table cells?

  5. 05Why must a checksum be corrected after editing the file?

Educational use only.This content teaches how engine control systems work. Modifying a vehicle's emissions or safety systems may be restricted by law in your region. Always follow local regulations and work on vehicles you are authorised to service.