The knock sensor is located below the intake manifold, very tricky to get to and replace. Often, it will set a code for the knock sensor because something is making the car knock excessively. So you need to make sure to resolve any other codes first.
I did some research on the nissanclub forums
to see what other owner experiences were with the cars, and here is one quote from an experienced owner:
"WHEN SOMETHING GOES WRONG ON YOUR CAR
(EGR/MAF/ETC) IT MAY CAUSE YOUR CAR TO NOT RUN PROPERLY, AND BEGIN TO "PING/KNOCK". IF THE CAR CONTINUES TO DO IT, THE KNOCK SENSOR WILL CONTINUOUSLY BEING READING A PROBLEM, AND THE ECU MAY ASSUME THAT THE KNOCK SENSOR HAS GONE BAD.
FIX YOUR EGR, RESET YOUR CODES, GO DRIVE
. LEAVE THE KNOCK SENSOR ALONE.
Only time you should replace your knock sensor is if your ECU is reporting a knock sensor code only, and only after clearing the knock code several times should you consider changing it. Trust me, knock code gets thrown along side other codes very often."
The knock sensor has no moving parts, and is not as likely to fail as other items on the car.
It can fail though, and cause the car to run poorly.
Here are some instructions from someone who has replaced theirs, without having to remove the intake manifold, which makes for a big job:
"The knock sensor is located just under the intake manifold, near the oil filter. From under car
, if you look up at the oil filter, the knock sensor is to the left of the filter.
If you are getting a knock sensor code, replace it. It will make a huge difference in the way your car
drives. If something is wrong with your sensor, it will be retarding the timing on your engine for no reason. My sensor was malfunctioning and was seriously affecting the car. After removing the sensor it turned out that one of the contacts was badly corroded and the sensor was sending out the wrong voltage.
Here's the easiest way to remove the sensor, it will take less than one hour.
Remove the fuel rail and the injectors from the top of the engine. This will give you access to the knock sensor from above. It you lean over the engine and look down you will be able to see it. Now with a long extension on a socket you can loosen the bolt on the sensor. Then get under the car, reach up and remove the knock sensor.
When you are trying to remove the sensor from above, there may be another bolt in the way, just remove that as well to make things easier."