Analogue electronics for a bat detector

I’ll admit up front that analogue electronics is not my strong point. Many years ago when I was at school, I had loads of fun making things out of nand and nor gates, inverters, flip-flops and so on, but I was never able to make even a simple op-amp circuit do anything useful. Fast forward a little to engineering courses at university I vaguely remember stuff about poles and zeroes but really it all passed me by. At that point I was so much more interested in software that all this stuff about resistors, capacitors and inductors seemed both dull and baffling. I was happy to leave that side of things to other people who actually enjoyed it. Since then I have not really had much to do with electronics of any sort. If I couldn’t do it with a keyboard and mouse, I didn’t bother.

Now though, all this Raspberry Pi stuff has got me interested in electronics again, and one of my projects – the ultrasonic bat detector – has one foot firmly in the analogue world. A while ago I bought some electret microphones which apparently have pretty good ultrasonic performance, but I know I need to amplify the output in order to get it into the digital world for processing.

I had looked around a variety of web sites for amplifier designs but found it very difficult to work out whether any of them would be any good for my needs. Given my track record with analogue electronics I was not looking forward to trying to make something using trial and error, either.

So I was delighted to come across Circuit Lab, a free tool which not only lets you draw circuits, and also has a library of other people’s designs, but vitally important for me it will also simulate the circuits including plotting a frequency response graph. Atter a bit of tinkering based on a BJT amplifier example I have worked my way to the following circuit:


When I use Circuit Lab to simulate the circuit I get this frequency response. It shows good gain at 20KHz-200KHz, the range I am interested in, and drops off relatively sharply down through the audible area to help prevent the bat sounds being swamped by stuff we can already hear.


Circuit Lab also provides a phase plot. You can see that there is a sudden sharp phase inversion. I’m not enough of an audio-phile to have an idea what this does to the sound, but I did adjust the component values a bit to push the phase shift up to about 250KHz, away from the usual range of bat sounds, just in case.


It doesn’t seem as if any of the components in this circuit will be hard to come by, so I might have a go at building it on a breadboard to see whether this will be the analogue circuit that I can make work!

Of course, if anyone is reading this and has any better circuit suggestions for a simple amplifier that does its best work between 20KHz and 200KHz, or any comments about this circuit, please let me know. Thanks.


  1. I think it’s quite likely that I may need to add something like that, just as I may need better amplification (this circuit is so simple that the only adjustment is via replacing components.)

    I am holding off from adding more analogue circuitry for the moment, though – it all depends how much I can do in the digital domain. If possible I plan to run a fast fourier transform (FFT) on the sampled data to convert it to the frequency domain, and just discard out of band data. I’m still not sure how much processing horsepower this will need, though.

    There are so many unknowns about this project!

  2. I’ve recently started doing the same. Found an android app, EveryCircuit, that does pretty much exactly what I wanted – seems slightly more user friendly than CircuitLab, but is more expensive. The free version has a limited workspace area, and the paid version is relatively steep (6 whole pounds!) but it may well be worth it. I’ll have a proper play with CircuitLab before I take the plunge though. They just need to add the Raspberry Pi component…

Leave a Reply

Your email address will not be published. Required fields are marked *