The sensor KS (Knock Sensor) is responsible for notifying the ECM (Engine Control module) if the situation arises in which one or more of the cylinders of the engine have a knocking. This happens when the energy given by the air-fuel mixture is negative, and if this lasts for a time it is harmful to the engine.
The Engine Control Module (ECM) uses that information to adjust the motor, so that it does not hit in this way. In case the Knock Sensor (KS) does not work correctly and therefore indicates that there is a blow, the Engine Control Module (ECM) can change the ignition timing of the engine.
This sensor (KS) is incorporated into the cylinder block or the intake manifold. When there is a vibration that hits from the cylinder block, it is interpreted as vibratory pressure, action that is converted as a voltage signal which is sent to the ECM (Engine Control module).