DJ MIDI Controller with RGB LED's

Status
Not open for further replies.
So I'm thinking about starting a new project for a DJ style MIDI controller, using teensy 3.1. I've gone with it because I think it's the best for this project as it provides quite a few I/O's, it can act as a HID MIDI device, and it's ARM based which I believe is faster than AVR based versions(?)
Anyway the setup I hope will go as so:
6 rotary pots
5 slide pots
3 encoders
around 20 buttons
6 RGB led's
Hopefully this seems plausable to do with one teensy module, and without any multiplexers as teensy 3.1 should have enough inputs for this.
There's however one feature I wanted to impliment that I'm not sure about, I had the idea to have some kind of illumination around the rotary potentiometers to make it look nice, I thought of just having an LED underneath the front panel through some transparent material around the pot. I then thought about having teensy change the colour of the RGB LED from depending how far the potentiometer is turned. For example up to halfway the LED is green, then past halfway is is red.
I'm not sure how to go about doing this, as I'm not too experienced with coding. Can anyone point me towards a library or something that would be able to acheive all these inputs with the LED's?
 
You can get potentionmeters that are hollow inside that you can put in a LED such as: http://www.mouser.com/ProductDetail...=sGAEpiMZZMtC25l1F4XBU2XprB/cmu2f2zh/W0EmggM=

However, it seems like a complex project if you have never done much programming.

<edit>
Lets see, 6 rotary pots + 5 slide pots + 3 encoders is 14 analog inputs, which the Teensy 3.1 has (it has 21 analog inputs). Only 10 of the analog pins are easily accessible with pins on the side, and 1 at the back row. The other 3 pins would have to be soldered to pads underneath the Teensy (or on top).

if you add 20 buttons, and 1 pin to control 6 RGB leds wired up as ws2812 (neopixel), you will pretty much exhaust the pins, and have to wire all of the solder pads underneath the Teensy. Presumably you want the buttons/pots to control something, but you didn't list any outputs. I suspect you will ultimately need to move some of the buttons and/or pots to outboard chips like i2c, which may impact timings, etc.
 
Last edited:
However, it seems like a complex project if you have never done much programming.
I forgot to mention, I was going to follow this tutorial which uses teensy 2++. It provides the code for you, you only have to fill in the blanks which means I should be able to use it, the only issue is, it's for teensy 2++ and not 3.1. Since 3.1 is newer I think it's probably better, but would it be more beneficial though to use teensy 2++ for the purposes of this project?
Lets see, 6 rotary pots + 5 slide pots + 3 encoders is 14 analog inputs, which the Teensy 3.1 has (it has 21 analog inputs). Only 10 of the analog pins are easily accessible with pins on the side, and 1 at the back row. The other 3 pins would have to be soldered to pads underneath the Teensy (or on top).
Since I was planning to use a stripboard around teensy, I guess I could solder a wire to the pads and connect them to a row on the board, like this

if you add 20 buttons, and 1 pin to control 6 RGB leds wired up as ws2812 (neopixel), you will pretty much exhaust the pins, and have to wire all of the solder pads underneath the Teensy. Presumably you want the buttons/pots to control something, but you didn't list any outputs. I suspect you will ultimately need to move some of the buttons and/or pots to outboard chips like i2c, which may impact timings, etc.
Yeah I was hoping to have it all connected to one teensy module, since I want to use all these inputs to send MIDI messages to control a DJ software like traktor, VDJ etc., so I want to reduce latency as much as possible. The ws2812 looks interesting though, I'm not sure how I would set it up so as the colour around each pot changes as I turn the pot. Because the pot wiper is already sending data to teensy. I guess I could use the output pins on teensy to control each LED but I'm not sure how to go about coding that.
 
6 rotary pots
5 slide pots
3 encoders
around 20 buttons
6 RGB led's

I added that up to 55 pins, if connected in the simplest way. I figured 2 pins for each encoder and 3 for each RGB LED.

I'd probably use something like this for the RGB LEDs.

http://www.adafruit.com/products/1429

The blue ones can be tricky to drive directly from a Teensy 3.1 pin, since it only outputs 3.3V and blue LEDs sometimes need 3V or more to light up. Using a driver board, or WS2812 LEDs solves that problem and frees up pins.

You'll probably also need to connect the buttons in a matrix or use shift registers or multiplexing to free up some pins.
 
That LED driver seems good, just thinking about how to set it up is the difficult thing
I was thinking of using 4051's to multiplex some of the inputs to free up some pins
 
Last edited:
Depending on the space you have available on the midi device, I would suggest one of these little guys around the pot wheels. The small ones seem to have an inner diameter about the size of a quarter (and they look killer and pretty inexpensive!). They are really just a set of neopixels (ws2812s) on a round pre-assembled pcb.

http://www.adafruit.com/products/1643

I'm sure adafruit has some sample code for using the ring as a level indicator but just to get you in the right direction.

Code:
void SetRing(int potValue){
   int potValue = analogRead(potPin);
   int potScale = map(potValue,potMin,potMax,0,384);    //This will appropriately scale your pot value from 0 to 384
   int ringScale = map(potScale,0,255,0,RingLEDCount);  //Scale the value to the proportional amount of 
                                                                            //LEDs to light up around ring

      for (int RingLED=0; RingLED < RingLEDCount; L++)      //For all the LEDs we want to illuminate
         {
             strip.setPixelColor(RingLED, Wheel(potScale));    //Set the "on" leds to a color from the color wheel
         };
   strip.show();
}


This is just one way out of countless you could show to pot value using the ring. This specific example would give a level indicator by turning on the leds around the ring as the value increases as well as fading the ones that are on from the bottom of the color wheel spectrum to the top.

Hope that gives you some ideas.

PS. I'm currently sending midi values from a Novation Launch pad to a PC and then spewing them back out to the arduino so I think this would be a great project to see completed considering the direct to teensy aspect.
 
Last edited:
[If you are using this system to make the entire kit for you then you would want to follow it exactly and the kit would include the Teensy++ 2.0, the wooden case, the metal top plate and so on.
demo_controller_1_thumb.jpg

Each module can have approximately 28 digital inputs/outputs, 23 analog inputs, and 4 rotary encoders
That kit does by the way use the CD4067BE port expander.
Also bear in mind
Keep in mind this controller framework is not really designed to control more than a few LEDs. Now that is not to say you can't use many LEDs in this project, you just can't control them, ie, turn them on and off when you please.)

If you are using that general idea to create and build your own controller then you would need port expanders and would need to learn some programmming. Its all certainly possible.

Paul, you might want to link TeensyMonster and the related instructable to the projects page.
 
Last edited:
Wow, lots of information :p
That neopixel ring looks great, only downside is that I live in the UK, so they're about £6 a piece from a UK supplier, considering I'd want to have one around each EQ knob on the DJ controller (there's 6 of them) it would get quite pricey. The ws2812 though, sparkfun's UK suppliers sell a pack of 10 for £5 making that option much better (even if they're without the breakout boards, I'll still hopefully manage to solder them). Now my question is, can I control the colour of a ws2812 with one pot, while that pot also sends MIDI messages?

As an alternative, I'm also looking at using a 74HC595 shift register to increase the amount of PWM/digital outputs, so I can control 6 RGB led's (I guess that's actually 18 LED's).

This will look so cool if it works :cool:

EDIT: I've sketched up a quick schematic to show how everything will connect to Teensy 3.1 (all the pots, encoders and buttons)
SCH_V1.jpg

Those LED's in the top left are simply for illumination in my design (they're not controlled by anything).
Also 4051's are used to multiplex buttons and pots
 
Last edited:
This will look so cool if it works :cool:

I hope you'll post some photos when it's built. ;)


On the schematic, here's a few quick comments....

I don't see any current limiting resistors on the RGB LEDs. Unless the LEDs have them built in, you probably need to add resistors.

You probably want to use 74HCT595 shift registers. The "HCT" ones are designed to run on 5V power, but they properly receive 3V signals.

The 4051 chips should be run from 3.3V power. Use 74HC4051 chips. The old CD4051 types are rated to work up to 15 volts. When used at 3.3V, they work, but not nearly as well as the "HC" types that are optimized to perform well at lower voltages.

In the upper right corner, you've got 24 LEDs running from 5 volts, each with 100 ohm resistors. If those are blue LEDs (approx 3.2V), each will have approx 18 mA. If they're red (approx 1.8V), each will have about 32 mA. Multiplied by 24, that adds up to quite a lot of current, and that's on top of the RGB LEDs. USB has a 500 mA maximum when connected to a PC or powered hub, and 100 mA on unpowered hubs. You might need to scale the current down (increase the resistor values) if running only from USB power.
 
Ah yes, I forgot to add those resistors on the RGB leds :p

Thanks for the info about the chips though, I was slightly confused at all the variations of 595's and 4051's. Since you said power them with 3.3 volts, that means adding a resistor on pin 16 right? (The vcc pin for 4051's)

In that array of leds, I'm using these quite bright red leds (I chose bright ones so they can shine through the parts of the enclosure) the forward voltage for them is 2.4V, the average forward current is rated at 30ma, the maximum I believe is 50ma (I'll find the datasheet soon). If I lower that to 20ma per led, that means 150ohm resistors. This should be high enough so a USB port can supply enough current to all the LED's right?
 
Last edited:
Status
Not open for further replies.
Back
Top