A knock sensor is always located on the engine block, that is how it senses the knock, here is a picture of it
http://www.partsgeek.com/mmparts/knock_sensor/honda/accord.html
hope this helps you
sometimes it might be in the head, but it;s directly screwed into these parts