Make noise with a PIC

Peter Guettler, APS Software Engineering GmbH, Cologne, Germany -- 8/7/2003

Building a stable noise generator for audio-frequency purposes requires only a few components. The circuit in Figure 1 relies on linear-feedback shift registers and some simple software. An eight-pin Microchip (www.microchip.com) PIC12C508 controller (IC2) with a short program generates pseudorandom noise at its output pin, GP0. A single controller is sufficient for simple applications. To obtain Gaussian-distributed noise, you can use a number of identical PIC controllers in parallel in a true realization of the central-limit theorem. (The central-limit theorem states that the sum of an infinite number of noise sources has Gaussian distribution, regardless of the individual noise distribution of each generator.) Using an infinite number of noise generators is impractical, but 10 to 16 are sufficient in most cases. And, because the smallest member of the PIC family is an inexpensive chip with low current consumption, the circuit is easy to realize.

All noise generators run the same program (Listing 1). Perfectionists might program each PIC with an individual initial value for the shift register, but, because all controllers run uncorrelated with their own internal oscillators and start out of reset at different times, this measure is unnecessary. Op amp IC1A sums and level-shifts the noise signals. Summing resistors R1 and R2 must have a value of 10 kΩ times the number of noise generators you use. The output signal of IC1A feeds a –3-dB/octave filter to obtain pink noise. Buffer IC1B decouples the filter and provides low output impedance. The signal amplitude is approximately 400 mV p-p with a flat spectral distribution of 20 Hz to 20 kHz. Closing S1 or applying a low level at pin GP4 immediately stops all noise generators and freezes the prevailing signal amplitude.

ADVERTISEMENT

© 2009, Reed Business Information, a division of Reed Elsevier Inc. All Rights Reserved.