Skip to main content

SOUND DIRECTION AND LOCALISATION WITH PIC16F876A


Detecting Sound
Students often want to use ‘sound’ as an input within electronic projects. Unfortunately sound is not as easy to use as light and temperature, as there is not an instant ‘single component’ solution, as is the case with, for example, an LDR for light or a thermistor for temperature.
The main problems with detecting sound are:
1) electret microphone inserts are low cost, but only produce a very small signal, which requires amplification
2) the background noise level can vary considerably, and so some form of calibration is required
3) some noises, such as a hand-clap, are very quick and so can be ‘missed’ with some electronic circuits (e.g. when using a microcontroller)
Fortunately these problems can all be overcome at low-cost, by using an electret microphone with three common transistors. The circuit shown in Figure 1 will produce an analogue signal between 0 and 3V that can be detected, for instance, with the analogue input pin of a PIC microcontroller (e.g. 16F876). The circuit also includes a ‘time-delay’ feature that extends the time period of the loudest signal. This means the circuit could also be used, for example, to switch a FET on for a period of time to drive a motor.



Operation
The circuit shown in Figure 1 can be used in two ways:
1) As an analogue sound level recorder, for instance connected to the analogue input of a PIC16F876A microcontroller
2) As a digital on/off switch, for instance connected to the digital input of a PIC16F876A  microcontroller.
In the 'sound level recording' mode, the 'sensitivity' control RV1 is first set to minimum and then the 'set-zero' control RV2 is adjusted for zero output (ie 0V on a multi-meter). In practice is it actually better to be very slightly above zero output to avoid a 'dead band'. The ‘sensitivity’ control is now increased to a suitable level for the project. Normal speech at about 50 cm from the microphone will give a DC output of about + 1 V. A handclap will produce a full output of +3 V.
The output is instantly high, but slowly decays - so that the signal is present longer than the actual loud noise. The length of time for the decay varies according to the value of C4 (see explanation below) – the decay time of the output signal is approximately 0.5 seconds with the value of C4 as shown. Increasing C4 to 2.2 uF or 4.7uF provides a decay time of approximately 2 seconds OR 4 seconds.

When a 'digital' on/off output is required, the 'set zero' control, in conjunction with the 'sensitivity' control, are simply used to set a threshold level - where only signals above this level produce an output. Providing that the input signal is high enough, a full 3V pulse will appear at the output.

Stage 1 - Electret Microphone
A low-cost Electret microphone (e.g. Rapid 35-0192) will provide an output of around 1mV rms from normal speech at a distance of around 60 cm. So you can expect signal levels from the microphone of around 1 - 3 mV. An electret microphone is a special type of Field Effect Transistor (FET), which converts vibrations (from sound or physical contact) into an electric signal, which is then amplified internally by the FET. The electret is therefore polarised, and must be connected the correct way around - the 0V (negative) leg can be identified as it is connected to the external metal can by a visible tag.

Stage 2 – Transistor Amplifier
The first transistor, Q1, acts as an amplifier providing a gain of x25 (28dB) over the frequency range 300 Hz - 30 kHz, and so will provide an output signal level in the range 25 - 75 mV. The signal level can be adjusted by the 'sensitivity' control RV1.

Stage 3 – Signal Rectifier
Sound is made up of constantly rising and falling waveforms (try looking at the output from a microphone on an oscilloscope). Therefore to detect the highest sound level you need a reference point, and this circuit therefore only looks at the ‘negative going’ part of the waveform. By amplifying the point at which the sound waveform starts to drop back down again, you can identify the highest point of the sound level.
Therefore the PNP transistor Q2 is biased to cut off, and amplify, only negative-going signals. The resultant positive-going signal, at the collector of Q2, causes D1 to conduct, thus charging C4 to the peak signal voltage.

Stage 4 – Buffer and Time Delay
The third transistor, Q3, is configured as
 an emitter-follower and buffers the signal (and provides a low output impedance). The circuit provides a fast rise of output voltage with a slower decay, proportional to the value of C4. This basically means that C4 defines the ‘delay time’ that the highest sound level is present for. The decay time of the output signal is approximately 0.5 seconds with the value of C


Fig 2 : bread board construction


Fig 3:  testing with my home theater at VOL 10


Fig 4: construction on pcb

Fig 5 : sound coming from right direction

Fig 6 : sound coming from center direction


Fig 7: sound coming from right direction


Fig 8: sound coming from left direction


Pcb link: http://www.4shared.com/office/sBuTKep9ba/2ROBOT_SOUND_DIRpdsprj.html

Hex link: http://www.4shared.com/file/nna-wsJzba/SOUND_DIR.html

contact me on: 08123206299 or ACECCT.18F4500@GMAIL.COM

Comments

Popular posts from this blog

3 Channels Audio Splitter Amplifier Circuit Diagram using TL084

This is the schematic diagram of 3 channels audio splitter amplifier circuit which built using op-amp IC TL084. The 3 channels amplifier output distribution applies a single TL084.   3 Channels Audio Splitter Amplifier Circuit Diagram The very first step is to capacitive coupling having a p. 1.0 ~ electrolytic capacitor. The entries are railways Vee Y2 or 4.5 V. This enables working with an individual 9V power source. A voltage gain of 10 (1 M?/100 Kohm) is obtained in the first stage, as well as the other three floors are connected as a unity gain voltage followers. Every single output stage drives independently through an amplifier output 50 pF capacitor towards the resistance of 5.1 k ohm load. The response range is flat from 10 Hz to 30 kHz.

Build a 3000W Stereo Power Amplifier Circuit Diagram

How to Build a 3000W Stereo Power Amplifier Circuit Diagram? Lets start first we define 3000wstereo power amplifier circuit diagram this circuit has a power output of up to 1500W RMS power amplifier circuit is often used to power sound systems spelunker for outdor. In the final image can be seen a series of power amplifiers using 10 sets of power transistors for the ending. This power amplifier circuit using a transistor amplifier from the front, signal splitter, driver and power amplifier. Current consumption required is quite large power amplifier that is 15-20 A 1500W power amplifier circuits for this. Supply voltage needed by the power of this amplifier is the optimal working order symmetrical 130VDC (130VDC-130VDC ground). 1500W amplifier circuit below is a picture series of mono, stereo if you want to make it necessary to make two copies of the circuit. For more details can be viewed directly image the following 1500W power amplifier circuit. The series of High Power Amplifier 15

Power Amplifier Circuit 2 x 20 W stereo with IC AN7156N

This circuit operate with IC AN7156N . You just can use this IC , because hav'nt similarity it. In this Circuit have 2 input IN R and IN L and have Output R and L . Voltage supply require 15 V , minimum voltage 9 V and maximum voltage 24V . And the voltage must DC voltage , and better the DC voltage filtering . Maximum Output for 1 speaker 25 W , so this circuit have maximum output 2 X 25 W with minimum impedance 4 ohm. See this circuit schematic below : Click image to view enlarge