Skip navigation
Electronic Design

Low-Cost Microcontroller Acts As A Microphone Simulator

If you have ever been involved in testing microphones while setting up a PA system, you have probably heard the phrase, “Testing, one, two, three” countless times. This idea describes a small, self-contained unit able to simulate spoken voice. It achieves this by driving a microphone input line with a sine wave at an appropriate level. Simply press the button and the module runs for five minutes. It then turns itself off using the PIC microcontroller’s “sleep” mode.

The sine wave is about 400 Hz, depending on the accuracy of the PIC’s internal oscillator frequency. In this application, this is not at all critical. If greater accuracy is required, an external crystal can be used. Users can adapt this circuit to almost any other output frequency (or waveform), or amount of on-time. They simply have to change the delay variables in the program or the constants in the lookup table.

The simple circuitry is based on a PIC16C505 microcontroller that functions as a sine-wave lookup table. This device maintains an appropriate delay between points and drives a simple R-2R 6-bit digital-to-analog converter (DAC). Use of standard 1% resistors produces less than half of an LSB error. The sine wave has 72 stored values (at 5° increments). Therefore, the waveform is very smooth, with harmonics starting at about 30 kHz.

A single capacitor (C2) serves as a low-pass filter, attenuating harmonics by more than 30 dB. Since the harmonics are initially about 30 dB below the fundamental amplitude, the output is very clean. An audio transformer is used to supply isolation and attenuation. It also provides additional attenuation of the harmonics.

Also provided is an output port (B0) that goes high during operation to drive a high-efficiency LED. This indicates that the device is on. The LED draws several milliamps, while the circuitry itself draws less than 500 mA when running. Without the LED, the circuit would provide thousands of five-minute operations on a small lithium (Li) battery. While in the “sleep” mode, the microcontroller draws less than 0.1 mA of current.

To prevent a turn-on “pop,” the chip produces a 100-ms ramp-up at turnon. It avoids a turn-off “pop” by using the same slow ramp-down at turn-off.

A prototype was constructed inside a short length of conduit that contained a male Cannon A3M-style connector with a small pushbutton in the back. The module is powered by a coin-sized Li battery that will work acceptably (with a reduced output) down to 2.5 V. C4 allows the unit to function properly with phantom power applied.

Editor's Note: The source code listing for this Idea For Design is no longer available.

See associated figure

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.