My bat call logger combines a frequency division bat detector with a Pi based audio recorder.
Recordings are simply triggered by a short stream of pulses from the detector (i.e. "activity").
Having spent a bit of time trying to optimise the hardware, I now need to document what I've done, before I forget why I've done it!
I'm still not sure if I've fully optimised the hardware, but documenting systems sometimes causes you to think again and recognise any short-comings. This was certainly the case while I was re-checking the hf filter response.
Bat Call Logger block diagram |
The transducer, hf amp/filter and frequency divider are located in the detector box. An audio cable connects the detector to the attenuator, which is located inside the case containing the headless Pi. The Adafruit module is stuck to the Pi case with a piece of BlueTak ...nice!
Chris Eve's detector circuit
Chris's original web pages, covering his bat detector design, disappeared from the internet a few years ago. This is my cut/paste job from his original circuit.
As mentioned in this earlier post, the Panasonic WM-61A was among the best performing electret microphones that I tested. However, other 6mm diameter mics often perform well at ultrasonic frequencies.
The diode D1 will probably reduce available battery voltage by about 1Volt. As this circuit runs on a split supply of +/- 4.5Volts (created by U4) you may want to consider whether it is really required. As the battery voltage drops over time, I found that the circuit can became unstable at low voltages. I have switched from using a PP3 battery to 6 x AAA cells with a wired-in battery holder. So the chances of me putting all 6 batteries the wrong way around is (I hope) slim!
General purpose capacitors are often low accuracy. For a forth-order filter like the one used in this design, you should use close tolerance resistors & capacitors, so for best results the following components should have (say) a 1% tolerance; R3-6 and C2-7
I'm currently using poor accuracy capacitors and a TL074 quad op-amp. I tested the filter response by removing the microphone and injecting a sine wave via a 470k in series with a 1k to common. The junction of these 2 resistors was connected to the amp (i.e. the point where the mic is normally connected).
I assessed the output at each frequency with my Hantek scope/pc module, making due allowance for the background noise level.
The blip in the response around 20kHz is rather strange, but probably due to wide capacitor tolerances.
On the hf side, the sensitivity is -6dB at about 50kHz, which confirms Chris Eve's comments on his original circuit about frequency response when using the TL074. At 100kHz the response is -18dB (that's half of half of half the output at 30kHz).
...so I just had to take out the TL074, fit an MC33079 and repeat the tests.
The improvement is quite dramatic. The hf -6dB point is now about 70kHz, and at 100kHz the response is only about 9dB down. Or put another way, the response at 100kHz is now as good as it was at 60kHz with the old chip.
Another thing I noticed was the background noise, which was 4 times greater when using the TL074. The gain also appears higher with the MC33079, although I did not take any proper comparative measurements.
frequency division
The cmos 4024 is used to divide the frequency down, bringing the bat calls within the range that we simple folk can hear. It provides a choice of outputs including; divide by 8, 16 and 32.
I'm not sure if there is an optimal choice, but I'm currently using the divide by 8 output for the logger, while the divide by 16 output is still connected to the on-board audio amp (which I'm not really using, except to test that the unit is "live").
Yellow trace is 40kHz signal from detector. Green trace is divide by 8 output from divider. |
Therefore a 40kHz signal is lowered to 5kHz for the benefit of the bat logger, and down to 2.5kHz for the on-board amplifier.
Attenuator
This simple circuit drops the signal level from the frequency divider (divide by 8 output) for compatibility with the Pi and the Adafruit audio to USB module.
The output from the frequency divider is about 5V when running on fresh batteries, so a 47k resistor is used to limit the current flowing into the gpio pin. This input is monitored by a Gambas bat logger program, which counts transitions to determine whether there is a bat call that should be recorded.
The 47k/10k voltage divider simply lowers the signal to suit the Adafruit module's mic input. Since the Adafruit provides phantom power for direct use with a microphone, I've added the capacitor to block d.c. and a 2k2 load resistor as a substitute for the missing mic.
conclusion
Having replaced the TL074 with an MC33079, I noticed that the flashing l.e.d. (originally fitted to indicate that the unit was running) was creating interference. That is to say that the unit is now more sensitive, and so either the oscillator or the switch in the l.e.d. module is now a problem, and has been cut-out.
The detector box still has an audio amplifier with speaker which I don't really need when using the unit as part of a logging system. Its consuming battery power, so ideally I need to rebuilt the unit into a smaller plastic box, minus the audio components.
All I need now is a couple of dry nights so I can test the unit on real bats!
No comments:
Post a Comment