Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: MIDI controller with pots, pushbuttons and LED

  1. #1
    Junior Member
    Join Date
    Apr 2019
    Posts
    3

    MIDI controller with pots, pushbuttons and LED

    Hi everyone!

    I want to build a MIDI controller with 32 pots, 12 LEDs and 12 pushbuttons with a Teensy LC. Everything has to be USB powered. The teensy will read every cycle the status of the pots and the pushbuttons. If status changes it will send a MIDI message over USB to the PC. The controller will also receive MIDI messages from the PC to turn on/off the LEDs.
    I'm trying to plan everything right on the HW side. Here is the you can see the block diagram of the controller.
    Click image for larger version. 

Name:	Untitled.png 
Views:	33 
Size:	33.0 KB 
ID:	16399

    The 32 pots (10k value) and the pushbuttons are connected to 3x 74HC4067 mux. This allows me to use a total of 16 digital pins and two analog pins (4 bit address + 1 pin enable + 1 pin analog input for each 4067 connected to pots and 4 bit address + 1 pin enable + 1 pin digital input with pullup for the one connected to the pushbuttons).

    Now i need to wire the LED part. I found this to PWM 12 leds with just 3 pins and two 74VHC595. All the LEDs can be on at a given time, so the power consumption of the LEDs is 20mA*12 = 240mA (assuming i'm not PWMing the led). The 3.3V regulator has a maximum current of 100mA. So i need to connect the 595 to the +5v pin of the Teensy (which uses the USB 5V - 500mA max). But the 595 datasheet says that the minimum volt allowed to have a an logic high at the input of the 595 is 0.7 * Vcc, so 0.7*5V = 3.5v. The Teensy will output 3.3V, so i can't wire things like that.

    Am I missing something? Is there some smart way to connect everything? Do i need to put a 5 to 3.3V regulator to power the 595?
    Also, is the teensy fast enough to do everything (scan the pots/buttons, send MIDI, receive MIDI, PWM LEDs with shift registers)?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    74VHC595 probably isn't a great choice for driving 20 mA. I believe it's rated for only 8 mA current, and whether all 8 pins can do that simultaneously (staying within recommended specs) is questionable. Probably better to use something like TPIC6C595, and connect each LED+resistor between its output pin and +5V.

    You might need level shifters to get the 3.3V signals up to 5V level, for input to that TPIC6C595 chip. Any of the "HCT" chips works, like 74HCT125, since they recognize anything over 2.0V as logic high, even when running at 5.5V.


    Also, is the teensy fast enough to do everything (scan the pots/buttons, send MIDI, receive MIDI, PWM LEDs with shift registers)?
    Yes, Teensy LC is plenty fast enough.

    If you were also going to process audio signals, that's where you'd definitely want to step up to Teensy 3.2 or higher.

  3. #3
    Junior Member
    Join Date
    Apr 2019
    Posts
    3
    Hi Paul, thank you for help!

    I found what could be ideal for me to have a low part count (for 12 LEDs i need 2 8-bit shift register and 3 level shifters).
    Searching i found TLC6C5816-Q1, which is basically a 16 bit shift register (so i just need one). It can accept input high signal down to 2.4V, so no need to use level shifters. The downside is that it comes with a HTSSOP (28) package, i'm not experienced with SMD soldering but i need to start somewhere

    The schematic is basically in the datasheet. There are some extra pins for the diagnostic functionality, but i don't need them.
    I'll keep on searching to find a bare 16 bit shift register which can accept 3.3V levels and drive the LEDs without any extra functionality to not mess around with unused pins (ground them? Leave unconnected? I need to read the datasheet really well). Extra points for a more DIY-friendly package!
    Last edited by ozlow.own; 04-11-2019 at 12:35 PM. Reason: typo

  4. #4
    Junior Member
    Join Date
    Apr 2019
    Posts
    3
    Actually for a even lower part count and DIY-friendly package i could use a MAX6969 (DIP package, 16 bit shift register with 50 mA per pin) and power it with a 5V to 3.3V regulator, so no need to put 12 resistors in series with the LEDs. I hope this way is suitable!

  5. #5
    Hello, I just ran into the same problem, this your final soultion work? Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •