A knock sensor is also known as an engine ping or detonation sensor. The knock sensor is a piezoelectric sensor that detects knocking in the engine. Knocking is caused by the combustion of the fuel-air mixture in the engine. The knock sensor produces a signal that is used to adjust the ignition timing to prevent knocking.