Monday, 18 September 2017

Bat Detector: electret microphones

Building your own Bat Detector is a relatively easy electronics construction project.

The tricky bit can be locating a suitable transducer or microphone that has a useful frequency response into the ultrasonic range used by common bats.

During the last few weeks I have been testing a number of devices, and here are my notes.


So this is getting embarrassing. I built a bat detector about 12 years ago, and every couple of years I re-discover it in some old cardboard box, and dust it off for a play. The last time was 2015, when I had high-hopes of getting it working properly and running it in an auto-detect/record mode.

I have to admit that my detector has never been very successful. Its built around the excellent design produced by Chris Eve, but a bat detector can only be as good as its transducer; the bit that picks up ultrasound and converts it to electrical energy.

This design calls for an electret microphone with a reasonable response at ultrasonic frequencies. Unfortunately electret microphones are designed for sonic frequencies, and are often quoted with an audio range of (say) 20-15kHz. I'm not aware of any retailer adding the note: this mic is also good for bat detectors.

However, my bat detector hasn't been a complete failure. It has detected bats flying around our back garden, but the range is probably only 10m or less. At least I detected a bat that was flying straight towards me, and by the time I spotted him in the darkness, he was probably about 5-6m ahead of me.

In the summer of 2015 I changed the microphone, but didn't see or detect any bats on those evenings I ventured out into the garden. I also tried leaving it running unattended, but there was a serious flaw in my auto-detect/record software which meant it was never going to work anyway.

transducer selection

I decided I needed to compare my stock of transducers. In the absence of a tame bat (which could squeak on demand) I looked around for alternatives. I had tried using an ultrasonic cat scarer in previous years, but these generally produce a relatively low ultrasonic frequency, typically below 25kHz.

At some point I read that piezo-electric transmitters will produce output at frequencies above and below their rated frequency. So I connected my trusty FG-100 signal generator to a 40T via a 470R resistor, and was pleasantly surprised to find it worked.

Note: The output from this transmitter is not going to be flat over my required frequency range, but at least I can compare one microphone with another to get a comparative view of suitability.

My test rig consists of two clothes pegs attached to a length of wood.

The transmitter is held between the jaws of one peg and points towards the second, which holds the device under test, and is connected to my Hantek scope. My scope can display a peak-to-peak voltage reading in addition to the actual trace of the received sine wave.

Initially I used the matching ultrasonic receiver to test that the transmitter was working. This transducer gave a large output voltage at the rated frequency of 40kHz, but did not register anything at 35kHz & below, and at 45kHz & above. I think I'd carried out an experiment like this some time ago, and had assumed that the transmitter had a very narrow response, and was therefore no use as a signal source.

For each electret mic tested, I provided power from a 9Volt PP3 battery via a resistor. It looks like microphone performance varies a small amount with supply current, but for this test I chose a 10k resistor.

Note: the 40kHz transmitter produces a huge sound pressure level when driven by a 10V square wave. It may be safer to use an amplifier between the mic and the scope, and then increase the distance between transmitter and mic, to reduce any risk of damage.

In my original build, using Chris Eve's circuit, I'd fitted a 10mm diameter electret microphone. With this mic I had detected bats at fairly close range (probably less than 10m). These 10mm diameter mic capsules are still widely available on the net.

In 2015 I replaced this mic with one I'd salvaged from a broken audio head-set (i.e. headphones with mic). This is a 6mm diameter by 5mm long electret microphone.

The test results below show this to be 2.5 times better at the transmitter's peak frequency of 40kHz than the 10mm dia device. But as already mentioned; due to a combination of bad luck and poor software design, I didn't hear or record any bats with this mic fitted.

I found a nice pair of USB Logitech headphones (which haven't been used in many years) so I broke them open and took out the electret mic capsule. This is also 6mm in diameter and about 3mm long. When tested, it seem to give an output at 40kHz that is 11 times greater than the 10mm mic.

I get similar results with 4 electret mics of unknown origin, which are 6mm diameter by about 4mm long (its difficult to be precise using a plastic rule!).

Its also worth pointing out that there is variability in my results due to several factors, including; poor sensor alignment, noise, and signals bouncing off the walls of my man-cave! Generally, if I can see a sine wave (shape) on the scope I use the voltage reading. If I can't (I just see noise), then I don't record anything.

The bat detector microphone (at least the one that is considered to be the best by many enthusiasts on the net) is the Panasonic WM-61A. It is 6mm diameter by 3.4mm long. I decided to buy a couple of these from a supplier on Amazon.

The results show this is the best performer, but the performance is quite similar to the three types tested with a diameter of 6mm and a length of 4mm or less.

signal capture

Having modified the software (I'll probably blog details later) I was able to capture bat calls on the first dry night that I set the system up...

The red underline pulses sound like "chirps" while the rest are rasping sounds least I assume they are bat calls.

I took a closer look at the captured waveform using Audacity. Zooming in on the pulses that sound like "chirps" I noticed the high repetition rate.

6 or 7 chirps in half a second: so rate is 12 to 14 per second

By zooming in further, I can measure the period within each chirp...

Typical period of approx 0.6ms

The 0.6ms period equates to a frequency of approx 1.667kHz. And as this has been through a divide by 32 chip, the frequency of each chirp is approx 53kHz. The frequency of this capture and the high repetition rate almost certainly means that it was made by a Soprano Pipistrelle bat.

The first Audacity display (which shows a 13s capture) probably indicates that the recorder was tripped as the bat was flying passed or away, and then the bat turned and came back closer to the detector.

For these recordings, the bat detector was hung out of the first floor window of my man-cave. It over-looks the roof of the kitchen, conservatory & garage. Although it has the benefit of height, its not a promising location, and I'm sure I'd get more action in the garden, nearer the pond.

On nights where its been chucking it down with rain, I have not set up the bat detector as its not rain-proof. On nights where the rain has been light and intermittent, I don't seem to detect anything. But on dry evenings, with only light winds, I always seem to capture something.

My bat detector (used for these captures) is using the 6mm x 4mm mic (i.e. not the WM-61A which may give better sensitivity or frequency response). It also uses a TL041 quad amp rather than the wider bandwidth MC33079 recommended by Chris Eve. So there are a few improvements I've yet to make to the detector.


If you can get hold of a Panasonic WM-61A at a reasonable price, this is probably the one to go for. I paid about £15.50 for two (minimum quantity) so they were about £8 each. However, it looks like any electret microphone capsule that is 6mm in diameter by no more than 4mm long is worth a try.

I still have some very cheap 6mm diameter x 2mm electret mics on order, which won't arrive until October. When they do, I will update my results.

 Panasonic WM-61A on Amazon
 MC33079 available from BitsBox

No comments:

Post a Comment