Worried About Bats In Your Belfry? A Tale Of Two Bat Detectors

As somebody who loves technology and wildlife and also needs to develop an old farmhouse, going down the bat detector rabbit hole was a journey hard to resist. Bats are ideal animals for hackers to monitor as they emit ultrasonic frequencies from their mouths and noses to communicate with each other, detect their prey and navigate their way around obstacles such as trees — all done in pitch black darkness. On a slight downside, many species just love to make their homes in derelict buildings and, being protected here in the EU, developers need to make a rigorous survey to ensure as best as possible that there are no bats roosting in the site.

Perfect habitat for bats.

Obviously, the authorities require a professional independent survey, but there’s still plenty of opportunity for hacker participation by performing a ‘pre-survey’. Finding bat roosts with DIY detectors will tell us immediately if there is a problem, and give us a head start on rethinking our plans.

As can be expected, bat detectors come in all shapes and sizes, using various electrickery techniques to make them cheaper to build or easier to use. There are four different techniques most popularly used in bat detectors.

 

  1. Heterodyne: rather like tuning a radio, pitch is reduced without slowing the call down.
  2. Time expansion: chunks of data are slowed down to human audible frequencies.
  3. Frequency division: uses a digital counter IC to divide the frequency down in real time.
  4. Full spectrum: the full acoustic spectrum is recorded as a wav file.

Fortunately, recent advances in technology have now enabled manufacturers to produce relatively cheap full spectrum devices, which give the best resolution and the best chances of identifying the actual bat species.

DIY bat detectors tend to be of the frequency division type and are great for helping spot bats emerging from buildings. An audible noise from a speaker or headphones can prompt us to confirm that the fleeting black shape that we glimpsed was actually a bat and not a moth in the foreground. I used one of these detectors in conjunction with a video recorder to confirm that a bat was indeed NOT exiting from an old chimney pot. Phew!

The Technology

A great example of open source collaboration and iteration in action, the Ardubat was first conceived by Frank Pliquett and then expanded on by Tony Messina and more recently, simplified by Service Kring (PDF).

The Ardubat is a frequency division detector based on a TI CD4024 chip, fed by two LM386 amps. Bat detections are sent to an SD card which can be analysed afterwards to try and get some idea of the species. However, since this circuit works by pre-distorting the analog signal into a digital one and then dividing down, none of the amplitude information makes it through.

BAT DETECTOR 2015, simplified version of Ardubat developed by Service Kring.

The Bat Detector 2015 is again based on the CD4024, but uses a compact four channel amp, the TL074CNE4. Three of the channels feed the frequency divider chip and the fourth is a headphone amplifier. It’s a very neat design and the signal LED is fed directly from the CD4024. It comes as a complete DIY soldering kit for about $10 including postage. Yes …. $10 !!!

One of the biggest limitations with these detectors is the ultrasonic sensors themselves, which typically have a frequency response similar to the curve shown here. More recently, ultra-wide range MEMS SMT microphones have been released by Knowles, which work well right up to 125,000 Hz and beyond! Some bats, most notably the Lesser Horseshoe, can emit calls of up to 115,000 Hz. However, these older style sensors are incredibly good at detecting about 90% of the bats found here in the UK and are much more sensitive than heterodyne detectors.

 

The ‘professional’ option that I chose was the UltraMic384 by Dodotronics , which uses the Knowles electret FG23629 microphone with a 32-bit integrated ARM Cortex M4 microcontroller, capabable of recording up to 192,000 Hz in the audio spectrum. There are also some good DIY Hacker options such as the Audio Injector Ultra 2 for the Raspberry Pi, which can record at up to 96,000 Hz — but this is not quite good enough for all bats. Be aware that sampling rate is twice the audio frequency which can be quite confusing. An UltraMic sampling at 384 KB/s will record at 192 KHz.

These types of Full Spectrum devices can produce high resolution sonograms, or spectrograms using Audacity software. This is very helpful for wildlife enthusiasts who want to know what the actual bats species is, although even with the best tech, it’s still sometimes very difficult or impossible to determine species, especially within the Myotis genus.

So now we are fully equipped to check for bats in the derelict building using the DIY detector in conjunction with a video camera and a few pairs of human eyeballs. The full spectrum detector will be set to record right through the night and be used to check if there’s any activity we might have missed and tell us at the very least what genus the bats are.

All we need now is some Machine Learning to automatically identify the species. ML is a new frontier for bat detection, but nobody has yet produced a reliable system due to the similarity in the calls of different species. We know neural networks are being applied to recognize elephant vocalizations and the concept should be applicable here. A future project for an intrepid hacker? As for the Ardubat – it’s crying out for a better microphone, if not the expensive FG23629 then the 50 cent Knowles SMT SPU0410LR5H, which also has a great frequency response curve.

[Main image: Myotis bechsteinii by Dietmar Nill CC-BY-SA 2.5]

33 thoughts on “Worried About Bats In Your Belfry? A Tale Of Two Bat Detectors

  1. What I would like to have is not so much a detector that would tell me if there are sounds or not, or recorder, that would let me look at the waveforms, but some kind of real-time translation into audible range, so that I could listen to the sounds made by animals who are not normally audible, such as hamsters, rats, etc. (and maybe also locate those broken phone chargers that make me sick).

    1. In the sixties Popular Electronics had a project that simply heterodyned ultrasonic frequencies down to audio frequencies. Very simple, and you could listen. I can’t remember if they were thinking of animals. I think they used an uktrasonic microphone intended for tv remotes, but can’t remember. Just a mixer, oscillator and audio amplifier.

      Michael

      1. Ah, yes. The good old days of simple electronics. My dad had a big selection of Popular Electronics, although he did know anything about the subject; I think it was to influence me as a youngster at the time, and it sure did. I am now an electronic engineer. Anyhow, back to the topic… The article explained (and had pictures) that various electronic devices emit frequencies beyond human ability, e.g. the common radio receiver (think local oscillator). I was fascinated by the idea of listening to inaudible sounds. Many years later I became a radio HAM and came across a similar idea, but this time the signal of interest was mixed up in frequency instead of down; this was to listen to sounds in nature such a trees and other low frequency sounds (below human hearing range). Ah, those were the childhood years when there were so many things to be discovered…

  2. A far better program for working with bat sounds than Audacity is Kaleidoscope: https://www.wildlifeacoustics.com/products/kaleidoscope-pro
    The free version does not automatically identify bats but it does a great job of visualizing the calls. You can quickly move between calls, adjust for noise, remove silence between calls, show analysis of call frequencies and timings and show zero crossing details. It can convert to other formats as well.

    You can also play back calls at slower speeds so you can actually hear how cool and sometimes birdlike they sound.

    Sky Puppies!

  3. I agree that bat call identification is ripe for neural networks. Amazing apps like iNaturalist, Seek, and Merlin are using Tensorflow to identify everything in nature from photos and those apps are getting better every day. I’m using Tensorflow to separate bats from moths, clouds and wind blown leaves in 30,000 near infrared photos every night.

    But sound is so far the best way of identifying bats to species. The tools are there; it just needs someone to do the work and not hide it behind a $2000 paywall.

  4. Sky mice! We have to cover things up over nite in the shop, one drop on new copper and there is a black spot later. Sometimes they leave a bunch of droppings about a foot away from the toilet bowl. Good try, but miss.

      1. That’s very similar to rabies in the USA and is treated with the same vaccine. While all bat species can carry it, that does not mean that all individual bats carry it. The occurrence rate looks similar in both countries; in the low percentages. Rabies can be carried by other mammals and handling any wild animals in the US is not advisable. People who handle bats for study always get the vaccine.

        In the US, we don’t have fruit bats so the mess outside is not noticeable compared to bird poop. Bats do not belong indoors and should be kept out.

  5. “Be aware that sampling rate is twice the audio frequency which can be quite confusing.”

    Not really, the actual reason is quite simple: Above half the sampling rate it’s impossible to determine if a frequency is the base frequency or one that happens to intersect the same sampling points during the measurement. Below half the sampling frequency you have enough data points to be certain the waveform you are measuring is actually there.
    (https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem)

  6. Why does the first version use an audio power amp – LM386 – as a low power microphone preamp? The TL074 of the second version is a better choice. I would even look for a single supply 5V rail-to-rail OPV for this purpose.

    1. The first version was designed some years ago when the ‘go to’ amp was probably the LM386. The only problem with the TL074 is that according to the datasheet it will only handle up to 100 KHz. That said, datasheets tend to underestimate the performance of the product so it could well get better frequency resonse than that?

    2. If that’s the one that uses digital division, then it simply doesn’t matter. The circuit goes for ridiculous amounts of gain, fully square-waving the signal on purpose. So it’s like 100% distortion. Whatever amp you put up front is about the same as long as it’s fast enough…

    3. An even better choice is the lowly MCP6004 op amp because you can run it off of a couple of AAA batteries. Years ago I bought a cheap division bat detector on Amazon that used the MCP6004, a mems microphone and two AAAs. Works great.

        1. Maybe, but cascading three of the op amps in the quad would help with the bandwidth. Besides, for this application the waveform does not need to be perfect. In fact it should be able to work perfectly in spite of considerable distortion.

          By the way, the detector I bought was the first version of the Batseeker. It was interesting because, though it worked well and was thoughtfully designed, it looked like the PCB was hand etched and the unit assembled in someone’s garage. It appears they are up to version 4 with a vastly improved sound but still made by a small Canadian and sold at a very reasonable price. The case is now 3D printed, which should please Hackaday readers.

    1. Wow …… You’re literally at the conference and just discovered this valuable resource. Upvote +1 !

      No doubt this random forest implementation will be a lot better than my effort, which did work ok but is not particularly accurate.

      Thanks !!!

        1. That will definitely be useful and interesting.

          Thanks for the above link to the detection/classifications paper. I’ll see if I can get it to run. One of the barriers to this in the US is the lack of a large library of identified and verified full spectrum recordings to use for training the neural network.

          1. I managed to get the labeling program from the link to work well on Windows 10. Produced about 275 features and segmented to each and every call, so loads of data! I then swapped to Ubuntu 18 for training and I ran the first R script ok (write_tabase3HF) but failed on the second. I put an issue up on Github here: https://github.com/YvesBas/Tadarida-L/issues/3

            I guess I should install R on Windows 10 and try again.

            Yes, data is very hard to get hold of, even unverified. I spent quite a bit of time recording the 5 species of bat where I live using one of Ivanos mics at 384KHz and got a lot of help on the facebook group “Bat Call Sound Analysis Workshop” on verification of Nattereras and Brown long eared. If you want my data I can put it on google drive if you pm me: patrickwhetman@hackaday.com (This address will be here for 7 days and then erased). Although not particularly well organised, the recordings are good quality – no artifacts or distortion.

          2. Hmm, I guess hackaday doesn’t allow replies beyond a depth of five.

            Pat, thanks for offer of data but I think I will try to produce some for my area of the US instead of Europe. I’m sure others will take advantage of your kind offer.

            Thanks for the link to the Facebook group. Though the activity in the group seems mostly European, some of the experts have worldwide knowledge. I’ll give them a try. I have had some luck on iNaturalist with identification as well.

            It amazes me how keen people over there are about bat ID. There is plenty of interest in the US but it never seems to coalesce into group activity other than high cost research. In the long run I’d like to see widespread low cost automated bat identification kind of like Purpleair does for air pollution. Some animated migration maps for bats like Cornell does for birds would be fantastic.

  7. Hey where did my reply go…..

    You could also try to build the Teensy Batdetector. Manu features in a compact enclosure.

    Here a video about the posabilities.
    https://www.youtube.com/watch?v=MyUJJQFP5m8&t=74s

    Manual and building instructions here.
    https://drive.google.com/drive/folders/1NRtWXN9gGVnbPbqapPHgUCFOQDGjEV1q?usp=sharing

    Or if you want to use like an USB microphone, try to cnnect a SPU0410LR5H-QB microphone to an ALC4040 soundchip (usb-headset adapter) this can record up to 96kHz whis is high enough for most bat species.

Leave a Reply to deshipuCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.