The knock sensor is used to back off ignition timing when the engine is experiencing a knocking or pinging noise. The sensor itself is calibrated to detect the vibrations that are unique to this type of engine condition. When it believes that it hears this noise it sends a command to the power train control module to retard the ignition timing.
If the sensor malfunctions it does not always set a check engine light code. It will depend on the year make and model of the vehicle.
A quick way to check the operation is to watch the ignition timing while the engine is running and safely tap the engine block with a metal tool such as a large screwdriver or long wrench near where the knock sensor is mounted.
The timing should automatically adjust while you are tapping on the engine block. This can be viewed on a scan tool and sometimes you can even hear the RPMs decrease as the timing retards.
My knock sensor story
Back in 1984 we could scan the vehicle but it was not as efficient as it is today with obd II and the faster computer communication speeds known as the baud rate. When I connected my old fashioned scan tool I could see that the timing was retarded and that the knock sensor signal was activated.
Most people would just go ahead and replace the sensor at this point but before I did that I took a good listen to the engine and I heard a small ticking sound. This vehicle had a slight leak from the exhaust manifold gasket where it met the cylinder head. The ticking sound was right next to the knock sensor.
The pitch of the exhaust leak was close enough that the knock sensor thought that the engine was pinging and was commanding the timing to retard. Although this may be an uncommon problem you should be aware that strange engine noises can cause the knock sensor to go active. In some cases engine noise can also set knock sensor check engine light codes.
Your best bet is to follow a diagnostic chart in a service manual for the set code or vehicles condition. Also check for technical service bulletins related to your car problem. For more articles about diy auto repairs visit the blog for online auto repair.