What if you had the audio control panel, the dialog in most PCs where you fiddle audio, right next to your PC in physical form? With analog controls, VU meters and input/output selection present for instant access on your desk, you will have the pleasure of controlling them with hand.
I have been meaning to complete this project for some time, but it took a while to get all the parts ordered and PCB fabricated. Finally, it's coming together now. It's implemented as a shield for Arduino UNO and allows following capabilities:
- Two VU meters - red bar and green bar for microphone level
- Analog mic volume control
- Analog speaker volume control
- Touch switch for selecting mic inputs
- Touch switch for selecting speaker outputs
- Touch switch for mic mute/unmute
- A buzzer to beep for touch feedback.
- A display to show input or output selection.
If you came across this blog post by accident, then you most likely know Arduino :). For those who don't, it's an open source microcontroller platform based on an Atmel's 8 bit microcontroller (ATMega328p, specifically) and is incredibly popular among electronics hobbyists for its simplicity and versatility.
The humble start was, of course, with a breadboard and spaghetti of wires :)
Schematic below shows how the electronics is implemented. All of the hardware and software is open source, so the eagle files containing schematics and PCB designs can be downloaded from sourceforge project site (once I create the project :)).
Following picture shows the parts before assembly. The PCB has two parts. One is the main board and the other is the capacitive touch panel.
When mounting on a panel, the two touch panel screws can come from outside the panel. Another screw from top left can secure it additionally.
DisplayThe LED display and bar graphs are driven by MAX7219CNG which is an 8 x 8 matrix LED driver. 4 of the rows are used for driving 4x 7-segment displays and 2 rows for the VU meter graphs. The remaining 2 rows are not used. An excellent library called LedControl exists for Aruduino to control it -- download it from here.
(Image from MAX7219CNG datasheet)
The 4x 7-segment display is mainly used for showing input or output selection being made when their respective touch switches are activated, or current mute status if mic is muted. In addition, it also shows volume in percentage when either of the volume is changed.
The two bar graphs are used to show microphone level. One instantaneous level and other sustained level (which is useful to gauge mic volume heard on other side).
Touch SwitchesThe 3 touch switches are implemented as capacitive touch sensors, however with just enough sensitivity to make them only work as "touch". Look at this excellent article on Capacitive Sense for Arduino that explain how it works. There is no fancy hardware involved.
Fundamentally, it measures the time it takes to charge up the capacitor created by proximity of the hand. Then, based on a preset threshold in charging time, it would identify as "touch". The touch panel is created from a small PCB which is fabricated along side the main PCB. The CapSense library can be download from its github home.
Touch sensitivity resistors R2, R3 and R4Depending on how the audio panel is used, the optimal values for these resistors will vary. I have found that when using as bare-bone with just the PCB (that is, without any enclosure), 1M ohm resistors work good. But if there is going to be an acrylic panel in the front, then 4.7M ohm resistors are better. The schematic shows 4.7M for them assuming there will be acrylic panel in front, if you don't plan on putting an enclosure, go for 1M.
There is a small buzzer on board. It's mainly used to give feedback on activating touch switches. But it can also be used to notify some events on desktop, example IRC events or Facebook notification (a sequence of beeps, for example). With a simple tone() function, the piezo buzzer can play any frequency. A tutorial on how to control the tone to play a melody is here.
Microphone and Speaker Volume control
Two 10K linear potentiometers serve to provide volume control for microphone and speaker. Two analog ports read their values intermediately and Arduino sends change in volume command to PC in percentage. The values are averaged over last 5 samples to smooth out any noise coming from the potentiometers. Interfacing the pots with Arduino is well explained in this article.
Firmware and PC software
The software is work in progress at the moment and I plan to have another blog post to cover it. In general, the hardware is proxying the state of its selections and levels to the software running on the PC. And PC software is sending status of the audio and mic levels. For now, there will be only Linux PC software.
The states are absolute and stored in internal EEPROM. This would allow for setting up the audio to the last settings when the audio panel USB is connected to PC (say, just before taking a VoIP call), overriding any software settings before.