Megasquirt-3 Installation and Wiring Guide
A detailed guide to installing, wiring, and performing initial setup of the Megasquirt-3 ECU
This guide covers chapters 2.1--2.10 of the official MS3 Setting Up manual and has been adapted for the English-speaking community. It describes the entire process from purchasing or assembling a Megasquirt-3 ECU to the point where you have established communication with TunerStudio and are ready to begin engine tuning.
1. Purchasing or Building a Megasquirt
Megasquirt-3 (MS3) is a processor board that mounts onto a mainboard. There are two generations of mainboard:
- V3.0 -- the classic board, well known to DIY kit builders.
- V3.57 -- a newer revision with improved layout and additional features.
The MS3 processor board is compatible with both mainboard versions. When purchasing or building, you have two configuration options:
MS3 Without MS3X (Mainboard Only)
Basic configuration. The V3.0/V3.57 mainboard provides:
- Up to 2 injector driver channels (semi-sequential or batch injection).
- Basic ignition control (one or two coils via an external igniter module).
- Standard sensor inputs (CLT, IAT, TPS, MAP, O2).
This is sufficient for simple 4-cylinder setups with semi-sequential injection and distributor-based or wasted spark ignition.
MS3 With MS3X (Expansion Board)
MS3X is a daughter board that adds significant capabilities:
- Up to 8 injector driver channels (full sequential injection).
- Up to 8 ignition driver channels (coil-on-plug / COP).
- Additional general-purpose inputs/outputs.
- Built-in ignition drivers (no external igniter module needed for logic-level coils).
Recommendation: For most projects, use MS3 with MS3X. This provides maximum flexibility and enables sequential injection and coil-on-plug ignition on 4, 6, and 8 cylinder engines.
Tip: If you are purchasing a pre-assembled unit, make sure the seller specifies the mainboard version and whether MS3X is included. If you are building a DIY kit, carefully follow the assembly instructions on msextra.com -- soldering mistakes are the number one cause of problems for beginners.
2. Fuel System and Ignition
Before wiring the ECU, make sure your fuel system and ignition system are compatible with electronic fuel injection.
Fuel System
Megasquirt drives high-impedance electromagnetic injectors (12--16 ohms) directly. Low-impedance injectors (1--3 ohms) require additional resistors or PWM mode configuration in the firmware.
Minimum fuel system requirements:
- An electric fuel pump with sufficient flow capacity.
- A fuel rail with injectors.
- A fuel pressure regulator (typically 3 bar / 43.5 psi for naturally aspirated engines).
- A fuel filter.
- Reliable fuel lines rated for the system pressure.
Ignition: Resistor-Type Spark Plugs Are Mandatory
Warning! When using electronic fuel injection (EFI), you must install resistor-type spark plugs (marked with the letter "R", e.g., NGK BKR6E-11 instead of BK6E-11). Non-resistor spark plugs generate strong electromagnetic interference (EMI) that can cause:
- False triggering of crankshaft and camshaft position sensors.
- ECU malfunctions and loss of communication with TunerStudio.
- Incorrect sensor readings (TPS, MAP, CLT).
- Random controller resets.
Also use suppression-type spark plug wires (spiral-wound resistive core). Solid-core wires without resistance are unacceptable in EFI systems.
Ignition Coils
- With an external igniter module: Classic oil-filled coils require an external igniter (BIP373, ignition module, etc.). MS3X can drive the igniter with a logic-level signal (5V).
- Logic-level coils (smart coils): Coils with built-in igniters (e.g., GM LS, VAG, Toyota, etc.) connect directly to MS3X outputs without additional modules.
3. Wiring and Harness
Wiring is the foundation of reliable system operation. Most problems during Megasquirt installation are caused by poor wiring.
General Requirements
- Use automotive-grade wire with a minimum cross-section of 0.5 mm² (20 AWG) for signal circuits and 1.0--1.5 mm² (16--14 AWG) for power circuits (injectors, coils, fuel pump, relays).
- All connections must be soldered with heat shrink tubing or use quality crimp terminals. Twist splices are unacceptable.
- The harness should be protected with split loom or braided sleeving.
- Route signal wires separately from power wires (high-voltage ignition wires, alternator wires).
Ground (Grounding)
Reliable grounding is critically important. Recommendations:
- The main ECU ground should be a heavy-gauge wire (2.5 mm² / 14 AWG or larger) connected directly to the engine block or the battery negative terminal.
- Sensor grounds should go through the dedicated Megasquirt connector pins (sensor ground), not to the vehicle body.
- Clean the ground connection point on the engine down to bare metal and apply dielectric grease to prevent corrosion.
Unused Sensor Inputs -- Tie to Ground
Important! All unused analog sensor inputs (spare ADC inputs) must be connected to sensor ground. If an input is left unconnected (floating), its voltage will drift -- picking up random values from induced noise. This can cause:
- False readings in TunerStudio on unused channels.
- In some configurations, interference with adjacent ADC channels.
- Difficulty diagnosing issues during troubleshooting.
Connecting an unused input to ground "fixes" its value at 0V and eliminates the floating signal problem. It takes a minute but saves hours of debugging.
Megasquirt Connector
Megasquirt uses a 35-pin Ampseal connector (DB37 on V3.0 mainboard or Ampseal on V3.57). The pinout is described in detail in the documentation at msextra.com. Before starting installation, print out the pinout diagram and keep it handy.
4. Connecting the MAP Sensor
The Manifold Absolute Pressure (MAP) sensor is a key element for the Speed Density fuel control algorithm. Proper MAP sensor connection is critically important for correct engine operation.
Speed Density: Standard Connection
When using the Speed Density algorithm (the most common approach), the MAP sensor measures vacuum in the intake manifold. Requirements:
- The sensor connects to the intake manifold below the throttle plate (in the full vacuum zone at idle).
- Use a vacuum hose of minimal length (the shorter, the faster the response).
- Hose diameter: 3--4 mm (1/8"--5/32").
- The pressure tap should be located as far as possible from individual cylinder runners to average out pulsations.
Tip: On a standard intake manifold with a plenum, there is usually already a vacuum fitting -- use it. If there is no fitting, drill a hole in the plenum and tap threads or epoxy in a fitting.
Individual Throttle Bodies (ITBs)
Engines with Individual Throttle Bodies (ITBs) are a special case. Each cylinder has its own throttle, and the pressure in each runner pulsates heavily.
Solution -- connect through a manifold or tee for averaging:
- From each intake runner (below the throttle), run a thin vacuum hose.
- Combine all hoses through tees or a dedicated spider manifold into a single common hose.
- On the common hose before the MAP sensor, install a small damper reservoir (vacuum canister, 50--100 ml volume) or restrictor pills in each line.
- Connect the MAP sensor to the common junction point.
This averages the pressure pulsations from individual cylinders and provides the MAP sensor with a stable signal.
Note: Many tuners on ITB configurations prefer the Alpha-N algorithm (TPS-based control) or a combined Speed Density/Alpha-N approach. In this case, the MAP sensor plays a secondary role or is not used at all.
MAF or Alpha-N: MAP Is Not Required
If you are using the MAF (Mass Air Flow) algorithm or pure Alpha-N (control based solely on throttle position and RPM), the MAP sensor is not the primary input for fuel calculations. You can:
- Leave it unconnected entirely.
- Connect it for informational purposes (logging, barometric correction).
The built-in MAP sensor on the Megasquirt board (if populated) will in this case read atmospheric pressure, which can be useful for barometric correction.
5. Installing TunerStudio and MegaLogViewer
You will need two software tools for tuning and monitoring Megasquirt:
TunerStudio MS
TunerStudio is the primary software for configuring the Megasquirt ECU. With it you can:
- Configure all engine parameters (fuel and spark tables, sensor settings, outputs, etc.).
- Monitor sensor readings in real time.
- Record engine data logs.
- Upload and download tune files (.msq).
Where to download: msextra.com/downloads -- go to the TunerStudio section. A free version (TunerStudio MS Lite) and a paid full version are available. Lite is sufficient to get started, but the full version is significantly more convenient (VE Analyze Live, auto-tune, and other features).
TunerStudio runs on Windows, macOS, and Linux (Java application).
MegaLogViewer
MegaLogViewer is a program for analyzing recorded data logs. It allows you to:
- View recordings on time-aligned graphs.
- Analyze air/fuel ratio (AFR), RPM, load, and other parameters.
- Identify problem areas in tables.
Where to download: Also at msextra.com/downloads. Both free Lite and paid full versions are available.
Tip: Install both tools in advance, before connecting the ECU. This way you can get started immediately once the Megasquirt is powered up.
6. Powering the ECU With 12V
Megasquirt is powered from the vehicle's electrical system (nominally 12--14V). Proper power supply is critically important for stable operation.
Power Supply Wiring
The Megasquirt ECU has two power inputs:
- Permanent power (VBAT / Main Power): 12V directly from the battery through a fuse. Provides power to the main circuits.
- Switched power (IGN / Switched 12V): 12V through the ignition switch. When the ignition is off, the ECU is fully de-energized (on some revisions) or enters sleep mode.
Warning! Always install a fuse (3--5A) in the ECU power circuit. This protects both the ECU and the wiring in case of a short circuit.
Bench Testing Power Supply
For initial setup and testing on the bench (before installing in the vehicle), you will need:
- A 12--14V DC power source (lab power supply, battery charger, or battery).
- Minimum source current: 1--2A (the ECU without load draws approximately 0.5A).
- Connect the positive terminal to the power pins (VBAT and IGN), negative to the ground pin.
Bench power-up procedure:
- Connect ground (GND) first.
- Apply 12V.
- The power LED on the board should illuminate.
- Connect the USB or serial cable to the computer.
Tip: When working on the bench, do not connect injectors and ignition coils unless necessary -- this reduces power consumption and the risk of errors. The ECU works and can be configured perfectly well without actuators connected.
In-Vehicle Power
When installing in the vehicle:
- Power the ECU from the battery or main power bus through a dedicated fuse.
- Switched power (IGN) should come from the ignition switch so the ECU turns on when you turn the key.
- Do not forget the fuel pump relay -- Megasquirt controls the pump relay through a dedicated output. The pump should not run continuously with the ignition on; the ECU activates it during cranking and while the engine is running.
7. Communication Setup (USB or RS232 Serial)
A serial port is used for communication between the computer and Megasquirt. There are two physical connection options.
USB Connection
Modern MS3 boards (especially on V3.57 mainboard) and MS3-Pro have a built-in USB port.
Connection procedure:
- Connect the ECU and computer with a standard USB cable (type depends on the board: mini-USB or micro-USB).
- On first connection, Windows will automatically install a virtual COM port driver (CDC). If automatic installation does not occur, download the driver from the chip manufacturer's website (usually FTDI or CP210x).
- A new COM port will appear in Windows Device Manager -- note its number (e.g., COM3).
On macOS and Linux, the USB device is usually detected automatically as /dev/ttyUSBx or /dev/ttyACMx.
Tip: USB connection is the simplest and most reliable method. Use it if your board supports USB.
RS232 Serial (DB9)
Classic V3.0 mainboard boards are equipped with a DB9 connector for RS232 communication.
Connection procedure:
- If your computer has a COM port (DB9), connect directly with a serial cable.
- If there is no COM port (most modern laptops), use a USB-to-Serial adapter.
Warning! Not all USB-Serial adapters work reliably. Adapters based on FTDI chips (FT232R and similar) are recommended. Cheap adapters based on Prolific PL2303 chips frequently cause problems: connection drops, data transmission errors, and inability to flash firmware. If you experience communication problems, check the adapter first.
Port Settings
Serial connection parameters for Megasquirt-3:
| Parameter | Value | |-----------|-------| | Baud rate | 115200 | | Data bits | 8 | | Stop bits | 1 | | Parity | None | | Flow control | None |
In TunerStudio, these parameters are usually set automatically when selecting the COM port -- you only need to specify the correct port and a speed of 115200 baud.
Note: Older MS2 firmware used 115200 baud, and MS3 also uses 115200 by default. Do not change the speed unless necessary.
8. Installing Firmware
Firmware is the software running directly on the MS3 processor. It determines all the capabilities and functions of the ECU.
When to Update Firmware
- On first startup of a new DIY kit (the processor may be blank).
- When upgrading to a newer version for new features or bug fixes.
- If the current firmware version is incompatible with your TunerStudio version.
Flashing Firmware via TunerStudio
- Download the latest MS3 firmware from msextra.com/downloads. The firmware file typically has a
.s19extension. - Open TunerStudio.
- Go to the menu: Help -> Firmware Burner (or Extra Features -> Firmware Burner in some TunerStudio versions).
- Select the COM port to which Megasquirt is connected.
- Specify the path to the
.s19firmware file. - Click Burn and wait for the process to complete. Do not disconnect power or unplug the cable during flashing under any circumstances!
- After completion, the ECU will reboot with the new firmware.
Warning! Firmware flashing is a critical procedure. Interrupting the process can render the ECU inoperable (requiring recovery via bootloader or a BDM programmer). Use a reliable power source and a reliable USB/Serial connection.
Tip: Before flashing, save the current tune file (.msq) via TunerStudio: File -> Save Tune As. After a firmware update, you may need to reload the tune or reconfigure parameters if the data format has changed between versions.
9. Connecting TunerStudio to the ECU
Once the ECU is powered, firmware is installed, and the communication cable is connected, you can set up the connection in TunerStudio.
Creating a Project
- Launch TunerStudio.
- Click Create New Project (or File -> New Project).
- Enter a project name (e.g., the name of your vehicle).
- Select a directory to save the project.
Selecting the COM Port and Connecting
- In the connection settings, select the COM port corresponding to your USB or Serial connection.
- Set the speed to 115200 baud.
- Click Test Port -- TunerStudio will attempt to communicate with the ECU.
Auto-Detect or Manual Firmware Selection
TunerStudio offers two ways to identify the firmware:
- Auto-detect (recommended): TunerStudio will automatically query the ECU and identify the firmware version. This is the simplest and safest option -- the program will load the correct configuration file (
.ini) on its own. - Manual selection: If auto-detect fails, you can manually specify the
.inifile corresponding to your firmware version. The.inifiles are downloaded along with the firmware from msextra.com.
Tip: If auto-detect does not identify the firmware, check: (1) whether the correct COM port is selected, (2) whether power is applied to the ECU, (3) whether the COM port is occupied by another program (close all terminals and port monitors).
Tune File (.msq)
After a successful connection, TunerStudio will load the current settings from the ECU. You have several options:
- Work with the current settings: If the ECU is new, it contains default settings. You can start tuning from scratch.
- Load an existing .msq file: If you have a tune file from a similar project (same engine, similar configuration), load it via File -> Open Tune (msq). This will save time, but make sure to review and adjust all parameters for your specific engine.
- Save the current settings: At any time, you can save the current state of the tune via File -> Save Tune As -- this creates an
.msqfile that can be used as a backup or transferred to another ECU.
Warning! Never use someone else's .msq file without thorough review. Incorrect ignition settings (too much advance) can cause detonation and damage the engine. Incorrect fuel settings can lead to a lean condition and burned pistons.
10. Verifying Versions
After a successful connection, make sure the firmware and software versions are compatible.
Where to Check the Firmware Version
In TunerStudio, the firmware version is displayed in the window title bar and on the status bar at the bottom of the screen. A typical string looks like:
MS3 Extra release X.Y.Z
where X.Y.Z is the version number (e.g., 3.4.2).
What to Check
- Firmware and TunerStudio compatibility: If TunerStudio displays errors or warnings about incompatibility, update TunerStudio or the firmware to compatible versions.
- Correct .ini file: If parameters in TunerStudio are displayed incorrectly (empty fields, non-functional menus), the
.inifile may not match the firmware version. Use auto-detect for automatic.inimatching. - Firmware signature: The TunerStudio status bar shows the signature of the connected ECU. Write it down -- it will be useful when seeking help on forums.
Tip: Always use the latest stable version of MS3 Extra firmware and the corresponding TunerStudio version. Updates often contain important bug fixes and new features. Check for updates at msextra.com.
What's Next?
After a successful connection and version verification, you are ready to begin engine tuning:
- Trigger wheel and crankshaft/camshaft sensor configuration.
- Basic engine parameter setup (number of cylinders, displacement, injectors).
- Building fuel and spark tables.
- Idle control, warmup enrichment, and accelerator pump configuration.
- First engine start.
Each of these stages is described in detail in subsequent sections of the guide and in articles on Megasquirt.online.