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 create an 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) by capacitor and the output is fed back to the second input through a resistor. The chain of events is in a fast loop:
If input1 is high and input2 is low, the output will be high.
The high output recharges the capacitor in time affected by the feedback resistor
The charged capacitor pulls input2 high, then the output goes low and the capacitor discharges.
The cycle repeats.
The frequency generated is based on the capacitance and resistance. If you increase the resistance, then less current will flow to capacitor, which in turn 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 to be 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 second gate produces its own frequencies. This can be fed further to the gate 3 and so on. This results in complex square wave modulations.
The Circuit
NAND gates have two inputs and one output, and the 4093 has four NAND gates on it.
A battery-powered mini amplifier or a Piezo-electric disk
Variable Resistors:
Potentiometers
LDR
FSR
Coins
Graphite
Instructions
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 over.
Make sure GND and power are connected correctly.
Before you start breadboarding
Solder wires to the center and right leads of your potentiometer.
Solder wires to the front and center leads of your audio jack
Quad NAND IC
Quad 2-input NAND Schmitt trigger
Connect power to power and ground to ground
Place chip in breadboard and connect pin 7 to GND and pin 14 to power
Place the smaller cap (.1µF) between pin 2 and GND. place the capacitor close to the chip.
Connect a jumper wire from input 2 to jumper pins. Connect the positive end of the electrolytic capacitor to one of the jumper pins. Connect the other end of the capacitor to GND. When a wire is placed between the jumper, the larger capacitor overrides the smaller and makes the pitch range lower.
Connect pin 1 to power
Connect pin 2 to 3 with a variable resistor (potentiometer,a LDR, coins)
Plug a speaker pin from the jack into pin 3 and the GND wire to GND.
Test the circuit. Test the difference of the smaller and larger capacitor
A Gated Oscillator:
You can use the output of one gate to switch another oscillator on and off. Use a 1MΩ potentiometer to connect pins 2 and 3 (the middle pin of the pot should go to 3 and the third pin of the pot should go to pin 2. Connect a 10µF cap between pin 2 and GND. Connect pin 5 to GND through a .1 µF cap. Connect pins 4 to 5 through a variable resistor connect the output of gate 1 (pin 3) to the input of gate 2 (pin 6). Connect the jack to pin 4.
If oscillator 1 has a large capacitor and runs slowly, you can hear oscillator 2 switch on and off at a regular tempo.As you tune oscillator 1 higher, the on/off functions transforms into a frequency modulation and works as timbre and not tempo.
You can cascade three or four oscillators:
To get more than one oscillator to a single jack, connect each output to the jack through a 10K Ω resistor (3K-1Mω will work, just use the same resistor for each output. The smaller the resistor, the louder the output).Using the resistor allows you to hear each output distinctly.
You can also mix each output with a diode instead of a resistor. This will mix the outputs together. The sum of the frequencies are exaggerated and the original source is obscured.
When you get the desired effect, freeform solder the circuit or solder it to a protoboard.
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.
Bend your circuit into your configuration
Use a digital caliper to measure your components. Write down the dimensions.
Research how people play with knobs and synthesizers. Follow the steps of the design process, then design the housing that reflects your research.
Basic steps of the Design Process
The Design Process requires
Describe the general situation or problem you are trying to solve. Instead of asking what do you want to design? ask why do you want to design that? and what problem and or need will your design ultimately be solving?
Identify your target audience, the group that will benefit from your project. Is the target population an individual, a group, a specific community, or a larger, identifiable population? Is the target population from a specific location (country, region, town), demographic (age or gender), or other identifying characteristics (health condition or employment)? Think about how is your target population connected?
Identify the requirements and constraints. A requirement is a need or a necessity; it's what a particular product or service should do. A constraint is a restriction on the degree of freedom you have in providing a solution to a need or problem.
Ask what are the disadvantages of the present solution to the problem?
Ask what compromises have been made in the present solution?
Determine if the compromises are necessary?
Determine if the solution can be improved?
By taking a new approach.
By making the design more accurate.
By making the design more safe.
By making the design more convenient.
By making the design easier to maintain.
By making the design cheaper to produce.
By making the design more attractive.
Determine if you can reduce the costs by eliminating parts, using different materials, changing the way the product is manufactured?
In a nutshell
Design Step 1: Identify the Need
Design Step 2: Research the Problem
Design Step 3: Brainstorm Possible Solutions
Design Step 4: Engineering Analysis-select the most promising solution
Design Step 5: Construct a Prototype
Design Step 6: Evaluate/Manufacture a Final Product-Reiterate
Getting Started
Keep a record of your questions and answers. The design process will help inform your choices and should be an integral part of your creative process.
Research existing solutions to musical instruments. What aspects of their designs appeal to you, why?
Research how music is played. Make sure you know about knobs and fingering notes than what is provided here on this web page.
What are your constraints? Make a list.
Observe how people approach devices with knobs and how they hold objects. Will your bended circuit rest on a table, be held in a hand or fixed to a surface?
Place chip in breadboard and connect pin 7 to GND and pin 14 to power
Place a .1µF capacitor between pin 1 and GND.
Connect pin 1 to 2 with a variable resistor (potentiometer,a LDR, coins)
Plug a speaker pin from the jack into pin 2 and the GND wire to GND.
Test the circuit
Add volume control:
To get more than one oscillator to a single jack, connect each output to the jack through a 10K Ω resistor (3K-1Mω will work, just use the same resistor for each output. The smaller the resistor, the louder the output).Using the resistor allows you to hear each output distinctly.
You can also mix each output with a diode instead of a resistor. This will mix the outputs together. The sum of the frequencies are exaggerated and the original source is obscured.
When you get the desired effect, freeform solder the circuit or solder it to a protoboard.
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.
Bend your circuit into your configuration
Use a digital caliper to measure your components. Write down the dimensions.
Research how people play with knobs and synthesizers. Follow the steps of the design process, then design the housing that reflects your research.
Basic steps of the Design Process
The Design Process requires
Describe the general situation or problem you are trying to solve. Instead of asking what do you want to design? ask why do you want to design that? and what problem and or need will your design ultimately be solving?
Identify your target audience, the group that will benefit from your project. Is the target population an individual, a group, a specific community, or a larger, identifiable population? Is the target population from a specific location (country, region, town), demographic (age or gender), or other identifying characteristics (health condition or employment)? Think about how is your target population connected?
Identify the requirements and constraints. A requirement is a need or a necessity; it's what a particular product or service should do. A constraint is a restriction on the degree of freedom you have in providing a solution to a need or problem.
Ask what are the disadvantages of the present solution to the problem?
Ask what compromises have been made in the present solution?
Determine if the compromises are necessary?
Determine if the solution can be improved?
By taking a new approach.
By making the design more accurate.
By making the design more safe.
By making the design more convenient.
By making the design easier to maintain.
By making the design cheaper to produce.
By making the design more attractive.
Determine if you can reduce the costs by eliminating parts, using different materials, changing the way the product is manufactured?
In a nutshell
Design Step 1: Identify the Need
Design Step 2: Research the Problem
Design Step 3: Brainstorm Possible Solutions
Design Step 4: Engineering Analysis-select the most promising solution
Design Step 5: Construct a Prototype
Design Step 6: Evaluate/Manufacture a Final Product-Reiterate
Getting Started
Keep a record of your questions and answers. The design process will help inform your choices and should be an integral part of your creative process.
Research existing solutions to musical instruments. What aspects of their designs appeal to you, why?
Research how music is played. Make sure you know about knobs and fingering notes than what is provided here on this web page.
What are your constraints? Make a list.
Observe how people approach devices with knobs and how they hold objects. Will your bended circuit rest on a table, be held in a hand or fixed to a surface?