Tuesday, July 01, 2008

Eight Pots to MIDI CC Data

I have been helping someone out to multiplex eight pots to MIDI CC data. This setup has been tested and found working.

Hardware Setup
The hardware setup is pretty straightforward
• One of the outer legs of the eight pots connect to ground
• The other outer leg connects to 5V
• The circuit uses a 4051 8 to 1 multiplex IC
• Pin 16 of the 4051 connects to 5V
• Pins 6, 7 and 8 of the 4051 connect to ground
• The middle leg of pot 1 connects to pin 13 of the 4051
• The middle leg of pot 2 connects to pin 15 of the 4051
• The middle leg of pot 3 connects to pin 14 of the 4051
• The middle leg of pot 4 connects to pin 12 of the 4051
• The middle leg of pot 5 connects to pin 1 of the 4051
• The middle leg of pot 6 connects to pin 5 of the 4051
• The middle leg of pot 7 connects to pin 2 of the 4051
• The middle leg of pot 8 connects to pin 4 of the 4051
• Pin 3 of the 4051 connects to Arduino analog in 0
• Arduino digital pins 2, 3 and 4 connect to pins 11, 10 and 9 of the 4051 respectively
• Arduino digital pin 1 connects to MIDI 5 pin din pin 5
• Ground connects to MIDI 5 pin din pin 2
• 5V connects to MIDI 5 pin din pin 4 via a 220 ohm resistor

You can download the code here.


Joel said...

Really handy, thanks as always. I'll put this one away for when I try and make my very own "ultimate MIDI controller"! (I'm pretty sure that's something everyone tries at some point, right?)

g.p.macklin said...

Thank you, this is very helpful for a current project.

Sebastian Tomczak said...

Glad you gentlemen found it useful.

@ Joel - Yeah, surely everyone has tried it with some degree of success! Although I feel like I never get away from the drawing board because I can never decide on the exact specs for one that I would want to make and use... :)

Aaron Trubic said...

@sebastian - Thanks so much for this. I've tried a few configurations / sketches with the 4051 and this was the only one that really works. You've done us all a huge favor.

Aaron Trubic said...

Sebastian, I have a question. The 4051 sketch works fine but I cant seem to figure out how to send the digital pin data through the same open serial channel. I love the idea of squeezing out extra analog controls but I'd like to do the same thing with digital on the same controller...


Harminder said...

First of all, fantastic project! Works perfectly, thank you very much for this.

Quick question for you though, I need to hookup 1 or 2 more 4501's with 8 pots on each and I've wired them as you described in "multiplexy" to analog inputs 0,1,2 but I'm a little baffled with the code, what do I need to edit to make them all work together?

Thanks again

Anonymous said...

Hey very cool stuff.
It is working perfectly, however i tried to go a step further using one more 4051 on the same digital inputs and can't figure out how to make it work. Can you please give me a hint?

joao_fonseca88@yahoo.com said...

Hi Sebastian, great project!

I'm trying to build my midi controller based on your's but, i get lots of noise from the pots, any idea why is this happening!? I'm just a newbie and i'm triying to figure out a way to minimize the noise. Hope you can help me.


Vibe Media Share said...

I now this alot to ask but could you create a patch for 12 potentiometers 4 faders and 50 digital inputs cause im tring to build a midi controler with tha arduino mega 2560 any help would be greatly appreciated