The knock sensor responds to spark knock caused by Pre-detonation of the Air/Fuel mixture. As the flame front moves out from the spark plug ignition point, pressure waves in the chamber crash into the piston or cylinder walls resulting in a sound known as a knock or ping. This is caused by using a fuel with a low octane rating, overheating, or over advanced timing. Sometimes it can be caused by hot carbon deposits on the piston or cylinder head that raise compression. A knock sensor is comprised of Piezoelectric materials; Crystals that when impacted, generate a voltage (same idea as a BBQ ignitor). This voltage is monitored by the computer, and when an irregularity is detected, the computer corrects timing in VVT (variable valve timing) engines, or triggers a DTC Diagnostic Trouble Code) in older vehicles.