Monday, October 8, 2012

Apollo 13: Basic Wiring

*deep breath*

YOWZA, it's been since nam since I last posted and for that I sincerely apologize. As I said in the post before this, I had Maker Faire coming up fast on the schedule so I was rather tied up. Then before I knew it, I was off researching my next project, one thing led to another...and then within the past week a friend posts on my facebook wall "Hey congratulations on making this site!" I thought, "What site? Why would I be on a website?"

But then I saw this in my then minimized browser window...

You can read the article here, (http://createdigitalmusic.com/2012/10/diy-maven-apollo-13-is-a-beautiful-handmade-aluminum-ableton-live-controller/). To say the least, it's incredibly well written, flattering, and more than anything reminded me of the following...

I made a promise to write these posts, and I am going to do just that.
So let's get started. Ahem. K. I'm ready.


Basic Wiring: Faders and Knobs
If there is one thing that may scare a lot of people about this project (assuming you weren't frightened or scared off already) is dealing with first hand with electronics. My college curriculum had three electrical engineering courses thrown at me, and they only slightly provided some help throughout this entire debacle. Fortunately for you, electronics, circuits, and all of this stuff has become crazily cheap to do.

My first ever self assembled board.

What you're looking at in the above picture is the A/B send return board. There are two in the assembly of this project each containing 6 "mini faders" see the parts sections for these little guys.


The above photo shows what I'm up against. I need 2 boards with 6 mini faders on each of them. In addition to this, you also can see I have a single complete launch channel consisting of 6 buttons for 6 clips of audio and the two buttons above each channel - record and cue. When I in my first post that "I need to break this thing down into it's respective parts" I did that by breaking down what a single channel of control offered up to the software. 1 volume slider, 10 buttons (A/B cross fader assign, 6 launch, 2 rec/cue, channel on/off), 2 mini faders, and 4 knobs - totalling 17 unique controls per channel over the course of 6 channels.

But back to the boards, because buttons weren't something I was ready to tackle then. Those were more complex in wiring, linear and rotary potentiometers (faders and knobs) were something I was ready to do immediately and know I could quickly produce preliminary results with. The perf board used in all photos and this project was purchased from Radio Shack and has no copper coating - it is plain. But you can get copper coated ones, doesn't change the end result. In hindsight, it may have been easier to do with those.

Potentiometers here are types of analog controls and to break down what it is and how these things work, allow me the following picture I found by a Google search.

A rotary potentiometer

A rotary (knob) or linear (slider) potentiometers has (at the minimum) three pins for wiring. In the above example and in the case of every knob I've seen there is a pin dedicated to Off, Wiper, and On. I'm sure the words "On" and "Off" make instant sense to you, but wiper? What's that? The wiper is the pin that simply put - conveys the data. It's the thing providing the value. It's the thing saying how much or how little something is happening. But to get that value, we need to run electricity through the two other pins - in one and out the other.

Go full screen super size on this one so you can the melted solder. I used the tool to hold the knob in place so I could have a soldering iron in one hand and the wire/solder somehow held in the other. You can see here the pin layout I described. Wiper is middle!

Yup. Lot's of soldering. Also, this is where I realized that Version 4 of the faceplate couldn't work because the 8 random knobs running along the right of the mixer (left side in the picture) were facing out towards the eventual box edge!

Green is the wiper, i was gearing up for one of my first tests of a single channel of 4 knobs. No solder here, just tightly wound wire to wire.

Now the final wiring changed only slightly from the above picture, instead of pseudo-braiding each knobs wires together I braided a row of knobs ground, wipers, and lead (high) wires respectively. So that way I could distribute power to a single source, ground to a single, and run all my wipers to a similar central location.

Let's Talk About Electricity!
So applying this concept to an electrical circuit 5V flows into the first pin, the knob is turned all the way to left (off) the third pin has 0V coming out of it. You turn the dial a bit, suddenly the third pin is releasing energy. You turn it more and more, and eventually the electricity freely flows through the circuit until the whole 5V is coming out of the third pin. As you turn the dial the reistance in the circuit is decreasing, but the electrical output is increasing. Resistance should make sense in this example - you are resisting the flow of electricity.  Imagine turning a faucet on slowly. How bout that analogy? The Wiper pin is sending data to something. In the case of our MIDI controller it's sending it's resistance value outbound to the control board.

Enough of that, more wiring.


Fortunately these linear faders also have three pins, a low, a wiper, and a high. I'm intentionally color coding my wiring. Black is 0/off/ground(GND) and Red is hot/on/5v/. This also serves the added benefit that I don't put these things in backwards. I know what the "bottom" of the fader is. But it isn't the bottom because I soldered a black cable to the pin, its 0/gnd/off because the data sheet from the manufacturer tells me so.

It tells me on this 3 pin linear fader further away from the other two is high/on. The pin between the two further is the wiper, and the remaining one is the ground/off pin. Brilliantly simple. I want to add this is a generally safe assumption to make of faders pin layout.

Wait, 3 minimum? Faders can have more?
Yes they can. Because more complex, expensive faders may output to two different sources. They may take in multiple sources. Some are motorized and have extra pins to supply power to the motor. If I ever get crazy enough to do this project again, apart from a lot of things I'd do differently now that I have the knowledge is that I'd do motorized faders and call it Apollo 11.


In the above photo you can see the results. I have two wires coming off of each fader, the remaining pin (closest to the black wire/pin) is the wiper which I used green wire for. If I had access to radioactive looking yellow/green I probably would have used that in a heartbeat. Even though no one will see it when it's done for me I thought "Well, that'd be cool." But alas, didn't do it. Just used what was around me.

The wire is 18GA wire from Radio Shack. They sell it in packs of three featuring red, black, and green.


So what about those plastic things? Those white tubes jutting out from your board? What are those things? Why do you need them? Plus, why do you have knife out? The plastic things are Nylon Standoffs (https://www.sparkfun.com/products/10462). Try to visualize the following - I have a faceplate and components underneath it. Those components need to mount somehow. 3/4" nylon stand off sink these faders enough to shorten there rather crazy long physical fader and...well yeah, it puts some distance between the board and the faceplate. They are made out of nylon and help things stand off from a surface. So simply named right? I suppose, because when I first heard about them I had no idea why I'd need them. That link also features the page for matching screws.

The knife in the picture (blade is by Xikar, don't believe they make it anymore) has a fine point (obviously) - so I used it to widen the holes by twisting the blade around in the hole on the perf board to something I could poke a screw through and tighten the stand off onto. Crazy simple right?! But talk about a lot of widdling.

Regardless, the end result is the knobs are completely wired, the mini faders are mounted on the perf board and the pins poke through the back just enough to wire them. OH! Right, before someone is wondering how I "mounted" the fader into the perf board - I just used tinier holes so they had to snap more or less into place. This vs. the screws which I widdled large enough holes they simply just fell into.

Finally I should add the large faders used for the volume, master volume, and BPM are the same exact principle. 3 pins. Low, Wiper, High. Wired identically. Just bigger.




And so...
The faceplate exists. 
The box exists.
The first half of controls are wired and ready to be connected to power, ground, and respective wiper pins.
I have half of a functioning controller.
I can consider this project at 40% to 50% complete. 


Because this part I wanted to do. I wasn't scared of doing it whatsoever. I'll be honest, I was putting off something that had me concerned for the longest time...

How the hell do you wire all of these buttons AND make them light up?


Until next time everyone! Thanks for reading, thank you for your patience, and thank you as always for all your kind words.


You want to know what the matrix is? The matrix is...