updated on 20-04-2009
Sense of Direction

Some senses for Rino

Sense of Hearing

The third target in explorer competition is sound. Some speakers in some of the boxes spread a 4KHz tone; similarly to the light target the robot must stops close to the box containing the speaker and lights up a yellow LED.

A simple system to recognize this tone is to use some microphones to receive the sound, amplify and filter it and use a tone decoder to trigger the controller when the signal exceeds the threshold. This requires the robots to travel randomly until it comes close to the speaker. A more sophisticated way is to use an “electronic ear” to detect also the direction from where the sound come. A couple of microphones at a distance of one wavelength (about 8cm) each other and some maths performed with DSP libraries of a dsPIC to measure the phase difference between the two signals can solve the problem but that’s still to come.

Dino robot, the older brother of Rino, with microphones and "simple" sound board installed. Even if simple it have had some successes in competitions

A prototype of the sound board realized on a perfboard and its Eagle project

To detect a little, single tone in a very noisy environment, with most of the noise generated by the robot itself, it is not so easy. Imagine the noise of a competition field, crowded of chatting people that shot pictures and movies, or other competitors while they are testing their own robots.

For this reason too, correctly revealing a sound target gives you the highest score, 3 points compared with 2 points for light source and 1 point for gas.

The complete schematic used is shown in Fig. 4. It can use two double opamps OPA2244 or a single quad opamps OPA4244 chip from Texas Instruments or whatever else opamp with similar features.

We can divide the schematic diagram in 5 sections to simplify the explanation.

1 - Virtual ground section

The first difficulty is the power supply. Usually you have a single, 5V power supply for your robot. To have an output signal level swing wide enough to avoid spurious waves generated by signal clipping, you need at least a quasi rail-to-rail opamp. Fortunately there are many of the modern opamps that can work with a single power supply and an output swing from ground to Vcc-1V, allowing an output signal of 1,4V rms with 5V power supply.

Using a single power supply you need to create a “virtual ground”, offsetting the input and output signals to half of the power supply. There are some different techniques to do that, well explained in many electronic books. A good and practical tutorial for people that don’t like to dust off their too much theoretical schoolbooks is the application note “A Single Supply Op Amp Circuit Collection”, published by Texas Instruments.

Because you have a multiple stage amplifier, the best solution is to dedicate one section of the chip to obtain a single, good, low impedance virtual ground circuit for all of the stages. The resistors and capacitors needed to obtain a filtered reference are only connected to this opamp, the output can now be used as the signal ground for all of the other stages.

2 - Mixer section.

To catch the sound from every direction it comes, three electret microphones are mounted in three different directions. In this stage the signals are mixed and slightly amplified. Each stage has a little gain, getting an overall gain factor of 250. In this way you get all the gain needed to drive the tone decoder at the right level, with the best characteristics in terms of stability and input impedance for each stage. The decoupling capacitors, together with input resistors, have a first 3KHz high-pass filter effect that cuts off most of the noise.

The experience shown the importance of the decoupling filter formed by R36, C33, C34, C35, C36 to filter the power supply for the active microphones. The internal oscillators of NE567 tone decoder in fact, is at the same frequency we have to detect, injecting a lot of noise in the power supply line.

3 - Band pass filter section. 

After mixing and a first amplification the signal goes to the band-pass section that filters out all the unwanted signals. This stage has a gain factor of 5 in 4KHz central frequency, with an 8% bandwidth (320Hz). Once again the Net helps a lazy designer like I am, there are a lot of programs online that do for you the entire job finding the right values for resistors and capacitors, also approximating them to the commercial values available. An example. Using a variable resistor for R17 the central frequency can be trimmed accurately.

4 - Final amplification and adjusting section

The 4KHz signal alone goes now to the final stage that amplifies it for another gain factor up to 14. This stage adjusts the sensitivity of the complete system. The regulation trimmer is at the input of the stage to avoid saturation.

5 - Tone decoder

The correct level of signal is sent to the input of the tone decoder. This is a classic application of the Philips semiconductors Tone decoder/phase-locked loop NE567. The IC is a PLL system that sets low the output when the PLL locks an input signal with the same frequency of internal VCO, frequency determined by some external components.

The primary function of this component is to drive a load whenever a sustained signal within its detection band is present at the input. The bandwidth, center frequency and output delay are independently determined by means of four external components. The values of these components can be calculated with the formulas in the datasheet or with some helping programs such as the basic program NE567.bas.

Eventually, the output of NE567 is the digital signal that can be connected to an input port of the microcontroller to know when the sound target is revealed.