If a turbo petrol engine feels flat on a hot day, or a fresh remap pulls well on the first run and then loses power, the knock control system is often the reason. It is one of the quietest systems in the ECU, yet it decides how much ignition advance the engine can actually use. This guide covers knock from the workshop point of view: what causes it, how the piezo sensor picks it up, what the ECU does with that signal, and how to tell genuine knock from a wiring fault or mechanical noise.
Detonation in plain terms
After the spark fires, a flame front spreads through the combustion chamber. The mixture that has not yet burned is squeezed and heated by the rising pressure. If it gets hot enough, it self-ignites before the flame reaches it. That sudden, uncontrolled burn creates pressure waves that make the chamber ring like a bell. The extra heat and shock load attack piston crowns, ring lands, head gaskets and bearings, which is why sustained heavy knock can destroy an engine quickly.
The usual causes are easy to remember because they all make the end gas hotter or more compressed: too much timing, too much boost, hot intake air, a lean mixture, carbon build-up, overheating and fuel with an octane rating below what the calibration expects.
Do not confuse detonation with pre-ignition. In pre-ignition the mixture lights before the spark, from a glowing deposit or, on downsized direct-injection turbo engines, from oil and fuel droplets at low rpm and high load. Ignition retard cannot cure that, so manufacturers combine oil specifications, injection strategies and load limits to deal with it.
Inside the sensor
The typical knock sensor is a small piezoelectric accelerometer with a centre bolt hole. A seismic mass sits on a piezo ceramic element. When the engine structure vibrates, the inertia of the mass loads the ceramic, which produces an alternating voltage. The sensor is self-generating, so it needs no reference voltage.
Early systems used resonant sensors matched to a single frequency. Today broadband sensors are the norm: they respond across a wide frequency band and the ECU chooses which frequencies to evaluate. The knock frequency of an engine depends mostly on its bore diameter, so a large-bore engine knocks at a lower frequency than a small-bore one.
Because the sensor measures vibration through its mounting, the contact face must be clean and flat and the bolt torqued exactly to specification. Too loose and real knock is missed. A bad seat can also distort the signal.

Signal processing in the ECU
The raw signal contains every mechanical noise the engine makes. To pick out knock, the ECU:
- opens a measuring window for each cylinder, a few degrees of crank angle after top dead centre on the combustion stroke, using crank and cam position to identify the cylinder;
- passes the signal through a band-pass filter set to the engine’s knock frequency;
- rectifies and integrates it to give a single knock intensity per combustion;
- compares that intensity with a learned noise reference for that cylinder and operating point, and flags knock when it exceeds the reference by a calibrated factor.
The per-cylinder reference matters because a cylinder right next to the sensor always shows a bigger signal than one at the far end of the block.

Knock control strategy
Once knock is detected, the ECU retards ignition on the affected cylinder by a fixed step. Repeated knock adds more retard until a maximum limit is reached. When the cylinder runs clean for a while, the timing creeps back toward the base map in small increments. Watch this in live data and you see a sawtooth: quick drops, slow recovery.
On top of the fast loop, many ECUs keep adaptive values that shift the base timing when the engine repeatedly needs retard, which is how they cope with lower-octane fuel. Turbo engines may also reduce boost or enrich the mixture when retard gets large. If the sensor or its circuit fails, the ECU usually runs a fixed safety retard, and the engine feels noticeably weaker.
The same principle applies beyond passenger cars. Some modern motorcycles have knock sensors, and spark-ignited natural-gas engines in buses, trucks and agricultural equipment rely on knock control because gas composition varies from one fill to the next.

Workshop diagnostics
- Fault codes: P0325 and P0330 are circuit faults for knock sensor 1 (bank 1) and sensor 2 (bank 2). Check connectors, the harness under the intake manifold and the sensor resistance or signal on a scope before replacing parts.
- Per-cylinder retard: one cylinder retarding points to a local problem such as a weak coil, wrong plug, injector issue or carbon. All cylinders retarding points to fuel, intake temperature or overall calibration.
- Mechanical noise: loose heat shields, chain rattle, worn tappets or noisy injectors can generate false knock. Find and fix the noise rather than reducing sensitivity.
- Fitting: when replacing a sensor, clean the seat and follow the torque specification.
Related fault codes (DTCs)
Generic OBD-II (SAE J2012) codes related to knock sensing and knock control. Sensor 1 is Bank 1 or the single sensor; sensor 2 is Bank 2. Manufacturers may word them differently, so confirm with the vehicle-specific description.
| Code | Meaning | Typical causes |
|---|---|---|
| P0324 | Knock Control System Error | Knock sensor signal missing or implausible, wiring, internal ECU knock evaluation fault; real heavy knock on some systems |
| P0325 | Knock Sensor 1 Circuit (Bank 1 or Single Sensor) | Sensor or wiring fault, unplugged connector |
| P0326 | Knock Sensor 1 Circuit Range/Performance (Bank 1 or Single Sensor) | Wrong mounting torque, corrosion or dirt under the sensor, mechanical engine noise, sensor ageing |
| P0327 | Knock Sensor 1 Circuit Low (Bank 1 or Single Sensor) | Signal open or shorted to ground, loose sensor, failed sensor |
| P0328 | Knock Sensor 1 Circuit High (Bank 1 or Single Sensor) | Signal shorted to voltage, damaged screening, failed sensor |
| P0329 | Knock Sensor 1 Circuit Intermittent (Bank 1 or Single Sensor) | Loose connector pins, chafed harness, oil/coolant in the connector |
| P0330 | Knock Sensor 2 Circuit (Bank 2) | Sensor or wiring fault, unplugged connector |
| P0331 | Knock Sensor 2 Circuit Range/Performance (Bank 2) | Wrong mounting torque, corrosion or dirt under the sensor, mechanical engine noise, sensor ageing |
| P0332 | Knock Sensor 2 Circuit Low (Bank 2) | Signal open or shorted to ground, loose sensor, failed sensor |
| P0333 | Knock Sensor 2 Circuit High (Bank 2) | Signal shorted to voltage, damaged screening, failed sensor |
| P0334 | Knock Sensor 2 Circuit Intermittent (Bank 2) | Loose connector pins, chafed harness, oil/coolant in the connector |
| P2336 | Cylinder 1 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
| P2337 | Cylinder 2 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
| P2338 | Cylinder 3 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
| P2339 | Cylinder 4 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
| P2340 | Cylinder 5 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
| P2341 | Cylinder 6 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
| P2342 | Cylinder 7 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
| P2343 | Cylinder 8 Above Knock Threshold | Actual knock (low-octane fuel, carbon deposits, high intake temperature, lean mixture, aggressive timing) or mechanical noise / sensor fault on that cylinder |
Tuning considerations
Knock control is the safety net of any petrol remap. After changing ignition or boost maps, log retard on every cylinder with the fuel the customer actually uses, preferably in warm conditions and at full load. Occasional small corrections are normal. Consistent retard means the timing or boost is too aggressive for that engine and should be reduced. Hiding knock by raising thresholds or disabling knock control removes the protection that keeps the engine alive.
Summary
A knock sensor is a piezo vibration sensor, and the ECU turns its signal into a per-cylinder knock decision through windowing, filtering and reference comparison. Retard comes in fast steps and goes back slowly. Reading that behaviour is one of the most useful checks you can make on any spark-ignition engine, original or tuned.
Looking for an original or tuned file for a petrol engine? Find your ECU file on ECUFlashFiles.