Knock Detection
Having trauled through several websites I couldn't really find a system that was both cheap and would do what I wanted it to do, so I decided to design my own. It seems that the sensors themselves are tuned for certain frequencies of knock, so the filtering of the circuit only really needs to get rid of electrical noise rather than engine noise. There is also the need to have an adjustable trigger level, as there will always be engine noise in the frequency the sensor picks up, but it's when that becomes large that the circuit needs to signal a knock.
I decided to use an LM344 op amp as a comparitor and have a small RC network at the input stage to try to eliminate electrical noise. This would offer a high input impedance to the sensor allowing it to work as it was designed. The op amp then triggers a 555 timer to give a 400mS pulse out to the Megasquirt ECU.
Initial tests with a Saab sensor show the circuit works OK on the bench, so now it's time to bolt it all to the engine and see what happens.
After a few adjustments of the pot and creating some knock by advancing the ignition low down in the RPM range, I soon had it working very well. I found that, according to the knock sensor, my ignition map was right on the edge of knock, any more advance would cause the knock sensor to signal the MegaSquirt to retard ignition. (I added the knock control code to MS while I was playing with this)