Knock sensors are mounted on the block near the base of the cylinder head.
The greater the vibration or shock, the higher the voltage and frequency. This video is sponsored by NGK Spark Plugs.
The knock sensor is a piezoelectric accelerometer that acts as a microphone on the engine. It converts vibrations into an alternating current (AC) signal. When the crystal inside the sensor is vibrated, it produces an AC voltage. The greater the vibration or shock, the higher the voltage and frequency.