There are two knock sensors.Located to the left side of engine.One is front sensor and one is rear sensor.
See the diagram below showing the knock sensor.

To replace the knock sensor, the starter motor needs to be removed.
The procedure is as follows :---
Removal of Starter Motor
Remove starter motor and oil dipstick pipe.
Removal and Installation:---
Disconnect battery cable.
Disconnect starter leads.
Remove two starter mounting bolts, then the starter.
Reverse procedure to install.
Removal of Knock Sensor
Remove:
Connector from Knock Sensor.
Knock Sensor.

Installation of Knock Sensor
Fit:Knock Sensor and tighten.
Connector on Knock Sensor.
Tightening torque 20 Nm (15 ft lb) .
NOTE: Rear Knock Sensor should be tightened in the 9 o'clock position .
Installation of Starter Motor
Fit starter motor and oil dipstick pipe.
-----------
The car will not start?
Car will not crank?
Car has no spark?
How to troubleshoot car battery?
How to test starter solenoid?
http://schematicsdiagram.blogspot.com/2011/06/how-to-test-starter-solenoid.html
--------------------
How to test cars starter?
http://schematicsdiagram.blogspot.com/2011/06/how-to-test-cars-starter.html
How to replace starter in car?
http://schematicsdiagram.blogspot.com/2011/06/how-to-replace-starter-in-car.html
See the diagram below showing the knock sensor.
To replace the knock sensor, the starter motor needs to be removed.
The procedure is as follows :---
Removal of Starter Motor
Remove starter motor and oil dipstick pipe.
Removal and Installation:---
Disconnect battery cable.
Disconnect starter leads.
Remove two starter mounting bolts, then the starter.
Reverse procedure to install.
Removal of Knock Sensor
Remove:
Connector from Knock Sensor.
Knock Sensor.
Installation of Knock Sensor
Fit:Knock Sensor and tighten.
Connector on Knock Sensor.
Tightening torque 20 Nm (15 ft lb) .
NOTE: Rear Knock Sensor should be tightened in the 9 o'clock position .
Installation of Starter Motor
Fit starter motor and oil dipstick pipe.
-----------
For more car related problem troubleshooting:---
This are the sections, you can go through and click the link to read its troubleshooting.
---------
The car will not start?
-----------------
Car will not crank?
-----------
Car has no spark?
-------------
How to troubleshoot car battery?
-----------------