Skip to main content

4 Channel Audio Switcher

Overview

The purpose of this project was as a test to see if the 4051 mux would be usable in audio switching. I've been designing a programmable guitar pedal switcher and used this as a test project to see if there were any fatal issues with using them for this purpose. I also had some attiny85s around and hadn't found a project for them. Being able to use two pins to control the select lines of 3 muxes was a perfect use case.

In a future iteration I'll try the 4052 mux, the only reason I didn't use one this time is because I didn't have any, and I have heaps of 4051s lying around.


Bill of Materials
  • Attiny85
  • 3 x 4051 Multiplexers
  • 2 x Momentary buttons
  • 4 x Leds
  • 5 x Stereo sockets
  • 1 x 7805 Voltage regulator
  • 2 x 10uF electrolytic capacitors
  • 3 x 1k resistors

Code

The code for this is pretty basic, and self explanatory, with the attiny only using 2 inputs and 2 outputs. Each of the buttons either increments or decrements the current channel. Since the switcher only has 4 channels, only the first 2 select lines are used, with the third select line tied to ground. All 3 4051s use the same select lines.

Using enum classes in this context is a bit overkill, but I've been trying to use as much c++ stuff as possible recently to get more comfortable with it.

I take advantage of the fact that the leds are powered through the common line on the multiplexer to use only one current limiting resistor for all of the leds.

Schematic




Popular posts from this blog

Ableton transport control

Overview The goal of this project for me is to learn more about midi protocol, and venture into ableton live remote midi scripts. This is a basic transport controller for ableton live, but it can be used for any DAW if you manually map the controls to the CC numbers sent by the arduino. The downside of using the arduino nano is that it uses a usb to serial chip to be able to program the atmega328p. As a result of this it requires the use of a serial to midi bridge to be able to communicate with midi devices. I used Hairless MIDI < - > Serial bridge to do this, which can be found here  https://projectgus.github.io/hairless-midiserial/ . If using windows you will also need some sort of virtual midi port to be able to route the midi messages to ableton, the one I use can be found here  http://www.tobias-erichsen.de/software/loopmidi.html . I only use windows so I'm not sure what needs to be done for mac or linux. The next version I work on will use atmega328u4 wh...

Laser pointer arm

Overview Not really an audio project, but still fun. The entire purpose of  this project was to make a silly cat toy. It uses a joystick to control two sg90 servos to move around a laser pointer. This is actually a pretty easy project to setup. The joystick is essentially just two potentiometers, one controls the x axis servo, the other controls the y axis. All you need to do is read the analog values from each of the potentiometers, and use the Arduino map() function to map them to the angles of the servos. This has two modes, on where you control the servos with the joystick, and another where the laser randomly moves around. For the random mode, I thought that just mapping random values directly to the servos would make it too erratic.  Instead of implementing  the random mapping in that way, I made an array of coordinates. This array essentially broke the throw of the laser into a 3x3 grid. Then different positions are randomly chosen from this array, and ...