The knock sensors detect the noise, described as a "knock" when the fuel preignites before the pistons reach TDC. The noise is like someone hitting the engine with a little hammer. So it doesn't matter where you put the sensor on the engine as metal transmits sound very well. These days,with good availability of the correct fuel, knock sensors aren't needed. In 63 years of motoring I've never heard an engine knock while driving. However, I've heard plenty of knocks while testing fuel in an engine lab.