/ / INTRODUCTION
While the
Quad NAND Gate 4093 chip was designed to do boolean logic, it can also be misused to synthesize modulating square waves.
A
single NAND gate has two inputs and one output. The 4093 chip has four NAND gates which is why it is referred to as
Quad NAND gate.
NAND stands for one of the common boolean logics (Not AND) where two input states, highs (1s) or lows(0s), define the state of the output.
Truth Table for NAND gate
| input 1 |
input 2 |
output |
| 0 |
0 |
1 |
| 0 |
1 |
1 |
| 1 |
0 |
1 |
| 1 |
1 |
0 |
The chip uses Schmitt Trigger comparators, which provides noiseless and direct swapping of the states.
When states change there is frequency. If the frequency oscillates through air and is in the range of hearing, there is sound. If you do the above mentioned state swapping you generate oscillation, a square wave signal of highs and lows, which can be amplified and heard.
A basic square wave can be made with just one NAND gate. The first input is connected high (+5 to 15V) the second is connected low (GND) via capacitor and the output is fed back to the second input via resistor. The chain of events in a fast loop:
-
input1 is high, input2 is low, making the output high
- the high output recharges the capacitor in time affected by the feedback resistor
- the charged capacitor pulls input2 high, output goes low, capacitor discharges
- cycle repeats
The frequency generated is based on the capacitance and resistance. If you increase the resistance, less current will flow to capacitor, which will slow the
swapping and give you a lower pitch. Using a larger capacitor will make it take longer to recharge, which will also force the range of the pitch lower.
NAND gates can modulate each other. By connecting the output of gate 1 to the input 1 of gate 2, the swapping high-low cycle enables and disables the second gate very fast while the the second gate produces its own frequencies. This can be fed further to the gate 3 and so on. This results to complex square wave modulations.
/ / The Circuit
NAND gates have two inputs and one output, and the 4093 has four NAND gates on it.
Parts
- Quad, 2-input Schmitt trigger NAND gate (4093)
- 1/8" stereo miniplug connector
- 9 V battery connector
- Small capacitors
- Wire
- Variable resistors
- Hex Schmitt Triger (74C14)
- 1/8" stereo miniplug connector
- 9 V battery connector
- Small capacitors
- Wire
- Variable resistors
- 2 Decade Counters (4017)
- Hex Schmitt Triger (74C14)
- 1/8" stereo miniplug connector
- 9 V battery connector
- Small capacitors
- Wire
- Variable resistors
Schematic
Things to keep in mind
If your circuit doesn't work:
- Check your connections
- If the chip gets hot, disconnect the battery immediately.
Make sure the chip is in the board the right way
- Too small a capacitor or resistor will cause the circuit to oscillate at a frequency too high to hear.
- Check that the chip's pins have not been folded
- Make sure GND and power is connected correctly
- Solder wires to the center and right leads of your potentiometer
- Solder black wires onto the following pins of your audio jack

- Solder colored wires onto the following pins of your audio jack

/ / Variable Resistors
- Potentiometers
- LDR
- FSR
- Coins
- Graphite
- When you get the desired effect, freeform solder the circuit
- Start with the power connector.Remove the battery. When you solder the ground and 9 V in place, it will help remind you where things are.

- From here, transplant the circuit: have the breadboard next to the chip you're soldering onto, and slowly move components from the breadboard to the chip. This is a good way to make sure you haven't forgotten anything. Don't forget that the orientation is different if your chip is upside-down and your breadboard is right-side-up.
Wrap the legs around the chip so it stays in place or trim the legs, then solder them on. One of the capacitors might have to stretch if it's going to ground, just make sure the leg doesn't touch anything it shouldn't.


- Add any extra wires.
- Add your resistors.
- Don't add the 1/8" connector yet, since you want to make sure the circuit works first.
- Plug it in! It should be outputting a 0-9 V signal, while sound normally runs at +/-1V. Unplug it. If it works, solder the audio jack to the circuit.
- Hot glue everything in place. Start with the audio connector. This synth isn't meant to last for a long time, but the glue will help when you inevitably drop it.

Source:Handmade Electronic Music, The Art of Hardware Hacking by Nicolas Collins
Kyle McDonald-Nandhopper
http://www.doctronics.co.uk/4017.htm