I haven't looked at this in about 10 years.
A knock sensor isn't a bad idea but its the implemtation that counts.
Typically the sensor is tuned in to a certain noise frequency, the problem is if your engine has something that rattles (resonates) at the same frequency then you get a false read...