Author Topic: Want to hear the bat flying in the front yard  (Read 8396 times)

0 Members and 1 Guest are viewing this topic.

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6186
  • Country: ro
Want to hear the bat flying in the front yard
« on: August 02, 2021, 12:02:13 pm »
A bat keeps flying almost every night above a certain piece of green yard, right in front of the building, at about the same level with the balcony, so quite close (no more than 10-30 meters, or 30-100 feet in straight line).  The drawback is this is inside the city, so during the night it might be more noise pollution than in the wilderness.

Would like to DIY an ultrasonic receiver, only for the fun of it, so without buying a dedicated ultrasound microphone.  Already having around:

- a few analog electret microphones, mostly from former mobile phones or former headsets
- about 10 of HC-SR04 ultrasonic sensors that can be used as donors for microphones, or even for a directional array
- some piezo discs from singing postcards and toys
- a very old ultrasonic-remote receiver board from an old TV (don't know the model)

Mostly concerned about the available signal to noise ratio (inside a city) and the expected power levels (if there is any hope such microphones would be sensitive enough).  The frequency range is said to be between 20kHz-160kHz, but mostly the signals would be expected to be around 50KHz or so.

Any chances to receive the bat's echolocation signals with microphones like the ones in the list?

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: Want to hear the bat flying in the front yard
« Reply #1 on: August 02, 2021, 12:25:52 pm »
I believe electrect microphones are the best.

Piezo discs from greetings cards have a resonant spike at around 30kHz and the HC-SR04 and old remote controls have a peak at 40kHz.

Do you plan to record the sound, or down convert it to the audiable range? Either way you'll need to high pass filter it at 20kHz, or whatever the lowest frequency of interest is. Down conversion can be done the old fashioned way, by heterodynining, or digital signal processing.

 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6186
  • Country: ro
Re: Want to hear the bat flying in the front yard
« Reply #2 on: August 02, 2021, 02:38:36 pm »
From wikipedia it appears to be many types of receivers for bat sounds: https://en.wikipedia.org/wiki/Bat_detector

- heterodyne/superheterodyne (local osc mixed with the Rx signal, so all analog)
- frequency division (amplify to square wave, then use a digital counter/divider to shift down the frequency)
- time expansion (high speed digital sampling and recording then playback the recorder samples but slower, so no real time audio)

Not sure yet how to post process the signal.

At first it would be great only to test if any signal at all can be received, so just the ultrasound mic and an analog amplifier in the 12kHz ... 160 kHz band.

Can test these two in the field, with a DS202 hendheld oscilloscope to see if anything at all can be received.  The DS202 mini oscilloscope has 1MHz analog input band with 1Mohm impedance input, min 20mV/div, max 10MSa/s (also has a signal generator output, 10Hz~1MHz square wave duty adjustable or 10Hz~20Khz Sine/Square/Triangle/Sawtooth wave, might be usable as a local oscillator to improvise a heterodyne but I don't have any connector that fits).

Good point about sensor resonances, thanks!   :-+
(could test for that in the lab at first, to eliminate the worst candidates)

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
Re: Want to hear the bat flying in the front yard
« Reply #3 on: August 02, 2021, 06:02:15 pm »
I know you didn't want to buy another microphone, but just to say you can get MEMS mics pretty cheap now, including on carrier PCBs e.g. eBay auction: #114874902126

There are also some homebrew projects already out there:

Rasp Pi http://pibat.afraidofsunlight.co.uk/
Teensy https://www.teensybat.com/

 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6186
  • Country: ro
Re: Want to hear the bat flying in the front yard
« Reply #4 on: August 02, 2021, 08:01:18 pm »
Somebody else PM-ed about a MEMS microphone, too, https://www.digikey.com/en/products/detail/pui-audio-inc/AMM-3742-T-WP-R/14289962 with very good response around 50kHz and above, indeed, but I don't think I have any analog MEMS based mikes.

Might be a few MEMS mikes through the scraped parts boxes, but AFAIK those were with digital output only, and not sure if their sampling rate would be high enough to record at 50kHz or more.  Never tested any of those digital MEMS microphones.  Should look for some analog MEMS microphones, but not sure if I have any.

Tested today some miniature speakers and the piezo discs from singing post cards.  Nothing promising so far.  The speakers doesn't play well at more than a few kHz, and the piezo disks have some strong resonance peak at approx. 7kHz and multiples, but above 30kHz couldn't get any signal with them.   ???

Searching the scrap boxes for electret microphones now.  Would search for any MEMS mikes, too.

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: Want to hear the bat flying in the front yard
« Reply #5 on: August 03, 2021, 07:45:41 am »
Somebody else PM-ed about a MEMS microphone, too, https://www.digikey.com/en/products/detail/pui-audio-inc/AMM-3742-T-WP-R/14289962 with very good response around 50kHz and above, indeed, but I don't think I have any analog MEMS based mikes.

Might be a few MEMS mikes through the scraped parts boxes, but AFAIK those were with digital output only, and not sure if their sampling rate would be high enough to record at 50kHz or more.  Never tested any of those digital MEMS microphones.  Should look for some analog MEMS microphones, but not sure if I have any.

Tested today some miniature speakers and the piezo discs from singing post cards.  Nothing promising so far.  The speakers doesn't play well at more than a few kHz, and the piezo disks have some strong resonance peak at approx. 7kHz and multiples, but above 30kHz couldn't get any signal with them.   ???

Searching the scrap boxes for electret microphones now.  Would search for any MEMS mikes, too.
It looks like a MEMS microphone is the way to go.

Regarding the piezo disc: the resonant peak is very sharp, so I wouldn't recommend it anyway. I'll have to test some piezo discs I have at the moment. It was awhile ago, when I did it, so it might have just been lucky with the ones I had back then.
 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6186
  • Country: ro
Re: Want to hear the bat flying in the front yard
« Reply #6 on: August 03, 2021, 08:46:27 am »
About the piezo discs, mine are much bigger than the average piezo discs we see nowadays.  The ones I tested are 5cm (2 inch) in diameter, and the setup wasn't very careful (for example the audio amplitude can vary a lot by simply putting a little tension on the disks (bending them a little from the sides), etc.

I'm using them now only as a piezo speaker, to evaluate other (electret for now) mikes.

So far i seems like an electret mike would do it, and the size does matter again.  The ones of about 5mm in diameter are doing much better than the 8mm ones (when it's coming to ~50kHz or higher).

Last night found a 5mm electret mike that can go up to 110kHz (with the same big piezo disks to generate the testing ultrasounds  :-// ) only to realize later that the signal I was seeing on the oscilloscope was caused by induction (radio) and not by ultrasounds.   ;D

I need a much careful measuring setup.
Couldn't see any bats last night.

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: Want to hear the bat flying in the front yard
« Reply #7 on: August 03, 2021, 10:48:57 am »
If the piezo disc isn't a very good microphone, at ultrasonic frequencies, then it will also be a poor speaker. How do you know it's producing any ultrasound?
 

Offline nfmax

  • Super Contributor
  • ***
  • Posts: 1560
  • Country: gb
Re: Want to hear the bat flying in the front yard
« Reply #8 on: August 03, 2021, 01:49:46 pm »
A good way to generate ultrasound, so I am told, is to jingle a bunch of keys in front of the sensor
 

Offline Gary350z

  • Regular Contributor
  • *
  • Posts: 240
  • Country: us
Re: Want to hear the bat flying in the front yard
« Reply #9 on: August 03, 2021, 07:56:24 pm »
A good way to generate ultrasound, so I am told, is to jingle a bunch of keys in front of the sensor

I have done this. It makes ultrasonic receivers go crazy.
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
Re: Want to hear the bat flying in the front yard
« Reply #10 on: August 03, 2021, 08:10:46 pm »
You'll be suprised what generates ultrasound - a biscuit or crisp packet is also pretty good.

I do have a cheap-ish hetrodyne bat detector which my wife bought me as a birthday present. I went for a walk with it one night but couldn't work out what the "chink chink chink" sound was that I could hear in my headphones. As it turned out it was the small metal tab of the zip on my jacket tapping against the zip's metal teeth.

The detector unit itself is OK but noisy as hell, it's like a small radio with no antenna. It's one of my "maybe one day" projects to make something a bit better.
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9485
  • Country: gb
Re: Want to hear the bat flying in the front yard
« Reply #11 on: August 03, 2021, 08:23:41 pm »
A good way to generate ultrasound, so I am told, is to jingle a bunch of keys in front of the sensor

Even simpler, rub your thumb and fingertip together. The ridges riding over each other produce abundant ultrasound without all the loud audible jangling that you get with keys.
Best Regards, Chris
 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6186
  • Country: ro
Re: Want to hear the bat flying in the front yard
« Reply #12 on: August 04, 2021, 05:29:21 pm »
If the piezo disc isn't a very good microphone, at ultrasonic frequencies, then it will also be a poor speaker. How do you know it's producing any ultrasound?

The piezo disc might work better with a high impedance input preamplifier than with the 1M\$\Omega\$/13pF of the oscilloscope input.  I was using the probe in 1x mode to get the max sensitivity of 500uV/div from the scope.

To see if what's seen on the oscilloscope is indeed the ultrasounds and not just induction from wires it's enough to block the space between Tx and Rx with a piece of foam.  Also, when the distance changes, for example by slowly moving the Tx back and forth, the phase shift can be seen on the oscilloscope.

It's funny to observe the ultrasounds' wavelength by slowly moving the piezo disc back and forth while watching on the oscilloscope how the reference sine wave from the generator and the received sound slides with the move.   :)




The non-repetitive ultrasound sources are hard to measure without a preamplifier.  For now I am doing the lock-in amplifier trick with the oscilloscope (synchronous detection + averaging) so signals as small as tens of \$\mu V\$ coming directly from the sensor can be easily observed.

I didn't make any preamplifier yet because I was not sure which type of sensor will work better with ultrasounds.  So far the winners seem to be electret microphones scavenged from decade old mobile phones.  The smaller diameter ones are the best.

The only MEMS mikes I have are from very recent phones, so it is expected that they'll have local preamplifiers integrated with the MEMS, and they will be limited to the audio only band, if not voice only.

Looking through the opamps stash, I found only lame generic opamps 741-like, needing at least 10V supply to run and with a slew-rate that is too small for 160kHz.  So, to make the specs for a preamplifier opamp:
  • - working at a supply voltage of 3V or lower, so it can run from a single cell Li-ion battery, 3...4.2V, without any voltage step-up converters

  • - able to output 3Vpp at 160kHz.  This is rare with general purpose opamps because of the slew-rate needed to output a sinusoidal signal of, let's say, 3Vpp at 160kHz.

    (Trying some \$LaTeX\$ on EEVblog, to show (off) the finding of required slew-rate for such a signal)   :P
    The instantaneous voltage \$v_i\$ at any moment \$t\$ is given by the generic formula of the \$harmonic\ oscillator\$:
    \[
    v_i(t) = A_0 \cos(2 \pi f t + \phi_0)  \tag{1}  \label{eq:n1}
    \]
    where \$A_0\$ is the \$amplitude\$ of the signal, \$f\$ is the \$frequency\$, \$\phi_0\$ is the \$phase\$, and \$t\$ is the \$time\$.  The phase doesn't matter in regard to the maximum slew-rate.  Thus, \$\eqref{eq:n1}\$ becomes:
    \[
    v_i(t) = A_0 \cos(2 \pi f t)  \tag{2}  \label{eq:n2}
    \]
    By definition, the first derivative corresponds to the slope, or the slew-rate in opamp language.  To find the max slope for the signal means to find the max of the derivative of \$\eqref{eq:n2}\$, which derivative is:
    \[
    v'_i(t) = A_0 2 \pi f (- \sin(2 \pi f t))  \tag{3}  \label{eq:n3}
    \]
    Since any \$\sin(x)\$ is bounded between -1 and 1, the max slope, or slew-rate, \$SR_{max}\$ of the signal is:
    \[
    SR_{max} = \left|v'\right|_{max} = A_0 2 \pi f  \tag{4}  \label{eq:n4}
    \]
    Plugging the numbers in \$\eqref{eq:n4}\$:
    \[
    SR_{max} = 1.5V \cdot 2 \cdot 3.14 \cdot 160kHz = 1.507\ V/\mu s
    \]
    so the opamp should have a slew rate of at least \$1.5\ V/\mu s\$.

  • - be available at hand.  With such specs, I could find so far only comparators through the scrap boxes:
       - LM393 - dual comparator, open collector, min supply 2V
       - TCA520 - opamp/comparator, TTL output compatible (so good current sinking but low current when sourcing), min supply 2V, SR max 25V/us




- Anybody tried using LM393 or TCA520 as amplifier?
- Is there any chance to make them stable, or better just make a preamplifier with discrete transistors?
« Last Edit: August 04, 2021, 07:09:08 pm by RoGeorge »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6761
  • Country: pl
Re: Want to hear the bat flying in the front yard
« Reply #13 on: August 04, 2021, 08:19:33 pm »
4. Gain bandwidth product ;)

Old 5534 would work and provide a bit of gain (60MHz GBW) but not at 3V.
AD8397 is a viable alternative for 3V rail to rail operation but not as cheap.
There are some older National LMHxxxx parts, bipolar and low voltage, but they could be noisier - not sure what the requirements are with those mics.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Want to hear the bat flying in the front yard
« Reply #14 on: August 04, 2021, 08:34:28 pm »
The ultrsound transducers SR04 are not good as a microphone, because they are very resonant. But they should be good for a US test source to than check the electret mics.  Some of the small electret mics work surprisingly well. As the university I had one (sennheiser 4.8 mm diameter) that showed response to 100 kHz (limit of the Lockin used for detection). However not all are suiteable: often there is an internal capacitor to reduce the higher frequency response to get a flatter curve. Otherwise the internal resonance makes the gain go up at the higher audio band. I would mainly check the mics < 5 or 6  mm. The larger one usually don't work as the self resonance of the membrane is to low and thus the low pass filtering needed.

The phase shift from a changing distance is quite indicative for having US and not electric coupling.

The LM393 has a chance to also work as amplifier, at least with high gain (e.g. G > 10). Definitely only use 1 channel and have bias curent / resistor at the output and little capacitve load to the output (relatively high ouput impedance).

 A discrete transistor amplifier is likely easier and more predictable and also lower noise. At higher frequency the signal from the mic may be quite small, but the noise gets also often quite low.

Chances are the LM393 could be higher noise (e.g. similar to LM358) than the microphone at higher frequencies (e.g. 10 kHz). I would expec a noise level of some 10-20 nV/sqrt(Hz) at 10 kHz for the electret mic, with mainly an 1/f  increase to lower frequency. So no need to go super low noise, but also not that much. I rememer that for the amplifier after the mic it made a difference going from an LF356 to OP27, though not very much. There is essentially a small JFET source follower inside, often a bit larger (lower noise) then the 2N4117, but not much.
 

Offline Harm314

  • Newbie
  • Posts: 6
  • Country: nl
Re: Want to hear the bat flying in the front yard
« Reply #15 on: August 06, 2021, 01:07:59 pm »
I have a low-end bat detector kit from Franzis Verlag:

https://www.franzis.de/search?sSearch=fledermaus, https://www.amazon.com/Franzis-Make-your-Detector-Manual/dp/3645652760/ref=sr_1_5?dchild=1&keywords=franzis+bat+detector&qid=1628254669&sr=8-5.

I have the older (green box) version, the newer version needs even less (no?) soldering. 

For the bats that fly over my back yard (Wester Europe/Netherlands), it does the job of making the ultrasound audible, including the switch from 'search' clicks to 'attack' mode. Great fun together with my boy on a summer evening.

It's quite simple, built around a CD2003GB, with an LM3861 and an NE555.
 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6186
  • Country: ro
Re: Want to hear the bat flying in the front yard
« Reply #16 on: August 07, 2021, 11:11:49 am »
Cobbled a 100x preamplifier with a TCA520 OpAmp/Comp, to ease the mikes measurement and selection.  It works fine at 3.3V.  Found an electret mike from a former Motorola 8700 that still works even at 200kHz.   :o

Used the Tx to Rx distance variation to be sure it's ultrasound what the oscilloscope shows, and not radio.  Had some fun playing around with ultrasounds, observing the direct wave, the reflected wave, and then the interference pattern between the direct and the reflected wave.  The setup can easily detect my own movement near the workbench, but have you ever seen a breadboard with wheels?   ;D






For the bat detector, not sure which one to build first:
- a preamplifier to square wave, then use a digital divider by 16
- a heterodyne
- maybe use a logarithmic preamplifier as amplitude compressor, for more sensitivity?

By looking at the expected spectrum, some species emit a signal as wide as 80kHz (e.g. see page 11 of 19 from https://rss.onlinelibrary.wiley.com/doi/pdf/10.1111/rssc.12217 or fig.2 in https://acoustics.org/pressroom/httpdocs/154th/aytekin.html etc.), so how will a heterodyne translate 80kHz wide bandwidth into only a few kHz of human hearing?   :-//

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Want to hear the bat flying in the front yard
« Reply #17 on: August 07, 2021, 12:23:09 pm »
The simple heterodyne can only convert some 20-30 kHz of BW around the local oscillator. One has both band of tone mixed up and mixed down, but no more than twice the audio band. For most used this is still Ok. If needed one could to a 2nd channel for stereo with a 2nd LO.

The divider part is tricky, as it only wirks with the strongest signals.
The dynamic range is likely OK and no real need for compression, at least not for the start.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4766
  • Country: nr
  • It's important to try new things..
Re: Want to hear the bat flying in the front yard
« Reply #18 on: August 07, 2021, 01:15:09 pm »
I would amplify the mic and feed the signal into an MCU, something like stm32 (with at least 12bit adc and single precision fpu).. And DSP the signal then.
With 2 mics attached you may even create a bat-position-visualizer then (showing the bat flying on an LCD screen)..
 :D
« Last Edit: August 07, 2021, 01:22:23 pm by imo »
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2389
  • Country: gb
  • Recovering Electrical Engineer
Re: Want to hear the bat flying in the front yard
« Reply #19 on: August 07, 2021, 04:55:21 pm »
A staright forward hetrodyne down converter using a balanced mixer is a good place to start. https://www.google.co.uk/url?sa=i&url=http%3A%2F%2Fwww.magenta2000.co.uk%2Facatalog%2FBat%2520Detector%2520Mk2%2520Kit%2520Assembly_Farmer.pdf&psig=AOvVaw2tBERHW6ScMRQv1LMA9UJn&ust=1628441407046000&source=images&cd=vfe&ved=0CAgQjhxqFwoTCLjN1Y6vn_ICFQAAAAAdAAAAABAI   
You can also sample the amplified signal and pitch shift it thus: http://www.technoblogy.com/show?1L02 increase the clock to suit.
Either way you need to compensate for the horrible frequency response of your piezo.
Most bat detectors have a tuning control to select the frequncy band. Bandwith compression is not for the faint hearted.  It cannot be done in hardware as far as I am aware.
FPGA boys???
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19494
  • Country: gb
  • 0999
Re: Want to hear the bat flying in the front yard
« Reply #20 on: August 07, 2021, 08:49:46 pm »
Regarding the modulator: what's wrong with just using a simple BJT LC oscillator, with the signal going to the base to change the transconductance, thus the amplitude?
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6959
  • Country: ca
Re: Want to hear the bat flying in the front yard
« Reply #21 on: August 08, 2021, 07:16:01 am »
Popular Electronics Electronic Experimenter's Handbook 1982 pg. 76 has this simple ultrasonic detector project. It uses old TV remote control piezo ultrasonic sensors and oddball TBA231 op-amp.
 

Online RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6186
  • Country: ro
Re: Want to hear the bat flying in the front yard
« Reply #22 on: August 09, 2021, 10:18:26 am »
Thanks for that Popular Electronics schematic, had one of those "Aha!" moments because of it.  :-+

That was because there is no obvious multiplier (or frequency mixer) there, so how does it shifts the spectrum from ultrasounds to audio?  C5 and C10 only adds the ultrasound signal \$f_x\$ with the local oscillator \$f_{LO}\$.  An adder does not produce new frequencies.  If we add two frequencies \$f_x\$ and \$f_{LO}\$ we do NOT get any \$f_x - f_{LO}\$ like we get from a normal mixer/multiplier.

A circuit needs some non-linearity to produce new frequencies, frequencies other than the ones that were put in.  So, how come that an adder can produce  \$f_x - f_{LO}\$?  Well, it doesn't.

Then how that that schematic even works?  It's the diode detector with D1, D2, R8 following after the C5 and C10.  ;D  The diodes detector is in fact a frequency mixer, didn't realized that before!

Those diodes also acts as a frequency mixer  8), then R8, C6, C7, R9 makes a low-pass filter that rejects higher frequencies and let to pass mostly the \$f_x - f_{LO}\$ component, which is the bats' ultrasounds shifted down to audio.  ^-^




Added a screen capture to illustrate a low pass of \$f_x + f_{LO}\$ in blue vs a low pass of \$|{f_x + f_{LO}}|\$ in yellow.

The green trace is the sum of the two frequencies and the red trace is the rectified sum.  In blue is the signal after low-pass on the sum of the \$f_x\$ and \$f_{LO}\$, while the yellow trace shows the same but for the absolute value (with diodes).  Blue signal only shows ultrasounds, while the yellow signal shows \$f_x - f_{LO}\$.
« Last Edit: August 09, 2021, 10:53:29 am by RoGeorge »
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6959
  • Country: ca
Re: Want to hear the bat flying in the front yard
« Reply #23 on: August 11, 2021, 12:12:02 am »
That is interesting, it did look like an oddball circuit. I didn't think that circuit would be practical, the first TBA231 op-amp stage voltage gain 1,001 then second stage gain 148, total about 148,000 which is crazy high. Who can pull that off on perfboard?
Bertrik's bat detector page worth a look and his NE612 version.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1730
  • Country: is
Re: Want to hear the bat flying in the front yard
« Reply #24 on: August 13, 2021, 01:57:17 am »
The old 'motorola' Piezo tweeters that were sold by Radio Shack and still available
from MCM work great. They have a resonant peak around 25khz but are very broadband
and also are basically a compression driver horn so they are directional with about 90
degrees in the vertical and horizontal plane. I used one of these mounted in front of an
aluminum concave dish as the antenna and RX/TX element for an ultrasonic radar and
was painting targets out to 100 yards with around 10vpp squarewave drive and around
100db receive gain (total voltage gain) to drive a CRT grid for an 'A Scope' type display.
B.T.W., a signal 100 yards away has a long travel time out and back!!!
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf