Author Topic: RGB under key LEDs, Almost ready to wire. Need Advice!  (Read 2376 times)

0 Members and 1 Guest are viewing this topic.

Offline Griftrix

  • Thread Starter
  • Posts: 22
RGB under key LEDs, Almost ready to wire. Need Advice!
« on: Sun, 12 February 2017, 15:17:23 »
Hello!

after the awesome advice earlier on layout and parts, I have ordered and obtained most of the things to build the 60% layout I posted in this thread.

I even (finally) found some RGB LEDs that are designed to fit in the switches I have!

I've started experimenting with programming the teensy ++ 2.0, and reading the source code for the QMK firmware, and there are only 2 things I don't have figured out yet.  How do I wire a common cathode charlieplexed LED matrix? and how do I power 2 16x9 LED Drivers from the USB/teensy?

I saw somewhere that you can charlieplex a common cathode RGB setup, but the sketch would be "too complicated for a beginner", and so they didn't explain the wiring.  The good news is, programming is the only skill in this arena where I am not a beginner, and I should be able to handle even very complex timing and logic.  It's the EE wiring stuff I need help with :).

I THINK those LED drivers I linked can do good things, and PMW and stuff, and can repeat signals and even switch between 8 animation "frames" as needed, which could help do some of the charlieplexed lighting I want.  I just need a little bit of extra advice to put it all together.

Thanks!
-Griftrix
« Last Edit: Sun, 12 February 2017, 16:29:06 by Griftrix »

Offline Griftrix

  • Thread Starter
  • Posts: 22
Re: RGB under key LEDs, Almost ready to wire. Need Advice!
« Reply #1 on: Sun, 12 February 2017, 18:30:12 »
Since I only need 62 RGB LEDs, making a 4x4x4 charliplexed cube, and then just repositioning the LEDs SHOULD work.
https://aglick.com/charliecube.html

It will be a rats nest under the hood.  I'll have to be VERY careful with soldering and insulation (new skills to me).

-Griftrix

Offline cribbit

  • Posts: 288
Re: RGB under key LEDs, Almost ready to wire. Need Advice!
« Reply #2 on: Tue, 14 February 2017, 19:25:52 »
Very interesting! The self-made RGB question is one that I've been thinking of trying to tackle for a while now. Charlieplexing looks very interesting - far too many solutions just go straight to getting more pins.

Doing all the wiring will likely require some sort of breadboard or even a home etched PCB.
I typed this post on my Slanck. I also developed a stronger, cleaner, easier handwiring method.


Offline Griftrix

  • Thread Starter
  • Posts: 22
Re: RGB under key LEDs, Almost ready to wire. Need Advice!
« Reply #3 on: Sun, 19 February 2017, 11:36:34 »
I did some experiments yesterday with my teensy ++ 2.0.  All of this is new to me, so I started connecting things and writing software.   Assuming I can use general IO pins on the teensy, I have enough pins to drive a 15x14 (5x14 RGB LED) matrix behind the keys, and 14x5 key switches.  To get RGB LEDs to actually be RGB, you need to adjust the current for them to change the brightness of the colors properly.   I tried to do some manual PWM in software, and lit my LED every 14th frame.  This would be the longest I could light it to guarantee that every LED will be addressable.  It produced a dim light.  I don't think I can go much dimmer to produce other colors.  Experimentation will follow of course.  I'm thinking that I need to draw more power from the teensy or something so I can use transistors to amplify the overall current.

How do I draw more current?  Do I need a USB splitter and some usb break out boards to convert it to straight + -, or is there some other way?  I know the teensy has the + - pin outs on it, but I don't know the right way to hook things up to that, or get the right current draw.  Also, does anyone have recommendations on how to calculate the transistors I need?  I also have some adafruit 16x9 charlieplexed LED matrix drivers.  these have lots of PWM pins, but I don't know how to power them either.  I also don't know if I can use them for a non charlieplexed matrix, because that wiring seems silly hard to me, and I'm afraid of a short in the tight space a keyboard has.

Everything in EE is new to me for this keyboard project.  The only skills I have are software skills.

Thanks!
-Griftrix

Offline Griftrix

  • Thread Starter
  • Posts: 22
Re: RGB under key LEDs, Almost ready to wire. Need Advice!
« Reply #4 on: Wed, 22 February 2017, 01:45:43 »
My transistors arrived!  100 2n2222 transistors are smaller than I expected.  The next experiment will be manually PWMing 15 LEDs off 1 pin and 1 transistor, every 14th frame (14 columns on the in research keyboard).  I just got an email that my acrylic case has shipped from massdrop.  Only waiting on some more experiments and final behind switch LEDs to have all the parts..  After the 15 LED test, I will do a 1/14 frame RGB color single LED test.  To make sure I have enough brightness to get actual RGB colors while flickering between 14 columns (at 15 rows, 3x5 rows for rgb, 14 columns is just a smaller number to flicker with).  I will be writing my final software to flicker at the minimum number of columns needed for the current display style.  This means that a single key lit will light brighter than a whole row of keys lit, and possibly also modify flickering per row now that I think about it, but the overall brightness of the board will be more similar.  IE: 1 bright light vs 15 dim lights is closer in brightness than 1 dim light vs 15 dim lights. 

If my tests go well, then I will be able to do full RGB backlighting of a 62 key keyboard with only a teensy ++ 2.0 as the controller, and no additional PWN drivers or anything.  If they don't... then I'll get a 24 pin PWM LED driver and do more tests :).  Also, if the transistor experiment works on 15 LEDs in parallel, then I will be wiring 15 transistors to the voltage out of my teensy.  That WOULD be crowded, so I'll intend to do some sort of forked wiring system, where it starts with 2 connections and ends with 15 leaves, like on a binary tree or something.

That reminds me.  If I am successful in my endeavors, I will take inspiration from cribbit and try to write a good LED wiring guide.  It's a sorely lacking section in the making stuff sticky thread :(.  Hopefully, as a complete newbie to electrical engineering, I can provide a good beginner perspective to explain it to other novices.

-Griftrix
« Last Edit: Wed, 22 February 2017, 01:48:28 by Griftrix »

Offline OfTheWild

  • * Esteemed Elder
  • Posts: 1308
  • Location: Cary, NC
  • Make things. Have fun.
    • Studios of the Wild
Re: RGB under key LEDs, Almost ready to wire. Need Advice!
« Reply #5 on: Fri, 03 March 2017, 20:50:00 »
I'm just replying to let you know this isnt "falling on deaf ears". I'm following along waiting for your results of trial and error... I just have no answers to your questions.
 :thumb:
-Dana