International Dawn Chorus Day 2020 is somewhat overshadowed by the coronavirus pandemic for its human listeners. The birds probably appreciate getting some peace! The Wildlife Sound Recording Society was after getting a live broadcast of this from as many members as possible. They proposed two methods of live broadcast, their preferred option using Mixlr and a more gonzo alternative using locusonus.
Mixlr seems all about tablets and mobile phones. If a project’s got a mobile phone in it I’m not interested. I loathe smartphones – jack of all trades and master of none. They don’t do stereo1, FFS… Mixlr is Cloud. I don’t do Cloud, particularly if it comes with a subscription. It’s bad enough when Cloud goes AWOL and you’ve put effort into the platform for free. Pay for the privilege? Nope.
So I passed on that and went to locusonus, who are doing this under the Reveil soundcamp moniker. Locusonus is funded by the French State, bless their arty dirigisme – just look at their publications. And sponsors
Reminds me of reading about musique concrete as a kid in the 1970s, IRCAM and all that, while I was piddling about with a hand-me-down Stellavox tape recorder. Mad, but inspirational. I’ll hitch a ride on French exceptionalism.
I’m lucky in that way back when I bought a Cirrus Logic sound card for a Raspberry Pi. Or perhaps unlucky in another way – I never found a good use for it till now, as the software drivers were a whole load of hurt. By the time they got incorporated into Raspbian, the card was end-of-lifed so you can’t buy them any more. That’s Linux for you. Free as in beer but slow to integrate hardware. If you are doing this from scratch, either use a cheap audio adapter with mono audio or something like the Behringer UCA202 USB audio card – stereo line in and works great with the Pi, right out of the box.
Despite fiddling with the CirrusLogic on and off I came to the conclusion a timed bird sound recorder is better done with a Dribox and a real audio recorder and a timer. However, a Pi and the CL card is perfect for locusonus. Perfect enough, indeed, that downloading the relevant Pi SD card image, blowing it onto a SD card and firing it up on ethernet gave me an instant win2, using a set of OKMII binaural mics into the line in port with the bias enabled. I was able to hear myself, albeit at a low level, but the locusonus software lets you ram the Cirrus programmable gain amp up to +30dB and max digital gain. Sure, it’s noisy, but showed the principle.
Now all I need is an outdoor microphone
Making a low-cost outdoor bird microphone
A couple of weeks in the lab can save you a couple of hours in the library or five minutes on Google, I did a search for prior art, inspiration, plagiarism, call it what you will. A quick Google search brought me to this thread on birdforum which warmed me up to vapourware ChirpSounds and to the existing product Nature’s Window.
Observe how Nature’s Window is big on showing you the speakers but nary a hint of the microphone on show. Big Trade Secret, obvs. In the past I had a bird microphone, which I put in a tube with horticultural fleece to try and keep the rain off. It worked for a couple of years, but sounded awful because of the resonance of the plastic tube, and eventually the sparrows pecked through the fleece. So I was after some ideas, and Nature’s Window doesn’t want to let on. Which is fair enough, they don’t have to, but fortunately a customer showed how they did it, bless her 😉 Thank you Ruth in Minnesota, my electronics spy behind enemy lines.
It has a beautiful, stunning simplicity
Angling the mic down stops it filling with water. The mic is a basic electret capsule, cheap as chips. Putting it in a plastic tube plugged with hot-melt glue stops water getting into the connections and generally coming in from the top. Setting it back a little bit reduces wind noise, which is the reason your eardrums are set back from your lugholes. Your hearing suffers a severe resonance due to the distance it is set back, which happens to amplify speech sounds.
These capsules are made in huge numbers – I bought a load from somewhere in China a while back which cost less delivered than I’d have paid to mail one across town.
I can understand why Nature’s Window are so cagey about revealing what the microphone looked like, as the mic, preamp and bias supply are their only unique selling point. Presumably all this is built into the computer speakers which is what they show, in the knowledge people will plug a mic into computer speakers and hear nothing, bwahahaha 😉 I don’t actually think US$150 is too bad for a turnkey solution, but I am looking for inspiration, not a way to spend 150 pounds. And I need it by the 2nd May.
At a guess the setback in the tube is about the length of the capsule, which is 6mm. This will give a resonance when it is 1/4 the wavelength in air, making the round-trip 1/2 wavelength. The speed of sound in air is about 330m/s. 24mm corresponds to a frequency of 330/.024 or about 14kHz, which is probably towards the upper limit of most users’ hearing. It’s fine.
It’s really quite embarrassing to read back an initial draft of my attempt at designing an outdoor microphone, based on a GRAS environmental mic which looks like this inside
and my prototype looked like this
All far too much faff 😉 I can damp the resonance of the Nature’s Sound variant with cotton wool or the like, which also will keep spiders out of it -they are drawn to any heat in things outside. Although the capsule draws only 3mA at a couple of volts, rather than the hundreds that the IR emitters on a CCTV camera draws, I don’t want to cut spiders any slack.
Microphone construction
A mic preamplifier
Most Locusonus operators seem to use commercial kit. I have a secondhand ART USB DualPre that would probably do, but it’s way OTT to run a couple of electret mics outside. You need an amplifier, because computer speakers are line level, funnily enough just like the Cirrus Logic card. And cable. Line level is about .775V rms. You ain’t gonna get that out of an electret mic with birdsong, you’ll be lucky to get 2mV. Wind will be a pain, so you also want to roll off most stuff below 300Hz. I thought I’d be clever, and get gain and filtering in one go. I went to my favourite Sallen and Key filter design page and dialled up a gain of about 10 and fc of 400Hz.
and the values
R1 = 15kΩ
R2 = 2.2kΩ
R3 = 39kΩ
R4 = 330kΩ
C1 = 0.1uF
C2 = 0.1uF
That gets me up to about 20mV going in to the Cirrus, which has a programmable gain amp of another 30dB, so another 30 times. Which is 600mV, there or thereabouts good enough for line level. Trouble with that clever wheeze is that when you take off the input loading you make a dandy oscillator.
Which in hindsight is only to be expected if you feed the output to the + input via C2 without a well-defined zero input impedance to load it even more via C1. In reality the capsule is an open drain input which is sort of a voltage-controlled current source with an impedance limited by the drain resistor, typically 6.8k. Which is three times R2, so most of the feedback will make its way to the + input. Bad move, time to start again.
Let’s bid for a gain of 1 in the filter, and put a gain of 10 amplifier in front of it, which will nail down the source impedance. It also gets rid of R3 and R4, making the Veroboard layout easier.
R1 = 5.6kΩ
R2 = 5.6kΩ
R4 = 0Ω (short)
R3 = not connected
C1 = 0.1uF
C2 = 0.1uF
Wind is always going to mean you need headroom on one of these things in a big way. I have mains power in a shed at the end of the garden, so I will run this off about +/- 12V and use a venerable TL072. If you’re trying to run the whole thing off 5V then you will need to work a lot harder and use an opamp designed for that. Personally I’d just use a couple of 9V batteries if I couldn’t face the mains PSU. Keeping all the mains driven gizmos in the shed keeps the rain out of the works and most of the connectors, and means I can use cheap audio coax to carry power and signal from the capsules in the regular way.
Mic preamp/power supply design
I used a TL074 quad opamp run of +/- 12V. That way I can run stereo, using two of the opamp stages on each side. I did wonder if I was pushing my luck mounting the mains transformer in the same box, and I used cheap and nasty Zener regulation rather than real regulators, dropping 12V across 820 ohms to push 15mA through, the TL074 is rated to draw about 5-10mA at a maximum supply of 36V. The Zeners work fine, getting ripple down to millivolts, and the PSRR of the opamp will take care of that.
I put the series LEDs on the board, experience has shown knowing both power supplies are up saves debugging, as I laid out the Vero as I went along. The main front panel LED showing the power is on is shunted across the 48V of the power supplies, so it doesn’t pass any of the ripple current to ground.
Zeners are noisy, so the noise in the mic bias supply is AC filtered via the series 470Ω and 470μF capacitor from the +12V rail, else this noise will be impressed on the mic signal. I didn’t get any hum, even with the transformer in the box.
The long input cable puts some shunt capacitance across the mic. That’s not such a bad thing in that it also shunts RFI, but it could impact the top end. I couldn’t be bothered to work out the details but pinched the results from the University of St Andrews. He says you get 0.2dB loss at 20kHz from a 2.5m typical audio coax. 25m will give you a loss 0f 2dB, which will probably work quite well with that nice lift at 14kHz due to the resonance of the tube. And anyway, have you seen the frequency response of cheap electrets? This isn’t going to be my worst source of error.
The first stage is a gain of 11 amplifier. Perhaps I should try dropping the feedback resistors to 390 ohms and 3k9, since at the moment the 3k9 resistor on the – input to ground may add more voltage noise than necessary. TI seems to cite the TL074 at ~18nV/√Hz, a 3k9 resistor gives about 8nV noise in 1Hz BW dropping to 3nV for 390. But it’s a right pain to change that now. Switching to a LF357 would bring the noise down to about 12nV/√Hz in which case lowering the feedback resistance would be worth doing. However, these are cheap and nasty electrets. Listening to the result3 I don’t find the preamp noise that much greater than the ambient noise + the electret capsule noise. Maybe I should get a job lot of quad opamps including some bipolar types. I used the TL074 because it was a quad op-amp to hand, I couldn’t really bring myself to use a LM324 with its nasty crossover distortion problem4. That was the only other quad I had to hand.
Good audio practice would be to put the amplifier at the outstation with the mics and power it. But I’d need multicore cable. And some way to stop the spiders going for the extra heat. 25m is fine with me, I only need about half that.
Grounding the Pi PSU hum
I wired this to my LS-14 line input. It sounded fine. I then wired it to the Raspberry Pi with the Cirrus sound card, and heard robin song mixed with hellacious hum on my Locusonus feed.
So I put the LS14 on again. No hum. Put the Cirrus back. Masses of hum. In the end I had to mains ground the preamp, the Pi supply is Class 2 double insulated and so was my box. Hum gone.
The hum was presumably the leakage capacitance of the Pi switchmode PSU since my lo-tech PSU in the box was OK on its own, with the battery powered LS14. So I will swap the two-core main cable to the preamp for a three-core cable and ground the 0V rail. Interestingly the locusonus page indicates you may want to ground the Pi, though they said to reduce hiss, which seems bizarre. Those Pi power supplies must be pretty nasty if they are causing people this sort of grief.
These streams are as received, and they are also low, peaking around neg 40dBFS. I had tried boosting the programmable gain amp in the Cirrus and the line in, but it ended up noisy. OK I am using cheap rubbish but it shouldn’t be that noisy. I feel I am short of gain here. It would be OK on a busy street in London.
This is my excuse to get rid of the tyro poor design in the input stage of that excessively high value of R6 and R7. Shame I had buried these deep in the Veroboard layout…
First I thought I’d investigate noise. I removed the mics and cranked the ‘scope gain to the max, taking the jack out straight to the ‘scope
Although the mic inputs are open, the 8k2 bias resistors are still in circuit, so they aren’t really open. Arguably the electret has a source impedance of about that tail resistor. Dunno what the source of the 40k gribbling is, apart that it isn’t my circuit, since it’s still there with power off. It’s not my LED light, either. It comes in handy later on.
I swap the TL074 for a TL084. The 07 series used to be the lower noise versions back in the day, though Texas spec both the 074 and the 084 at 18nV/√Hz nowadays. However, my TL074 has date code 9005, so it is thirty years old now. The TL084 is another TI part from Portugal, this one’s a youthful 29 years old, made in week 35 of 1990
Looks oddly overpainted, eh? maybe it was a TL074 that didn’t make the grade. Anyway, swapping this in for the TL074 gave me this
which is clearly more noise, about 5 divisions rather than 2 and swamping the 40k gribbling, though it was possible to discern it was still there. So although that thread and the specs indicate they were the same nowadays, 30 years ago they weren’t. I don’t have any more ancient chips to see if this was the general case. But I’ll put back the TL074. Maybe I need to buy some quads made in the 21st century if the process has improved 😉
I switched R6 and R7 for 470Ω, giving me a nominal gain of about 84, 17dB more than I had before and about 40dB voltage gain in total. Another look at the noise showed the same amount of noise but more signal from the phantom 40kHz source
It’s not the right way to characterise SNR, but showed I was heading in the right direction 😉
The board is designed to stack vertically in the plastic project box like so
and before somebody yells creepage distance in my lughole I did mill away about 7mm of the Veroboard copper between primary and secondary
which was tiresome, but I needed a board to keep the PCB mounting transformer in one place. It’s been a long time since I needed to make a mains PSU, usually wall-warts are good enough, but then I’d need a SMPS to get the negative rail. I should have used a bigger box and a mains trafo with lugs, but as I said, it’s been a long time since I wrangled a linear mains PSU in a project.
So how does this sound? Again, recorded off locusonus
This one peaks at about neg 7dBFS on the robin. Funny devils, robins, the warble is just under 4k
so roughly in the peak of the Fletcher-Munson curves of audibility, but the he-he-hee trill in between the warble-warble he-hee-hee warble warble at about54s is 7-8k so about 10dB quieter subjectively. The amplitude looks the same on the waveform.
I took the opportunity to set back the Cirrus analogue gain levels by 5dB
and set the PGA to minimum. Analogue gain beats digital gain in my book, and I am now lining up at about -12dB for the nearby robin song. That means I am set for about the right amount of modulation, in the end if it overloads when a chopper flies overhead or the neighbours are mowing their lawn so be it, birdsong is the name of the game. Wind is about 15mph according to the forecast, I am fortunate is being sheltered somewhat from that, though I am using a fence to reduce it more.
It’s clear from listening one of my mics is noisier than the other, I should have tested that beforehand, and perhaps there’s a gain mismatch. This isn’t in the amp – I measured the gain to be the same on both channels as far as the scope can determine. I have plenty of headroom – 13V p-p before clipping. I’d have expected even more, but the TL071 loses about 3V of headroom off either rail ISTR, which is why there is so much misery on the Net when people try and power these off 5V 😉 It’s good enough, and means I can lower the gain of the Cirrus sound card and keep the gain distribution higher than the digital hash.
I will try and think of a better way of mounting the mics, because the problem is most of the birds are on the other side of the fence from the mics, ‘cos that’s where the trees are. I’ve rigged them as spaced omnis about 30cm apart. Ruth’s pergola is a better mounting idea. But my rig’s not bad for starters, and I’ve got something going for IDCD. As long as the rain and the spiders don’t destroy the mics by then…
Getting this project right and levels lined up properly was more involved than I’d expected, but it sounds decent now. Locussonus could do well to have a level bargraph on the setup screen. Listening to other streams vindicates the choice to put in a second-order 300Hz rolloff, there’s nothing that riveting about low-frequency traffic noise IMO. My favourite UK stream on LocusSonus, is Norfolk Wildlife Trust’s Pigney’s Wood at the top of the bulge of East Anglia. There doesn’t seem any way of linking to a particular place on LocusSonus, but it’s easy enough to find.
- unless you hang some outboard hardware onto it, in which case you are using the phone as a user interface to a piece of gear. If a piece of hardware needs an app, I don’t buy it, because apps get orphaned over time as the platform changes, turning the hardware into e-waste. My 10-year old LS-10 is still serviceable, apart from the remote control port. An iGadget lives for about 5 years, before iOS isn’t updated or the app disappears… ↩
- Instant other than the Cirrus driver doesn’t always come up on powerup. I suspect the PSU may not be up to the job. Rebooting using the remote control web interface usually brings the CL card up. Never observed this issue with Raspbian, the Locusonus image uses Arch Linux about which I know nothing. ↩
- I changed my mind on that when I did try the lower value of R6. Having said that I was able to hear one mic was noisier than the other with the original values, it just became more obvious with higher gain and less amplifier noise. ↩
- TI app note on LM 358/324 cores, section 4.4 ↩
Thank you so much Richard for the newsletter , I trust that an outdoor microphone will be achievable so that you may capture the inimitable sound of birdsong . Wishing you and those close to you a safe passage through these very difficult days.
Kind regards
A Constantine Constantinou
That’s an impressive level of effort to record birdsong, I applaud you! The problem I have around here at the moment is that it’s getting warm enough to want to sleep with the windows open but the local owls have got other matters on their minds and there’s a lot of hooting and shrieking some nights. ( The bats are also out and about and I really must get myself a bat detector at some point )
Phones are annoying, you think that they should be better at some things but they’re not. I recently downloaded a metronome / tuner app for my trombone which works pretty well. It’s a bit slow to respond but the main annoyance is that it just stops working on sub-100Hz bass notes which are the exact ones that I wanted to check the tuning on! I don’t know if this is the microphone or the FFT algorithm giving up the ghost ( or maybe both ).
Tawnys are lovely, but while barn owls may look lovely, but they’re not called screech owls for nothing, eh?
> I don’t know if this is the microphone or the FFT algorithm giving up the ghost ( or maybe both ).
Most phones use noise-cancelling microphones, which leak some of the ambient sound round the back of the capsule to cancel out. Or achieve this using more than one mic and sometimes DSP nowadays.
You might get better performance using an omni electret; the phone will supply the bias signal. Your challenge is then to wire up the nasty little 4-pole TRRS plug. Or just use a TRRS to 2* TRS adapter and a regular battery mike. A dynamic will give you too low a signal level. Mind you, I wouldn’t imagine you are short of signal level with a trombone 😉
It would be nice to get a clean recording and run some FFTs on it in real time to see how the harmonics change of the range of the instrument. My PC should be man enough for that if I can get a suitable microphone.
You’re right about the signal level. My uncle had some health problems in his 20s that left him profoundly deaf. However if I let rip at moderate range even he could hear the trombone, bone conduction without physical contact!
Hi Richard,
I have been messing a bout with a Raspberry Pi and a Soundcard to try and stream the audio of Australian wildlife etc. I am trying to get an idea of how much internet data this will eat up if it was left on 24 hours a day using Locusonus ?
Looking at Network Control on the stream box control panel I had
totals upload: 96.5 MiB
totals download: 7.7 MiB
and after 45 minutes
totals upload: 124.4 MiB
totals download: 10.1 MiB
So I make that 0.62MB per min or about 85kbit/s, so you’re looking about 1GB per day
My settings are
stereo stream, 44.1kHz audio quality 0.4 stream type ogg
There is some guidance on setting audio quality that says this
Not sure why I got about half the rate at Q=0.4 as specified for Q=0.5, but this is VBR and there’s not an awful lot going on. Locusonus have been working on the server today, so perhaps they bumped it. But it’ll give you a ballpark, plus the specification of what it’s really meant to be. Good luck with your project!
Thanks Richard. I enjoy reading your Blogs. I first came across them whilst searching for contact microphones. I have a few working and use them to record a singing fence! Where I live there are kilometres and kilometres of wire fenced paddocks. When it is windy they resonate. You can hear them without any need for microphones. The sounds they produce are quite amazing.
Hey Richard,
Been reading over some of your adventures with creating an autonomous recording unit. Thought you should check out the solo software for raspberry pi (https://solo-system.github.io/home.html). They supported the Cirrus Logic Audio Card until it was discontinued. Unfortunately, the software isn’t really maintained anymore, but I have kept revising it on the side with the help of some freelance programmers. I have been using it to help me develop an autonomous recording unit for capturing night flight calls from migrating birds. With help from the freelancers, we were able to get reliable scheduled on/off cycles using certain parameters by using a Sleepy Pi hat (https://spellfoundry.com/product/sleepy-pi-2/). My “stations” now turn themselves on every evening and off every morning to help save sd card space and reduce power consumption.
Of course, this may all be rendered obsolete by the continued refinement of the AudioMoth device (https://www.openacousticdevices.info/audiomoth).
Thank you for the Sleepy Pi link – much appreciated. I hadn’t come across that. I agree that the Audio Moth has rendered the Pi solutions to this moot. In some ways the remote field recorder space has split off into the more fancy wildlife sound recording side, for which the timer via remote controlled LS10… series is suited. I used a PIC micro to pretend to be a remote control and that worked fine. Right up at the high end is a SD702 with a timer on the DC power in where it starts recording on power up. At the lower end the Audio Moth has pretty much fixed what I was trying to do with the Pi, and the new one has sorted the water-resistant enclosure.
But AudioMoth doesn’t do networking, so the Pi still owns this space for LocusSonus. Pi have also raised their game on audio – they bought out IQaudio and now the Codec Zero seems to be an official Pi product. I also have a soft spot for Audioinjector which is a good audio in solution.
But I do like Sleepy Pi – to fix the Pi 4 + touchscreen field computer, which also happens to need a RTC and to be able to be powered off 12V LiPo batteries, which SP also does in principle, so I get a lot of added value out of SleepyPi.
Hi Richard,
While we were not ready for sale when you wrote this, and thought we were farther along than turned out to be the case in that old Birdforum post from 2017, I assure you we are NOT “vapourware.” We have been selling these direct to consumer for over a year, and VERY soon will have them in dozens of Wild Birds Unlmited Stores. If you’d like to try one, you can find contact information on ChirpSounds.com. Reach out. I think you’ll love what you hear.
I’m grateful to your earlier incarnation for showing me how to do it, and you have the price about right. You probably missed that I am British, but I’m more than happy to give you the plug for old times sake and for what looks like a decent retail solution.
Both of my mics are still in service, which is bonkers for four years out in the British weather. Your Chirpsounds TX looks like a decent soution, and good luck with the project!