Build it step by step
0 of 7 doneBuild the counter
Button, LEDs, reset to Q5.
Test it
LEDs step through the four inputs.
Add the 4066
Controls to Q0 to Q3.
Build the bias
Mid-rail with 100 k resistors.
Add the input capacitors
One per jack.
Test with a phone
Listen on each input.
Check for clicks
Adjust the resistors.
How do you build an audio source switcher?
Choose between four audio inputs with a button and an analog multiplexer. You need CD4066 quad bilateral switch, Tactile push button 6 mm, CD4017 Counter, LED 5 mm red × 4, Resistor 4.7 kΩ × 4, Audio jack 3.5 mm (PCB, stereo) × 5, Resistor 100 kΩ × 8, Electrolytic capacitor 10 µF × 5, Ceramic Capacitor 100 nF × 2, 9 V battery, 9 V battery snap with DC jack and Breadboard 830 Tie Points. It takes 7 steps and about 90 minutes.
- Level
- Beginner
- Time
- About 90 min
- Parts
- 12
Parts list
- Integrated CircuitsBuy
- SwitchesBuy
- Integrated CircuitsBuyCD4017 Counter × 1
- SemiconductorsBuyLED 5 mm red × 4
- PassivesBuyResistor 4.7 kΩ × 4
- ConnectorsBuy
- PassivesBuyResistor 100 kΩ × 8
- PassivesBuy
- PassivesBuy
- BatteriesBuy9 V battery × 1
- PowerBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 9 V battery plus | CD4017 pin 16 and CD4066 pin 14 | Supply |
| 9 V battery minus | CD4017 pin 8 and CD4066 pin 7 | Ground |
| CD4017 pin 13 (enable) | Ground | Counting allowed |
| CD4017 pin 15 (reset) | CD4017 pin 1 (Q5) | Counts four sources then a muted fifth step |
| Button | 9 V to CD4017 pin 14, with 100 k and 100 nF from pin 14 to ground | Debounced clock |
| CD4017 Q0, Q1, Q2, Q3 (pins 3, 2, 4, 7) | CD4066 control pins 13, 5, 6, 12 | Select which switch closes |
| Each of Q0 to Q3 | 4.7 k resistor and red LED to ground | Shows the chosen input |
| Input jack tips 1 to 4 | 10 uF each, then CD4066 pins 1, 4, 8, 11 | Four sources |
| CD4066 pins 2, 3, 9, 10 | Joined: the common output node | Selected source appears here |
| Mid-rail node | Two 100 k from 9 V and ground; 100 k from the common node and from each switch input to it | Bias so the audio swings around 4.5 V |
| Common node | 10 uF to the output jack tip | Output |
No code needed
A CD4066 holds four electronic switches that pass audio when their control pin is high, and a CD4017 counter turns on its outputs one after another each time the button is pressed, so each press moves to the next input. The counter's reset is wired to its sixth output, so it counts four sources and then a fifth step with nothing selected, which is the mute. Analog switches like this only pass signals between ground and the supply, so the audio is lifted to half the supply with the resistors and capacitors, which is why every input and the output has a coupling capacitor. If you hear a click when switching, that is the bias settling; the 100 k resistors keep it small. This handles one channel (mono); for stereo, build a second chip with the same counter. Line-level signals from a phone or player are fine; use headphones at a low volume while you test, and do not feed it from speaker outputs. Check each joint before connecting the battery.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Button press | Next LED lights |
| Fifth press | All LEDs off, output muted |
| Audio on one input | Heard only on its step |
| Others | Not heard |
If it does not work
LEDs skip steps
Add the debounce capacitor or lengthen it.
No audio
Check the bias node is near 4.5 V.
Distortion
Lower the source volume.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the audio source switcher?
CD4066 quad bilateral switch, Tactile push button 6 mm, CD4017 Counter, LED 5 mm red × 4, Resistor 4.7 kΩ × 4, Audio jack 3.5 mm (PCB, stereo) × 5, Resistor 100 kΩ × 8, Electrolytic capacitor 10 µF × 5, Ceramic Capacitor 100 nF × 2, 9 V battery, 9 V battery snap with DC jack and Breadboard 830 Tie Points.
How long does the audio source switcher take to build?
About 90 minutes for a beginner maker, in 7 steps.
How do I know the audio source switcher works?
Button press: Next LED lights. Fifth press: All LEDs off, output muted. Audio on one input: Heard only on its step.
LEDs skip steps: what should I check?
Add the debounce capacitor or lengthen it.
No audio: what should I check?
Check the bias node is near 4.5 V.
Distortion: what should I check?
Lower the source volume.
