Monday, December 27, 2010

Eliminated a sub-board

I've realized: one of the planned boards is essentially useless, just turning a mess of panel-mount jacks into a 2x8 header.   I think I'll just run the each input's L/R/G straight into the audio board.  This removes the need to route 11 signals to one point, allowing me to put each input or output right next to each pot.

Sunday, December 19, 2010

Layout changes

1) I don't need an op amp for each channel.   Just a single one to make up gain at the end of the chain.
2) How about a multiplexer to switch any of the 5 signals back to the arduino to read its level?

Tonight's audio board layout:
5 digital pots and a multiplexer.

Friday, December 17, 2010

Well this is useless

I didn't stay sober last night.  I did, however, learn about Eagle's curved-trace tools.

Wednesday, December 15, 2010

Mainboard ideas

Spent some more time in Eagle, working on the mainboard.  Once I decided to break everything out into separate boards the mainboard got really simple- I'm really just running each ping out to a header.
Only after I laid this out did I remember that I'd never seen single-row ribbon cable connectors.  Oh well.

Monday, December 13, 2010

About single-supply op amps

So I figured out what was so horribly wrong with my audio circuit.

Turns out, op amps need three points of reference.  Normally these are something like ground, +5V, and -5V.   But when you're working with just USB power, you've only got +5 and ground;  I needed something in between the two so the opamp knew wtf to do.   Today I learned about voltage dividers, and split my +5V into a +2.5V, into the non-inverting input on the opamp.  Boom, hotdog.   Audio is clean and clear in almost every situation.  Additionally, adding audio inputs works exactly as I'd like, everything stays nice and even and blends perfectly.

I was hearing some weird distortion at times, but a little reading suggested I buffer my voltage divider with another opamp.  This seems to have done the trick.  Now if I only had a working microprocessor...

Sunday, December 12, 2010

Whoops, that wasn't right.

In the process of mucking around with the power supply for the opamp, I managed to touch a +5V lead to something that didn't like it.   LEDs fizzled and the little blinky routine on the arduino stopped blinking.

Repeated attempts to talk to the arduino are ignored.  I've killed it, jim.

Saturday, December 11, 2010

Audio trouble

Started learning about audio circuits.   Dang.   The basic digital stuff I've done was all Tab A into Slot B plug-and play, but analog is quite different.   I've familiar with the most basic of concepts, but the interaction between components is wrapped in a hazy mist of math and magic.

After learning about audio mixers, it's clear that I want to make an active mixer, one that sums the inputs with an inverting opamp.  If I'm reading right, this will ensure that adding and removing inputs will not change the overall level of my output.

I have a dream of powering this whole device from the 5V 500mA USB supply, so I'm at a disadvantage when it comes to analog part selection.    Picked up a couple of cheapo opamps that claim to work at low voltage. Wired an audio signal to my breadboard, plugged the things in as per the datasheets, and BWAAAAARRRRRRAAAHHHHHARRRRRRRRGHHHHAAAAAADZZZZZZ horrible noises.  After a few hours (days) of reading and reconfiguring I have actual audio passing though the thing, but it sounds like stir-fried ass. I am doing something wrong.

Thursday, December 9, 2010

Parts arrive!

Happiness is a Sparkfun box in the mail.

I've now got the ATMega328 chip, some power supply components, a fistful of switches and LEDs, a nicely pre-built USB<->Serial board, and several other toys.  A trip to Fry's scored me a breadboard, an assortment of resistors and capacitors, and a couple of basic shift registers.  Time to get to work!

First things first:  let's learn a bit of arduino code.  After wiring the thing up (thanks to some great howtos) and doing a few of the requisite Blink-An-LED tutorials, I've got a working microprocessor!

Tuesday, December 7, 2010

Learning Eagle

With the basic parts and function list in my head, it's time to start arranging this stuff on a circuit board.  The ubiquitous choice for hobbyists seems to be Eagle.   Since they offer a free version, and it runs happily on Linux, it will be my choice as well.

One of the limitation in the free version of Eagle is PCB size.  After only a little experimentation I've determined that I will not be able to fit everything within their constraints.   The only (free) solution I can think of is moving functional groups of components to separate boards, and I will bus them together with some ribbon cable or something.

Here's an initial terrible layout for the audio board.   I have no doubt that I'm making lots of mistakes, but it's strangely compelling and fun.
That's the five DS1807 digital Pots in the center.   The two headers would go to the mainboard and an I/O board (full of 1/4" jacks).   In the upper left is the MSGEQ7 chip.

Sunday, December 5, 2010

The initial concept

Sparkfun.com is awesome.   They've got a large catalog of fun parts, but more importantly they have an incredible growing library of information for the beginner.  Arduino.cc is also awesome.   With these two (and, you know, the rest of the internet) I've been able to lay out a basic game plan


So here's the idea:

With the help of my brother, I found a neat part, the DS1807 2-channel digitally-controlled potentiometer.  This chip is controlled via I2C.  I will use five of these (one per channel and one on master) with an Arduino, controlled from the MythTV box via USB/serial.

Some LEDs for status would be nice.  These look perfect, little audio bar meters.  I'll need to learn how to control a lot of LEDs with not many pins (the arduino-loaded chip I plan to use has 14 digital pins and 6 analog).  A little research taught me about shift registers, where two pins become eight.  a google search for 'LED matrix' brings up a whole mess of ideas and info.

A knob + switches for a simple external interface would be nice.  Something like this and these.

For the microprocessor, I considered getting a full arduino board but ultimately took a leap of faith and ordered just the bare chip, pre-loaded with arduino bootloader.  This means I will have to lay out all of the supporting components myself (power supply, oscillator, etc) but it will also give me a lot more flexibility in my final design.

Finally, I came across the MSGEQ7, a neat little chip that could allow me to show a simple 7-band frequency display.  

Friday, December 3, 2010

Building a digitally-controlled line mixer with Arduino

About a month ago I started designing a 4-channel digitally-controlled stereo line mixer.  This blog is to be a journal of my progress.

File this under White Whine if you like, but I'm frustrated.   My MythTV box does a fantastic job in our living room, but any time I want to use the speakers for something else it means digging around in a mess of wires to find the audio jack. The computer monitor we use for a 'TV' has some basic audio routing abilities, but it's awkward and the quality is terrible.   A simple cheap line mixer would solve the problem, but I want to control the volume of everything (record player, mp3 player, etc) from the IR remote that's already working on the MythTV box.   After exploring the idea of servo-controlling the volume knob on the speakers (and a lengthy conversation with my brother) I decided to build the whole dang mixer.

I have never done any of this before.   I have almost zero experience in analog circuits, absolutely no experience in digital circuits, and I'm completely unfamiliar with most of the software I'll be using.

Is there an easier solution?  Probably.   This project is as much about learning as it is about the final product.  Hell, I don't even know if my plan will work.