Ok, I could do a how to on the stock knock sensor replacement. Been there, done that. It took me about ten hours and the dealer says that it's a six hour job. So, at that rate you are coming close to 1K at the dealer, or a long day on your own.
Now that I have this worked out, it can be done in less than an hour once you have all the parts.
You will need:
Nissan Knock sensor: Part # 24079-31U01 - by the way, a lot of them are the same. I know the Subaru part looks just like it so a lot of them may be similar. If you get something else for cheap, it may be worth a try. Nissan's list price is $173.
Wiring harness: Maxima Harness Part #22060-7B000 - Note here. The one I had didn't work, so I made my own with a few pieces of wire and small connectors for less than a buck at Radio Shack. I'll get into that later.
1 2" long (50mm), 8mm, 1.25mm thread bolt - This is for the SC version. I'm not sure about the NA aspirated engine, but if I check, I bet it's about the same. The knock sensor is 3/4 thick, so wherever you mount it, the bolt has to be that much longer. It also has to be mounted solidly on the main part of the motor.
Here's the wiring harness. It's the same location on all first gens, but the wires are different colors. Mine did not match up with my ESM so I had to trace wires, but the location is the same for all.
The connector on the top of the passenger side valve cover, toward the front. There are two connectors mounted there, a gray one on the right (left in the picture) and a green one on the left of the vehicle (right facing in the picture). You want the green one on the right. There are a lot of wires in this connector.
The wire which sends voltage from the knock senor to the ECU is the off-white one, it's on the bottom right of the plug that pulls out of where it is mounted on the valve cover. I have cut and pulled back the loom material. In this picture I have turned the wiring connector so the wire is now on the top right. The shielded ground is a gray wire just below on the right (you can't really see it in the picture).
Now here's the trick. There are two terminal that come out of the knock sensor With the Maxima harness, there is only one wire coming from the connector, but two to the harness. It's a small coax cable. The two terminals are to check the resistance of the knock sensor, but only one sends voltage to the ECU. Which one, I had to figure out. This is also why I don't get why the resister mod works. The knock sensor sends voltage to the ECU, it's cold resistance is 500 - 600ohms, but it sends about 2.5 volts to the ESU at idle. It's a piezo electric generator (think speaker in reverse) and generates voltage through vibration from the engine. When the engine knocks, it increases the voltage and you get an error code P328. If it fails, you get either P328 or P327 (low voltage). Although I digress, I don't get how or why the resistor mod works, but others say it does and I don't need that argument with Brent. Perhaps one of you electrical gurus can explain why.
Find and cut those two wires on the bottom right of the harness. Give yourself about one inch from the connector so you could resolder the wire if you make a mistake.
You are connecting the new wires on the ECU side of the harness, which is the part that unplugs off the valve cover (towards the front of the truck). Strip the wires about 3/8" and cover the wires in the plug so they don't short (I used small shrink wire wrap). Solder two new wires about 8" long on the harness and cover with shrink wrap.
Here's where I relocated the knock sensor. I played with several locations and this seemed to fit the best and was clean and out of the way. Check the torque specs since you are working on an integral, sealed engine part. The SC is 20ft/lbs.
This is the harness I made. Again, you can get the $20 Maxima one, but I had no luck with it. If you do, you cut off the male end plug and solder those wires into the harness. I took the knock sensor to Radio Shack and got two small blade terminals for less than 50 cents
I used a voltage meter to figure out which terminal on the knock sensor was used. You can just experiment. There are only two. Once the wires were soldered, I slipped on the blade terminal onto the knock sensor and filled the connection with black RTV.
Here's the finished product.
I hooked up my laptop to the truck, started it up; cleared the old code and viola...code is gone!