A few comments:Hi Parkera I've ordered up 2N7000 to switch on the relay so will have to go with it now.
Any ideas how to adjust circuit so clapper is more consistent?
Tried changing R1 and VR1 but no use.
The LM358 will work at 5V, but the output does not swing that close to the rails. This may have an impact on turning on the 2N7000. 9 volts should be OK. 12 volts (if you have that for a lab supply) also would be fine for testing purposes up to, but NOT including the relay (LEDs can tell you what is going on in the collector/drain circuit).
R4 will bleed off any stored charge in the gate capacitance of the 2N7000. The opamp may or may not do a good job of that. I recommend keeping it, but the value could be a bit higher to save a few microamps. Be warned that if you go too high there will be a significant turn-off delay (T=RC of the gate capacitance).
R1 adjusts the bias required for the microphone. Best to set it per the recommendation of the mic manufacture. This usually will give the microphone the maximum sensitivity. With 22K and 9V the current will only be 400uA max.
The threshold voltage divider (R2, VR1, R3) could easily be scaled 50 times what your original circuit shows, especially if you do wind up using a CMOS opamp. That would put that divider current around 75 uA.
VR1 sets the threshold for the comparator, which is the mic output vs. the DC voltage level at the non-inverting input (+). Remember that the microphone output will have a DC component (in total silence) that the "clap" waveform will ride on. Of course the output of the microphone is going to depend on several factors. The most important of these are:
* Microphone sensitivity
* Directional characteristics of the microphone
* How close you are to the microphone
* How "loud" you clap (usually a huge variable)
* The harmonic content (frequencies present) in the "clap" (also usually a large variable).
And now you know why you have been having "consistency problems". Unfortunately most of those are hard to control, making development of this kind of a project difficult. (I had the same kind of problems with one I built 15 years ago.) Unless you go with elaborate signal conditioning, about the best you can do is to optimize the circuit while testing it with a consistent "clap"; you want repeatability for comparative testing, think something along the lines of a recording of a typical "clap", played back with a high quality sound system.
No need to go crazy with the high quality, but you want something better than a 2" speaker, say a system with a frequency response of around 100 Hz to perhaps 8kHz and reasonably flat. Keep the speaker/microphone distance and the volume the same each time. If you can, suspend both the speaker and microphone in the air; this will minimize reflections, which are hard to control. Again, you don't need to go "nuts" with this, just be aware it has a significant impact on sound. The main thing is to compare "apples to apples" while you optimize the circuit.
After you have your circuit pretty well optimized, try it out in reality. From there, you can experiment with locations within the room and the VR1 setting. You are working with a simple circuit to do what is in reality a complex task, so don't expect too much. But it is a fun project to do. Good luck.
Last edited: