Knock sensors detect knocking or pinging sounds in an engine caused by low quality fuel, deposits, or incorrect spark plugs. The sensor uses a piezoelectric element that generates a voltage when pressure or vibration is applied. When knocking is detected, the sensor sends a signal to the ECU to slightly retard the spark timing to prevent damage. Knock sensors allow for more efficient engine performance by allowing the engine to operate closer to the detonation limit.