Want to hear the bat flying in the front yard  - Page 1
Forum section: electronics / projects

author: RoGeorge
author_rank: Super Contributor
timestamp: August 02, 2021, 12:02:13 pm
content: 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 ofHC-SR04 ultrasonic sensorsthat 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?

author: Zero999
author_rank: Super Contributor
timestamp: August 02, 2021, 12:25:52 pm
content: 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.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 02, 2021, 02:38:36 pm
content: 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 aDS202 hendheld oscilloscopeto 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)

author: nali
author_rank: Frequent Contributor
timestamp: August 02, 2021, 06:02:15 pm
content: 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: #114874902126There are also some homebrew projects already out there:Rasp Pihttp://pibat.afraidofsunlight.co.uk/Teensyhttps://www.teensybat.com/

author: RoGeorge
author_rank: Super Contributor
timestamp: August 02, 2021, 08:01:18 pm
content: Somebody else PM-ed about a MEMS microphone, too,https://www.digikey.com/en/products/detail/pui-audio-inc/AMM-3742-T-WP-R/14289962with 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.

author: Zero999
author_rank: Super Contributor
timestamp: August 03, 2021, 07:45:41 am
content: Quote from: RoGeorge on August 02, 2021, 08:01:18 pmIt 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.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 03, 2021, 08:46:27 am
content: 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.I need a much careful measuring setup.Couldn't see any bats last night.

author: Zero999
author_rank: Super Contributor
timestamp: August 03, 2021, 10:48:57 am
content: 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?

author: nfmax
author_rank: Super Contributor
timestamp: August 03, 2021, 01:49:46 pm
content: A good way to generate ultrasound, so I am told, is to jingle a bunch of keys in front of the sensor

author: Gary350z
author_rank: Regular Contributor
timestamp: August 03, 2021, 07:56:24 pm
content: Quote from: nfmax on August 03, 2021, 01:49:46 pmI have done this. It makes ultrasonic receivers go crazy.

author: nali
author_rank: Frequent Contributor
timestamp: August 03, 2021, 08:10:46 pm
content: 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.

author: Gyro
author_rank: Super Contributor
timestamp: August 03, 2021, 08:23:41 pm
content: Quote from: nfmax on August 03, 2021, 01:49:46 pmEven 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.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 04, 2021, 05:29:21 pm
content: Quote from: Zero999 on August 03, 2021, 10:48:57 amThe 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 doingthe 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)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?

author: magic
author_rank: Super Contributor
timestamp: August 04, 2021, 08:19:33 pm
content: 4. Gain bandwidth productOld 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.

author: Kleinstein
author_rank: Super Contributor
timestamp: August 04, 2021, 08:34:28 pm
content: 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.

author: Harm314
author_rank: Newbie
timestamp: August 06, 2021, 01:07:59 pm
content: 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.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 07, 2021, 11:11:49 am
content: 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 formerMotorola 8700that still works even at 200kHz.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?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 fromhttps://rss.onlinelibrary.wiley.com/doi/pdf/10.1111/rssc.12217or fig.2 inhttps://acoustics.org/pressroom/httpdocs/154th/aytekin.htmletc.), so how will a heterodyne translate 80kHz wide bandwidth into only a few kHz of human hearing?

author: Kleinstein
author_rank: Super Contributor
timestamp: August 07, 2021, 12:23:09 pm
content: 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.

author: iMo
author_rank: Super Contributor
timestamp: August 07, 2021, 01:15:09 pm
content: 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)..

author: Terry Bites
author_rank: Super Contributor
timestamp: August 07, 2021, 04:55:21 pm
content: 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_ICFQAAAAAdAAAAABAIYou can also sample the amplified signal and pitch shift it thus:http://www.technoblogy.com/show?1L02increase 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???

author: Zero999
author_rank: Super Contributor
timestamp: August 07, 2021, 08:49:46 pm
content: 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?

author: floobydust
author_rank: Super Contributor
timestamp: August 08, 2021, 07:16:01 am
content: Popular Electronics Electronic Experimenter's Handbook1982 pg. 76has this simple ultrasonic detector project. It uses old TV remote control piezo ultrasonic sensors and oddball TBA231 op-amp.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 09, 2021, 10:18:26 am
content: 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.The diodes detector is in fact a frequency mixer, didn't realized that before!Those diodes also acts as a frequency mixer, 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}\$.

author: floobydust
author_rank: Super Contributor
timestamp: August 11, 2021, 12:12:02 am
content: 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 pageworth a look and hisNE612version.

author: CaptDon
author_rank: Super Contributor
timestamp: August 13, 2021, 01:57:17 am
content: The old 'motorola' Piezo tweeters that were sold by Radio Shack and still availablefrom MCM work great. They have a resonant peak around 25khz but are very broadbandand also are basically a compression driver horn so they are directional with about 90degrees in the vertical and horizontal plane. I used one of these mounted in front of analuminum concave dish as the antenna and RX/TX element for an ultrasonic radar andwas painting targets out to 100 yards with around 10vpp squarewave drive and around100db 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!!!

author: Tomorokoshi
author_rank: Super Contributor
timestamp: August 13, 2021, 12:18:59 pm
content: Recorded from an HP 4918A Ultrasonic Translator.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 13, 2021, 06:12:38 pm
content: Nice!Thanks for mentioning the instrument. By googling it I've learned that ultrasound are used industrially to detect gas leaks, debug HVAC, corona discharge, etc. For example here it is used with a conduction wand to debug a Freon leakhttps://youtu.be/4oMYMYI17cMThat's a nice to have around tool, much more useful than hearing the bats. First application that came to mind would be to detect which coils are singing in SMPS.Just curious how they made the HP Ultrasonic Translator, the service manual for another model HP 4917A Ultrasonic Translator Detector is available online,https://www.kennethkuhn.com/hpmuseum/scans/hp4917a_manual.pdfand has the block diagram at page 9 of 26, and the schematic at schematic at page 19 of 29. There is a \$\pi\$ LC filter right after the probe to bandpass the 36-44kHz range, then the signal is mixed with a fixed LO of 40kHz. The only setting is the audio volume knob.LATER EDIT:Just for the docs, applications for HP Ultrasonic Translators featured in HP Journal - May 1967:https://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1967-05.pdf

author: Zero999
author_rank: Super Contributor
timestamp: August 19, 2021, 08:25:18 pm
content: I was playing with a Wien bridge oscillator recently, remembered this thread and thought it could be easily used as a modulator, by coupling a signal to the gate of the limiting J-FET. It could also be built with an op-amp. R1, R2 C1 & C2 form a filter which sets the frequency, which can be varied using a dual ganged potentiometer and fixed resistor. It will probably need some tweaks to be a practical circuit.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 19, 2021, 10:28:12 pm
content: That's very ingenious!Might be tricky to keep the Wien oscillating in practice, but definitely worth a try.Speaking of unconventional ways to make a heterodyne, another one I was thinking the other days was to use the local oscillator output as a power source for the electret mic. That will turn the electret mic into a multiplying mixer.Though, there are some inconvenients with any heterodyne when using for listening to bats:- first is that the bats emit short pulses, so when hearing at that in real time it will sound more like burst of clicks, not much can be distinguish regarding the "voice/singing" of the bats- second is that a heterodyne might reverse the spectrum when the LO is higher, like shown in the two examples. First image is with the waveforms and the second with the spectrum corresponding to those waveforms.Notice how in the last spectrum plotted appears reversed in audio (magenta spectrum near the origin of the axes - magenta is corresponding to the green signal mixed with the blue oscillator, where the blue LO is higher in frequency than the bats signal).That will make, for example, an increasing pitch chirp to hear as decreasing in pitch.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 22, 2021, 11:54:27 am
content: Found this on the streetand noticed it still has a small piece of PCB with the answering button on it, so it was from the bottom half of a phone, where a mic is expected to be, and guess what? It does has a mic on that small piece of PCB leftover:and it happened to be a MEMS mic, the analog kind of MEMS micF4-(S)MOE-N090R38-3Pmarked "ME V1.0".Tested it with the ultrasounds coming from a piezo disc, and this MEMS mic seems to be working just find up to at least 135kHz if not more, outputting tens of mV (without any amplifier).The upper level of blue marks the mic out signal for a frequency sweep between 20kHz and 150kHz, while the lower level blue marks the response for the rest of the sweep, between 150kHz and 200kHz.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 23, 2021, 08:40:22 pm
content: The software is not yet ready, but couldn't resist the temptation, so last night took the handheld oscilloscope and the MEMS mic powered by two AAA batteries, and went outside curious if it can capture anything:It took a while to find a good trigger level, and at first I thought the captures are coming from the rare passing by cars in the night. Then I realized that the trigger captures are not from the cars noises, but the triggering happens more often in the presence of the car noises because the bat raises the Tx power when it is more noise outside!I don't think the captured signals were from the cars, because of two things:- the signals look like a burst of only a few milliseconds long, thought the passing by cars were taking many seconds of sustained level of noise before fading away- a few ultrasonic bursts were captured in the silence of the night background sound, with no strong noises to be hear

author: Tomorokoshi
author_rank: Super Contributor
timestamp: August 24, 2021, 12:19:58 am
content: For what it's worth, I couldn't hear crickets at all over the background noise with the ultrasonic translator. So apparently there isn't much energy from them between 35 kHz and 45 kHz.

author: RoGeorge
author_rank: Super Contributor
timestamp: August 24, 2021, 12:57:53 am
content: That was a surprise for me, too. Even with the crickets and all other background noises of the night, the trace on the oscilloscope was staying mostly flat, except for the bat chirps, which chirps were comparable in amplitude with loud cars. Bats are probably one of the loudest creatures, if not the most loud out there in the ultrasonic range.I bet if it were for humans to hear ultrasounds, bats would probably sound very, very loud, like a dog barking only a few feet away, or rather like screaming seagulls above a net full of fish.

author: Zero999
author_rank: Super Contributor
timestamp: May 18, 2024, 08:36:06 pm
content: Good find regarding the microphone, which is the most difficult part of a bat detector.I recently attesteded a bat walk meet up with my 11 year old nephew and he loved it. We used heterodyne detectors, which worked from 17kHz ro 140kHz and I remembered this thread.I'm now thinking of making or buying one.I had another idea. Rather than heterodyne, use a sample and hold circuit, clocked with an adjustable squarewave oscillator. This has the advantage of not requiring a sine wave oscillator. It just requires a simple low pass filter to give a good output. The only thing is the oscillator needs to have a low duty cycle to work well, but even the TL072 should be able to cope with that up to 140kHz.I've had a play with LTSpcie.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 18, 2024, 09:12:09 pm
content: Looks interesting.Ready made bat receivers can be quite expensive (for what they have inside).Better build your own, so to implement the sampling idea in practice.

author: Zero999
author_rank: Super Contributor
timestamp: May 18, 2024, 09:48:52 pm
content: Sorry, I forgot to ask: did you ever complete your project?I've had a look for the microphone you used, but couldn't find it for sale anywhere.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 19, 2024, 05:20:00 am
content: I've switched to digital, because it happened that I was already heaving a DSP devboard from TI (https://www.ti.com/tool/TMDX5535EZDSP), with a CODEC that can do 192kHz sampling, but it turned out the 192kHz was not really possible for frequencies above the audio. There were some internal filters I couldn't bypass, got lost in programming and configuring the DSP+CODEC, and eventually never completed my bat receiver.For the microphone, I think most of the electret microphones should be good enough. A MEMS microphone would be even better, though the bats ultrasounds are very loud when compared with any other sounds of the night. Might need a preamplifier if the bats are not very close.Look for any abandoned mobile phones, or search for MEMS microphone if you can not find any discarded mobile phone to scrap it's microphone. The very new ones might have many microphones, but are often digital mics, and very, very small, really hard to reuse. IIRC Adafruit was heaving some MEMS mics on a breakout board, or if you have one of those "17 sensors Arduino kit", there are one or two sensors with a small microphone.If you don't have any ultrasound source to test which microphone works the best, shake a ring with (door) keys nearby, their metallic ringing sound will produce a lot of ultrasounds.Beware with the electret microphones, they are very, very sensitive to heat. Heat depolarizes the electret material inside, and makes them lose from their sensitivity. That is why many mobile phones will use spring contacts to connect to their mic, and if not, usually the electret mic has some wires soldered from the factory. Avoid soldering on electret microphones if possible.The waveforms above were captured without any filter, with a handheld oscilloscope connected directly to the microphone. The recording was made from a balcony, at about the same height as the bat was flying, so the distance was somewhere between a few meters and 20-50 meters maybe. In the picture are loudest ones, when the bat was flying only a few meters (maybe as close as 3meters/10feet or so).

author: Zero999
author_rank: Super Contributor
timestamp: May 19, 2024, 07:59:20 pm
content: It's a shame you didn't complete it. It's a bit silly having such a high sample rate, with all that filtering. It makes it pretty pointless. You could have added an external sample and hold circuit.Yes, an electret microphone should work, but I've noticed some models have a built-in capacitor, which is designed to filter out RF GSM signals. It's typically 1nF, so would form a 72kHz low pass filter with the 2k2 bias resistor. I could use a lower value bias resistor, say 1k for a cut-off of 159kHz, along with a lower bias voltage, so the bias current remains within the permitted level, but I don't know how well it'll work. I might buy a few of each part and then open them up to check there isn't a capacitor.I found this kit which uses sampling, but with an analogue switch. I would need to build a case and add a speaker amplifier, since his mum wouldn't want him wearing headphones, in case he sets the volume too loud.https://whadda.uk/manuals/velleman/illustrated_assembly_manual_k8118.pdfEDIT: Schematic added.I'm not set on the sub-sample/aliasing/strobe idea. It's just I thought it might be easier to understand. I could go with heterodyne, perhaps with the incandescent lamp for the AGC, but with a J-FET in series to provide the amplitude modulation.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 20, 2024, 07:54:01 am
content: Well, most of my projects remain unfinished, and I have no excuse for that. Once there are some partial results, and only disciplined work remain for a project to be finished, something else pops into attention. Learning new things or exploring new topics is more appealing then working to finish something. Sometimes I return to older projects and finish them, but not for closure. Usually I return to an old project when I need that device to do something with it.Unfinished projects leave some sort of guilt behind them, so it is better to finish them if you have the discipline.I've opened yesterday your simulation, and noticed you used ~150kHz. Isn't that too high? I remember bats were audible somewhere around 50kHz, maybe up to 80kHz or so. 150kHz osc - 50kHz bat = 100kHz at the output, which will need a second frequency shift to become audible. I've read they might emit higher than 100kHz, though that doesn't propagate well enough through air, but I didn't try in practice how much of 100-150kHz can be received from a distance, outside.Another inconvenience with frequency shifting, in general, is that bats might use a wider band than the audio width of human hearing, so not all the spectrum produced by the bat can be shifted into audio (that's why I've tried to move to digital, with the intention to use DSP for compressing a wider band of 50-100kHz into only 5 or 10kHz of audio bandwidth). Though, was a little too pedantic from my side when I wanted to implement spectrum compression. It is very interesting to hear the bats even when only a fraction of their spectrum can be made audible at a time.

author: Zero999
author_rank: Super Contributor
timestamp: May 20, 2024, 08:56:38 am
content: Why 150kHz? I noticed the bat detectors provided worked up to 140kHz,Wikipedia says >100kHzand wanted to account for the highst frequency. The idea is to make it tunable, with R4 being a 100k potentiometer with 10k in series. It's not the final design.Is the wider spectrum a problem? The idea is just to detect bats. Adjusting the tuning would help.Digitally recording and playing back at a much lower speed would give a more accurate representation, but it doesn't work in real time.

author: Zero999
author_rank: Super Contributor
timestamp: May 27, 2024, 11:34:54 am
content: I hope you don't mind if I continue to post my designs and questions in this thread, since you appear to have abandoned this project.I've not stopped work on it.I tested a few piezoelectric transducers designed for audio/alarm applications and noticed how they have various sharp peaks and troughs between 20kHz and 150kHz. I used two units for each test, one as a transmitter and the other as a receiver. I haven't recorded any detailed measurements, simply because I don't have a microphone with any response data over said frequency range. The intention is to use a transducer to test various electret and MEMS microphones to find a suitable candidate.I've also had a failed attempt a designing a Wien bridge oscillator with AM, for the heterodyne circuit. The oscillator works, but the modulation index sharply declines, as the input frequency increases.Here's the schematic.I built it on a solderless breadboard. For simplicity I used the TL071, because it's single channel, so there's no unused op-amp to worry about.R4 is a small incandescent lamp,(RS stock code 587-686)I found in a box of old bulbs. I chose this over the J-FET AGC for simplicity's sake. It's run off a +/-6V dual power supply, to avoid the additional complexity of single supply design. It is connected in series with the J113 to 0V. I measured the channel resistance of the F-FET: 54R. This is purely to test the concept, rather than a final design.The oscillator works perfectly, giving a nice 51.5kHz (very close to the 48.2kHz calculated) sine wave of about 1.2Vpp.Unfortunately, the amplitude modulation doesn't work properly. 1Vpp (500mVp) of different frequencies were applied to J1's gate. This was low enough to avoid the gate conducting significant current, when forward biased, causing the transistor to work in the enhancement region, yes depletion mode J-FETs can do that.At very low frequencies, it was enough to saturate the circuit, resulting in a distorted modulation envelope.128Hz inputThis got much better as the input frequency was increased, but note the 45° phase shift and the modulation index decreases drastically, as the frequency is increased.1.3kHz5kHzI tested with 56kHz in and there's hardly any modulation, rendering it useless for the intended application.The question is: why the steep roll-off? I chose low impedances to avoid the parasitic capacitances of the breadboard being a problem. The output impedance of the signal generator is 50R, connected to 1m of co-axial cable, but I don't see how that's a problem.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 27, 2024, 01:28:03 pm
content: Quote from: Zero999 on May 27, 2024, 11:34:54 amGlad to hear you didn't drop the project.About the Wien bridge, IIRC it only oscillates when the amplification is precisely 3. Anything slightly bigger than 3, and the amplitude will go to infinity, so it will generate distorted square waves. Anything lower than 3 will extinguish the oscillations. The desired number 3 comes from the attenuation of the RC resonant network. The negative reaction has to match precisely the positive reaction. The bulb is supposed to keep the amplification precisely 3.My guess is that influencing the amplification (by the FET that interferes with the bulb resistance) means messing with the oscillation condition (and extinguish or goes to infinite amplitude) rather than just modulating the amplitude.For amplitude modulation, I would let the Wien bridge and the light bulb do their thing at keeping the gain precisely 3 and outputting a constant amplitude, then add another circuit as an AM modulator after the Wien bridge.

author: Zero999
author_rank: Super Contributor
timestamp: May 27, 2024, 05:29:53 pm
content: Quote from: RoGeorge on May 27, 2024, 01:28:03 pmI'm glad you don't mind me using the thread you created.QuoteYes that's true, but it doesn't happen immediately. It takes time to the oscillation do build when AV> 3 and decay when AV< 3. This is why my circuit doesn't work and is a bad idea.At low frequencies, the Wien bridge oscillator has time for the oscillations to build and die away. Give it too much time (very low frequencies) and it'll die away completely and at build up to the point of causing distortion, over the cause of a cycle of the input signal. At higher frequencies, simply isn't time for the oscillations to build and decay, during the cycle. It's inherently limited in bandwidth. The only fix would be to put the input through a high-pass filter circuit with the complementary response, which would complicate things and there are simpler alternatives.The circuit Iposted a few years agowill have the same issue.Thank you for helping me realising this is a bad design. It didn't click, until I responded to your post. I'm a bit annoyed it took me so long to realise what should have been obvious.QuoteI agree.I'm moving towards thestroboscopic, sample and holdidea. I might use an analogue switch such as the74HC1G66rather than a FET. The only downside is it's surface mount, which doesn't bother me, but I would like to go through hole, to make it so my 12 old nephew can work on it, although I plan on doing it myself, so maybe not.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 28, 2024, 08:34:56 am
content: Last night I've looked again from the balcony and didn't spot any bat in the front yard.In cases like these, when it is not very clear if there are any bats around, a frequency divider receiver would be preferable to a heterodine receiver, because a frequency divider will translate the entire 20kHz-200kHz band into audible sound. For example, (20 ... 200)kHz divided by 32 will produce audible (0.625 ... 6.25)kHz, though others are using division by 16:https://www.instructables.com/Bat-Detector/By contrast, a heterodine will need to be tuned on just the right frequency. This can be a daunting task if the presence of the bats is unclear.Luckily, I have a MMC4020 procured in the 80's from the black market. It's the equivalent of CD4020 (14 bits binary counter/divider), but produced at MicroElectronica during the communist Romania.Never tested that MMC4020, but if it doesn't work I'll just use an MCU as frequency divider (eventually with the dividing ratio controlled by a potentiometer). An MCU would also be able to count how many pulses were received in total (when left to receive over the entire night), so it can tell if there were any bats at all in the area.The disadvantage of a frequency divider receiver is that it usually discards the amplitude variations of the incoming signal. The audio amplifier is fed from the digital output of the binary counter.Thinking as we speak, might be interesting to modulate the audio amplitude with the amplitude envelope of the ultrasounds (the envelope taken before turning the ultrasounds into square signal). I wonder if this will make a quality difference in audio, compared to constant amplitude audio:https://youtu.be/C1KVKyYYUbISince there are online records with the raw captured ultrasounds, would be easier to test the idea in software first, to decide if an amplitude modulation of the audio out would help or not, but I don't want to turn this again into a software project.

author: Zero999
author_rank: Super Contributor
timestamp: June 28, 2024, 10:06:50 am
content: I've not forgotten about this.The undersampling/stroboscopic idea, might be better because it would pick up harmonics. If the oscillator is set to 30kHz, then it should also detect 60kHz +-15kHz or whatever the response of your hearing, or the speaker, as well as 30kHz +-15kHz.I've had some success with finding a microphone sensitive to ultra sound. I tested several electret microphones in my junk box. I found a couple with with some response up to 150kHz, which would be ideal. Unsurprisingly they're the smallest ones with a diameter of just 6mm. There was a small, SMT capactor on the back, for RF supression, which I removed because I thought it would reduce the frequency response, but it turned out to be 470pF, which probably wouldn't have mattered. No doubt a smaller microphone, say 4mm would be even better.

author: RoGeorge
author_rank: Super Contributor
timestamp: June 28, 2024, 01:13:52 pm
content: Mixing with a frequency comb could do the trick for easy detection, I didn't think of that. If you sample, yes, it will pick harmonics, too. Or mix with a square wave, whichever comes easier.Glad to hear you found a high frequency microphone. In this case, maybe just power the electret microphone from an on/off 30kHz square wave. Then amplify normally and filter all above 10kHz or so. In theory, the microphone itself should do the mixing(should work about the same as sampling, but I didn't try).Today I've bought another satellite finder from LIDL (6 euro), for its enclosure with a potentiometer (30k\$\Omega\$ linear, B30K).If I remove the galvanometer indicator, that will free enough room to add inside a small Li-Ion leftover from old mobiles. The box is very sturdy, has a flipping tilt-support/hanging wire, has a ceramic disc buzzer/speaker, too, a 324 quad opamp (one is unused by the satellite finder) and enough transistors to turn it into an ultrasonic probe. Already reverse-engineered the schematic from the previous buy:https://www.eevblog.com/forum/rf-microwave/schematic-for-parksidelidl-sattelite-finder/

author: zapta
author_rank: Super Contributor
timestamp: June 28, 2024, 04:46:05 pm
content: >> Not sure yet how to post process the signal.I would start with recording a few samples and then iterating on it. This day Python is a common tool for signal processing with packages such as scipy and numpy. Once you validate the idea, you can have a more compact/embedded solution if needed.Having multiple microphones may help you reducing noise by creating a directed beam (again, in the post processing).You could also train a neural netwrk (e.g. using PyTorch) but most likely you will not have enough samples to do so.

author: Zero999
author_rank: Super Contributor
timestamp: June 28, 2024, 06:33:24 pm
content: I thought the idea was just to detect bats for now. Once that goal has been met, then we can think about expanding it.Connecting the microphone to a square wave oscillator will probably work, but note the bias voltage to the input of the amplifier will also shift at the ultrasonic frequency and will need filtering out, otherwise it'll result in saturation.Acoustic feedback is another potential problem if the microphone detects a significant amount of sound from the speaker. This will happen if there isn't enough high pass filtering from the microphone or low pass filtering to the speaker.

author: hugo
author_rank: Regular Contributor
timestamp: June 29, 2024, 04:52:08 pm
content: Meet PicoBat: a PIC-based ultrasonic detector by Bruno Gavand with only 3 components:https://www.micro-examples.com/articles/index.php?title=PicoBat

author: RoGeorge
author_rank: Super Contributor
timestamp: June 29, 2024, 05:12:49 pm
content: QuoteQuote from the above posted link:https://www.micro-examples.com/articles/index.php?title=PicoBatNice hack!However, the test only shows the device working with strongly shaken keys at a couple of inches away from the sensor, or with other very laud ultrasonic range finders. It is not clear if it can detect bat produced ultrasounds, they might not be loud enough from a distance.

author: Terry Bites
author_rank: Super Contributor
timestamp: June 30, 2024, 02:18:58 pm
content: https://zachpoff.com/resources/cheap-microphones-for-ultrasound/Knowles used to do a wide rage of HF mics. These days I can only find:www.mouser.co.uk/ProductDetail/Knowles/SPU0410LR5H-QB?qs=ZBAH5PeHI6spSaDz04PSrQ%3D%3Dhttps://www.digikey.co.uk/en/ptm/k/knowles/ultrasonic-applications-for-knowles-electret-and-mems-microphones

author: Zero999
author_rank: Super Contributor
timestamp: July 06, 2024, 07:14:49 pm
content: Most cheap ultrasonic transducers are tuned for a narrow resonant frequency, with 40kHz being the most common one. I've not tested one at other frequencies, but it'll be similar to one of those piezo discs. A small electrect microphone will be much better.Using a frequency counter is a bad idea, because it rejects all the amplitude information. It will just lock on to one sound, making it incapable of detecting more than one bat. The only advantage is it scales down the entire spectrum.I looked at the kit schematic again. Attached is just one channel, with the component values made clearer, as the picture in the PDF was low resolution and very fuzzy.The first two op-amps amplify the signal by a factor of 121, with a lower cut-off of 16kHz. The third op-amp then inverts the signal. The analogue swithers are alternately switched on by the oscillator, selecting between the inverted and non-inverted signal, at the oscillator frequency. This is then low pass filtered by R5 and C11, with a cut-off of 7kHz.I think I might use a similar circuit, but it can be greatly simplified. Rather than using an op-amp to invert the signal, just have one op-amp, which can be programmed to inverting or non-inverting, with an analogue switch. This doesn't cut down on the number of op-amps but it means the oscillator doesn't need an inverting output and only one analogue switch is required.I simulated it and the results are decent. R4, R5 and C1 bias the signal to half the supply voltage. When S1 is on, the circuit is inverting and when off it's non-inverting.I'll swap the final op-amp for an LM386 to drive a small speaker.I might also use a common emitter amplifier for the first microphone amplifier stage, because it should have lower noise than the TL072.EDIT:I've simulated the microphone amplifier. The response probably counteracts the reduction in sensitivity vs increasing frequency of the electret microphone quite well.I'm moving towards using a TL074, with two sections for the amplifier, one for the inverting/non-inverting amplifier part for the heterodyne circuit and one as Schmitt trigger oscillator.EDIT:For completeness, here's the BJT amplifier from the website linked below, which uses the obsolete NE612 as a demodulator.http://bertrik.sikken.nl/bat/ne612het.htmThe microphone is noddled as a signal source with an impedance of 4k7.It has a sharper peak, than the op-amp circui9t, but lower noise. I might use two stages, a BJT and op-amp for more gain.

author: RoGeorge
author_rank: Super Contributor
timestamp: July 24, 2024, 08:05:05 am
content: This summer couldn't spot any bats, until last night around ~3-4AM. By coincidence, last weekend I did a crude ultrasound probe for detecting singing coils or other ultrasound sources. The breadboard was still on the workbench and wired, but from indoors it didn't catch any bat ultrasounds.The schematic was made to keep all as minimalistic as possible. No amplifier and no mixer. The MEMS mike (which has an internal preamp) is DC coupled to an ATtiny13. The MCU is acting as an analog comparator and frequency divider. The speaker is a piezo disc connected directly to the MCU, so no audio amplifier either. No volume, sensitivity or other controls. Only 6 components and a few lines of code in a .S file (this draft code happens to be written in assembly, using Eclipse, AVR-GCC and debugWire, with a generic CH340G USB to serial as a debugger/programmer):Code:#define __SFR_OFFSET 0x00#include <avr/io.h>.global mainmain:cli// disable interrupts globallyldi r18, (1 << PB4) + (1 << PB3) + (1 << PB2)out DDRB, r18// PB4, PB3, PB2 as DOsbrr18, (1 << CLKPCE)// set the CLKPCE bit before writing the valueoutCLKPR, r18ldi r18, 0out CLKPR,r18// write CLKPS3..0 all 0 for CLK prescaller div x1// disable the WDT//enable Analog Comparator (AC), interrupts on raising edgesbrr18,(1 << ACIE) + (1 << ACIS1) + (1 << ACIS0)//enable Analog Comparator (AC), only raising edge, w/o interrupts//sbrr18,(0 << ACIE) | (1 << ACIS1) | (1 << ACIS0)out ACSR,r18ldi r18, (1 << SE)out MCUCR, r18// enable sleep, sleep mode Idle#define MAXCOUNT10#define HALFMAXCOUNT/2//use r18 as a variable for counting the AC pulses/interrupts#define COUNTERr18//use r19 as a constant that turns LED/speaker on#define SPK_ONr19ldi SPK_ON,(1 << PB4) + (1 << PB3) + (0 << PB2)//use r20 as a constant that turns LED/speaker off#define SPK_OFFr20ldi SPK_OFF,(0 << PB4) + (0 << PB3) + (1 << PB2)// enable interrupts globallyseirjmp reset_counterwait_AC_event:sleep// sleep until an AC interrupt will wake the CPU//sbiACSR, ACI// clear the interrupt bit (because AC int are disabled)//sbiACSR, ACO// clear the interrupt bit (because AC int are disabled)inc COUNTER// count the raising edges detected by the AC// set LED/speaker bit(s) PB2, PB3, PB4 accordingly//if COUNTER >= HALF, jmp to check_COUNTER_ovfcpi COUNTER, HALFbrpl check_COUNTER_ovf//elserjmp wait_AC_eventcheck_COUNTER_ovf:out PORTB, SPK_OFF//if counter < MAXCOUNT, jmp to wait_AC_eventcpi COUNTER, MAXCOUNTbrmi wait_AC_event//elsereset_counter:ldi COUNTER, 0// else reset the countingout PORTB, SPK_ONrjmp wait_AC_event// loop forever//dealing with interrupts.global ANA_COMP_vectANA_COMP_vect:sbiACSR, ACI// clear the interrupt bit (because AC int are disabled)//sbiACSR, ACO// clear the interrupt bit (because AC int are disabled)reti.global WDT_vectWDT_vect:// WDT shouldn't occur, but if it does, loop here forevercliforever_trapped_1:rjmp forever_trapped_1reti// according to https://www.nongnu.org/avr-libc/user-manual/assembler.html,// these names should have work as a catch-it-all, but they didn't////.global BADISR_vect//BADISR_vect://.global __vector_default//__vector_default://// used this workaround instead:.global INT0_vect.global PCINT0_vect.global TIM0_OVF_vect.global EE_RDY_vect.global ANA_COMP_vect.global TIM0_COMPA_vect.global TIM0_COMPB_vect.global WDT_vect.global ADC_vectINT0_vect:PCINT0_vect:TIM0_OVF_vect:EE_RDY_vect://ANA_COMP_vect:TIM0_COMPA_vect:TIM0_COMPB_vect://WDT_vect:ADC_vect:// other interrupts shouldn't occur, but if they do, loop here forevercliforever_trapped_2:rjmp forever_trapped_2.endWill have to add a battery, and/or move the circuit on a permanent breadboard to make it portable. Maybe the bat will visit again.

author: Zero999
author_rank: Super Contributor
timestamp: July 26, 2024, 08:11:50 pm
content: I would be very surprised if that circuit worked.Not only is there no pre-amplifier, other than what's built-in to the MEMS mic, but it also lacks a high-pass filter to remove audible sound.Try this.By the way, mic is the correct abbreviation for microphone, not mike.

author: RoGeorge
author_rank: Super Contributor
timestamp: July 27, 2024, 05:58:49 am
content: Thanks for the schematic. Main problem was that the next night was stormy and it rained violently, and the bat didn't visit.Then the weekend came. During weekend, there is a lot of noise from a pub across the street, and from more cars. I've noticed from the previous recordings that the bat is "barking" louder when it's noisy outside (for example when a car is passing). So I guess when the night is noisy, the bat is using other quieter hunting areas. That would explain why the bat appearance has shifted to the late AM hours, because the pub sometimes has loud music until midnight, sometimes even later. I suspect bats don't like noisy places.About the detector, that one was for made for hearing singing coils, or to detect other (indoors) ultrasound sources. Should be good enough for the bat, too. The recorded level a couple of summers ago (from a bat, using the same mic) was made using 20mV/div. The signal was about 20-50mVpp:I've measured the sensitivity of the ATtiny13 comparator with a signal generator. It flips reliably starting from about 5-6mVpp. The expected 20-50mVpp from the bat should be plenty.About the high pass filter, there is one. The 10k/47nF low pass RC at the negative input makes the comparator more sensitive to high frequencies. When the signal is swinging slowly, the RC filter on the negative input has enough time to follow the signal about as well as the positive input of the comparator, so not much flipping. At high frequencies, the RC cell works as a voltage averager, and keeps the negative input of the comparator at a constant voltage, while the positive input is swinging fast, making the comparator flip at each period. Overall, the circuit acts as a zero-crossing detector, but for high frequencies only.In theory, the capacitor should have been much smaller, f=1/(2*pi*R*C) will indicate about 1nF for 10k\$\Omega\$ and 16kHz, but in practice that was making the comparator too insensitive even for high pitch frequencies, so I've used a 47n that happened to be at hand. That was picking some other audible sounds, indeed, but it was good enough for indoors testing. For the final version I'll probably use 2 or 3 RC cells calculated for 10kHz or so (for the indoors ultrasounds probe, not for bats). A single RC cell is not selective enough to separate audio from ultrasounds.Another problem with the indoors probe was the ceramic disc. The sound edges are too sharp, and that interfere with the ultrasounds. A miniature laptop-speaker (to avoid wearing headphones) with some low pass filter should work much better than a piezo disc. Attiny can supply about 50mA through a DO. In practice, I've measured the resistance of a DO pin to be about 50-80ohms, depending on the Vcc. The output resistance measures about the same for either high or low level of the DO. Should be easy to soften the voltage edges of the DOs by adding a capacitor.