555 tone
A 555 astable drives a piezo straight from the output pin, no board and no button. There is no microcontroller in it: the simulator solves the 5 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.
Teaching? Assign it to your class in one click.
Intermediate About 20 minutes to build and run. Runs in your browser. Free, and no account needed.
The parts retail for about $5.85. On Mokxi they're free.
What you'll learn
- How a 555 astable oscillator makes a square wave
- How resistor and capacitor values set the pitch
- Driving a piezo directly from a chip output
- Reading a chip pinout: RESET, TRIG, THR, DIS, OUT
- Difficulty: Intermediate
- Time: About 20 minutes
- Parts: 7
How it works
A 555 timer chip is set up here as an astable oscillator, which means it never settles. Its output pin flips high and low over and over by itself. No code runs anywhere.
The 100 nF capacitor charges through the 1k and 4.7k resistors, then drains through the 4.7k resistor alone. The chip watches the capacitor voltage and flips its output at the top and bottom of that swing. The piezo on the output pin turns the flips into a tone.
Parts list
7 parts, plus the jumper wires. They retail for about $5.85; on Mokxi they're free.
- 1 × Full-size breadboard
- 1 × Power, 5 V
- 1 × Resistor, 1k ΩIn Starter Kit, Claw Machine Kit, Halloween Prop Kit.
- 1 × NE555 timer
- 1 × Resistor, 4.7k ΩIn Starter Kit, Claw Machine Kit, Halloween Prop Kit.
- 1 × Capacitor, 100 nFIn Power Bank Kit.
- 1 × Piezo speakerIn Starter Kit, Claw Machine Kit, Vending Machine Kit.
Wiring table
Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.
| Part and pin | Connects to |
|---|---|
| Resistor, 1k Ω pin 2 | 5 V |
| NE555 timer pin RESET | 5 V |
| NE555 timer pin VCC | 5 V |
| NE555 timer pin GND | Ground |
| Capacitor, 100 nF pin 2 | Ground |
| Piezo speaker pin 2 | Ground |
| NE555 timer pin DIS | Resistor, 1k Ω pin 1 |
| Resistor, 4.7k Ω pin 1 | Resistor, 1k Ω pin 1 |
| NE555 timer pin THR | NE555 timer pin TRIG |
| Resistor, 4.7k Ω pin 2 | NE555 timer pin TRIG |
| Capacitor, 100 nF pin 1 | NE555 timer pin TRIG |
| Piezo speaker pin 1 | NE555 timer pin OUT |
The notes that come with it
There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.
// Mokxi: a 555 astable driving a piezo.
// There is no microcontroller here. Press Run and the simulator solves the
// circuit itself.
//
// f = 1.44 / ((R1 + 2 R2) C) = 1.44 / ((1k + 9.4k) x 100nF), about 1.4 kHz.
// Change R2 or C1 in the properties panel and the pitch moves with them.
Troubleshooting
The usual mistakes with this circuit, and the fix for each.
- No sound at all This project
Check that RESET and VCC both reach 5 V and that GND reaches ground. A floating RESET pin can hold the chip off. - The pitch is not the one you expected This project
The pitch depends on both resistors and the capacitor. The note in the circuit gives about 1.4 kHz. Change the 4.7k resistor or the 100 nF capacitor and it moves. - The LED is dim, burns out, or the pin reads wrong because the resistor value is off. Resistor
Read the color bands again. A 220 ohm to 330 ohm resistor suits a typical LED on 5 V. 10k is a common pull-up or pull-down value. Check with a multimeter if unsure. - A pull-up or pull-down resistor is missing, so the input floats and reads random values. Resistor
Tie the input to 5 V or ground through about 10k. Or use INPUT_PULLUP and wire the switch to ground. - The output does nothing or stays high. NE555 timer
Pin 8 goes to the supply, pin 1 to ground, and RESET (pin 4) must be tied high. Floating reset is the most common mistake. - The frequency is unstable or wrong. NE555 timer
Tie pin 5 to ground through a 10 nF capacitor. In astable mode f is about 1.44 divided by (R1 + 2 x R2) x C. Watch the polarity of electrolytic caps. - An electrolytic capacitor heats up, bulges or pops. Capacitor
Electrolytics have a polarity. The stripe marks the negative leg, which goes toward ground. Also keep the voltage under the rated value, such as 10 V or 16 V. - An RC circuit charges much slower or faster than expected. Capacitor
The time constant is R times C. A 10 k resistor with a 100 uF capacitor gives 1 second, and about 5 seconds to charge fully. Check that you read the value on the part right.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.