The knock sensor protects the engine from damage caused by pre-ignition.
First off, if you have heard a rattling sound, drive gently to reduce pinging to reduce damage to the pistons, pins and rods. Numerous things can cause pre-ignition. Carbon build up increases the compression ratio and will glow as the engine heats up. Ether of these can cause the pinging. Carbon build up can also foul the EGR system.
If you have a carbon problem there are several ways to combat carbon. #1 Run a full tank full of Chevron Premium gasoline with ‘Techron’. #2 Add 8 oz of Pennzoil 2 cycle out board oil to twenty gallons gasoline. #3 Do A Seafoam treatment. http://www.nissanfrontier.org/forum_posts.asp?TID=2510&P N=1
Have a good one while you can still laugh about it.. Don S..
By November many of us will not have the money to buy gasoline to go vote!