Learn to shape sound waves with timer chips to create your own digital sampling system emulator.
Sound Synthesis Basics
Anyone familiar with a 555 timer knows that it can create audible frequencies. What you may not have considered is that a timer can manipulate waveforms to create different kinds of sounds. You can actually custom-build your own audio waveform, one digital slice at a time.
The Output Device
Because accidents may happen, you may not want to use a high-quality loudspeaker in this experiment. Still, you do need one that can reproduce a reasonable range of frequencies. A 3″ (75mm) speaker costing around $5 should be adequate, provided it’s mounted in a resonant enclosure such as a project box. See photos below.
I chose a 14538B chip for my first venture into sound synthesis, because it’s loaded with options that were missing from the old 555 chip. It contains two monostable timers, each with two trigger pins and two output pins. One trigger is sensitive to a rising edge, while the other responds to a falling edge. One output is active-high, while the other is active-low. Pinouts are shown below.
The pulse duration from each timer is set with one resistor and one capacitor. If R is resistance in kilohms and C is capacitance in microfarads, you can determine the pulse time, in seconds, using this formula:
T = (R × C) / 1,000
For example, a 22µF capacitor with a 100K resistor will create a pulse lasting 2.2 seconds.
Each timer only runs in monostable mode, but they can trigger each other to create a pulse stream. A circuit to achieve this is shown in the photo below.
My plan is for Timer 1 to create a pulse, after which Timer 2 will create a delay before the next pulse, and the combination will constitute a single cycle in a sound wave. To make the changes in sound quality easier to hear, the frequency must remain constant, which is achieved by controlling the two timers with two sides of a potentiometer. When one timer speeds up, the other slows down by an equal amount, and the output should look like the graphs.
The 14538B operates with a supply of 5V to 18V, and it can be powered with a 9V battery. No voltage regulation is required. Output current is restricted to 10mA, so a 1K resistor must be used with each LED.
When you apply power, nothing happens — because the two timers are waiting for each other. Press and release the tactile switch to create the falling edge required at Pin 11 to trigger Timer 2. When its high output ends, Timer 2 triggers Timer 1 on Pin 5. This to-and-fro process continues indefinitely, as the timers play tag with each other.
Small signal diodes prevent each timer from trying to force a positive voltage into the output of the other. The LEDs show what’s going on. Turn the trimmer to and fro, and watch how they swap the long and short cycles.
Mini Project 1: The Sound of Sound
If the concept is now clear, let’s crank the frequency to an audible value. I chose 600 pulses per second — that is, 600Hz. Remove the two 22µF capacitors and substitute two 0.015µF capacitors. If your meter will measure capacitance, select capacitors whose actual values are as close to each other as possible. This will ensure that the output frequency remains constant when you turn the trimmer.
The 14538B isn’t powerful enough to drive a speaker, so you will need an amplifier. An LM386 chip will do. Wire it as shown in above. A photograph of the complete breadboarded circuit appears below.
Connect the power, press the tactile switch, and listen while you turn the trimmer. When the high pulse and the low pulse are about equal, the sound is mellow, but at opposite ends of the scale it becomes edgier. This is because the shape of the sound wave determines how many harmonics will be audible — the higher frequencies that are a multiple of the one that’s dominant.
Remove the 100K trimmer and substitute a 250K trimmer. This creates a richer range of sounds, because the lower frequency allows more room for harmonics. If you mounted your speaker in a resonant box as I suggested, a 500K trimmer should sound best of all. To learn more about harmonics, try the online tutorial at thedawstudio.com/Tips/Soundwaves.html.
Mini Project 2: Advanced Wave Building
You can go much further into shaping a sound wave. The diagram above shows a concept for a circuit using four 555 timers of the old bipolar type (also known as the TTL type) which can drive a loudspeaker directly. The first timer creates a stream of pulses, triggering the other three timers simultaneously. Each of them is running in one-shot mode for durations that are separately adjustable, and each output goes through a trimmer that is tapped to provide a variable voltage for the loudspeaker. The unequal pulse lengths combine to create different sized horizontal slices of a sound wave. See I for the breadboard schematic.
Wave forms generated by Figure I:
Mini Project 3: Digital Sampling System Emulator
If you want to go still further, you can build an ultrasimple, bargain-basement circuit that emulates the sampling system used in all digital recordings. Figure J below shows the concept. A multiplexer samples each potentiometer very rapidly and sends its voltage through an amplifier to the speaker. Figure K is the breadboard schematic for this.
We’ve been listening to digitally replicated sounds ever since Sony and Philips developed the first audio CDs some 35 years ago. Because the frequencies are actually quite slow by digital standards, all you need is a little imagination to process them with that most basic and familiar component, the timer chip.