Sensing microphone output via readadc

tt92

Member
After a fair bit of experimenting and with a lot of informed and informative help from regulars on these forums, I have a reliable Picaxe 08M based device for triggering a camera shutter.
In essence, a PIR-actuated nightlight is connected to an input pin of the 08M and is sensed by readadc whenever a passerby triggers the PIR.
The passer-by in this case is the elusive lyrebird, who flits onto his performance mound, sings and displays his remarkable plumage for up to twenty minutes at a time, and flits off to another mound.
The Picaxe program waits for a response from the PIR, triggers the camera every five seconds for one minute, and then waits for another trigger. In theory, if the bird is still performing at the end of the minute, he will trigger the PIR again.
Not so. What happens is that the bird stands in the one spot, singing like mad, but not moving enough to trigger the PIR again until he leaves, leaving us with the first minute of his concert and a fleeting shot of his backside as he leaves, up to twenty minutes later.
But for those twenty minutes he is singing almost non-stop, and very loudly.
Is there a simple way to connect a microphone to the input pin and have it provide a signal that can be sensed in a similar way the signal from the PIR?
Some facts:
1. The battery in the Canon G2 camera(s) lasts about seven hours while it is waiting to take some images. If the camera is turned on and allowed to photograph continually in the hope that the bird might turn up, the battery is exhausted in a couple of hours.
2. I could make a voice-operated relay which would need 12Volts and a handful of batteries.
3. One of my hurdles is the fact that there are other birds within earshot and I don't want them to trigger the device. I need to be able to control the output level so that I get only the bird on the mound.
 

sghioto

Senior Member
tt92,

You could use a highly directional pickup microphone connected to an amplifier circuit that converts the audio to a variable DC voltage. I would keep the PIR as the initial trigger of the camera as you have now and use the DC output from the mic to keep the camera going as needed. With the right amp design it shouldn't be a problem getting the levels required with enough isolation from other birds.

Steve G
 

lbenson

Senior Member
sound sensor or detector

I was sensing the sound of a boiler coming on, so a different condition, but the circuit shown in the tread below seemed very adjustable for sensitivity, especially if R3 and R4 are replaced with another pot. The whole thread was related to my issue, but the final post had the circuit which I found most useful, using an electret mic and two rail-to-rail op amps.

http://www.picaxeforum.co.uk/showpost.php?p=93295&postcount=54

It is astonishing what volume a small bird can produce, but it will be interesting to see if you can capture the sound and distinguish it from competing sounds. I put a check in the software to throw away short signals which were false triggerings--you may have to be creative since you want to start recording as soon as the trigger is activated.

(Steve posted as I was writing--he was very helpful in assisting me in getting my circuit to perform as desired.)
 
Last edited:

QuIcK

Senior Member
Mayb take some time, and try to record the bird singing. use a spectrograph program (i think audacity has one) and it will show you volume against frequency over time. (db in colour: red for loud, blue for quiet; freq on y-axis; time on x-axis).
knowing where in the audio range the bird is singing will help tailor the circuit. after that, all you need to do is set up a band-pass circuit (2 caps and a resistor) to target the frequency range that bird is singing in. do this around cap C2 (c2 is dumping HF to ground. put a cap before C2, and you will block low frequencies. You could play with the value for C1 to do this, which may be better.)
this should help you cut out background noise, and potentially other birds, saving film etc.
that sound to dc ciruit is perfect for what you want, just needs a tweak to set the band-pass region
 

fernando_g

Senior Member
tt92,

I would keep the PIR as the initial trigger of the camera as you have now and use the DC output from the mic to keep the camera going as needed.
Steve G
That would be exactly my recommendation, too.
The PIR can trigger via an interrupt. The interrupt subroutine will then include reading the ADC values from the mic amp. You may want to add some hysteresis too.
On the hardware side, make sure that you include some sort of infrasonic filter, which can be as simple as AC-coupling the mike. Small wind gusts can generate substantial shifts in a DC coupled amplifier. Or a windscreen across the mike.

Whatever your results, are, please share some of your best pics on this forum. I'm pretty sure there will be some amazing ones and people here will appreciate them.
 

tt92

Member
It will take me a while to absorb ibenson's circuit.
In my wordy initial post, I neglected to mention a couple of the restraints I face.
I have about three bytes available in my 08M.
I haven't room in my little boxes for a bigger Picaxe.
I need at least four, and up to eight, of whatever sound-sensing
devices I end up making.
On the plus side, I have several recordings of his song that we made last year using Audacity, and I can use those to practice recognising the target bird (who will be less than a metre from the microphone) and ignoring his more distant competitors.
And yes, I will post some pictures.:)
 
Top