Detecting a tone with a microphone

Hi,

I want to put together two arduinos that do a little performance together. Each one will have a speaker playing a repetitive tone and I want the two identical boards to create something like a Morse code conversation. One will randomly start beeping for a short period of time and when it's finishes the other one will take over and vice verse.

What's the easiest way to detect a specific audio tone produced by the other arduino, even if there is ambient noise in the room?
Should I look and use an FFT library or something, or a specific arduino module that does that?
Any pointers to code or suggestions will be very helpful.

I am planning to buy and use arduino UNO.

thanks a lot
georgios

Hardware is probably easiest. A Phase Locked Loop (PLL) does what you want. A Google search will provide a bunch of info for you. The 74HC4046 should be a good choice for you. Easy to get and relatively easy to use.

Much easier to use the UM3763 tone detector chip.

I once made a Sheep dog game using two tones of whistles to drive the dog left or right.

Does it absolutely have to use tone detection? I think it would be far easier to get working reliably if you just added a pair of RF24 transceivers to your solution so that the two Arduinos could communication wirelessly.