geekhack
geekhack Projects => Making Stuff Together! => Topic started by: Tomliginyu on Mon, 09 January 2017, 20:44:51
-
Hi guys,
I could use some help. I'm building a custom keyboard (sandwhich case, no pcb) with a Teensy++ 2.0. I have 68 switches and would like to add leds but am having trouble calculating (or finding info about) what the Teensy puts out. I would like to add 68 blue/purple leds attached to the pwm pins in groups of 17 in parallel. Can anybody help me with resistors or give me info on what kind of power I can expect from the Teensy?
Thanks!
-
From the datasheet, Chapter 31, page 390.
http://www.atmel.com/images/doc7593.pdf (http://www.atmel.com/images/doc7593.pdf)
40mA max per pin. 200mA max total for entire device. It is not practical to power that many LEDs directly from the Teensy++.
You will need to build a driver circuit controlled by the PWM pins. Google "arduino high current output" for lots of ways to do this.
-
Thanks the info.
Could I potentially take a jumper wire off the USB power to do this? I ask because I added leds to my magicforce this way using 1k resistors.
-
Is this where the LEDs are always on? You could do that. Your current limit will be the 500mA that you can draw from the USB port.
-
best option would be a led control circuit connected to the teensy
-
http://uk.farnell.com/stmicroelectronics/stp08cp05mtr/led-driver-8bit-30mhz-nsoic-16/dp/2460704
-
Kolec,
How do I go about using a "led control circuit connected to the teensy"?
VVP,
How do I go about attaching a led driver to the teensy?
Sorry if I sound terrible, but I don't have a whole bunch of experience with IC items. My lack of understanding makes googling a little* overwhelming.
-
i would use a tlc5940 led driver
https://www.pjrc.com/teensy/td_libs_Tlc5940.html
-
I do not have schematic on my hands. If you cannot figure it out form the data sheets then go with the kolec94 proposal.
Anyway the significant difference between drivers is how you intend to use them.
If you want to dedicate one led driver output per each led then kolec94 proposal is better. But for a keyboard with N backlit keys you need floor((N+15)/16) led drivers: e.g. for 80 key keyboard you need 5 led drivers.
If you want to put the leds into a matrix (and possibly also merge one side of the matrix with the key scanning)* then my proposal is better: e.g. for a 80 key keyboard you would need one or two led drivers (depends whether your matrix will be 8x10 or 2x8x5).
(*) https://geekhack.org/index.php?topic=48851.msg2321035#msg2321035
-
I do not have schematic on my hands. If you cannot figure it out form the data sheets then go with the kolec94 proposal.
Anyway the significant difference between drivers is how you intend to use them.
If you want to dedicate one led driver output per each led then kolec94 proposal is better. But for a keyboard with N backlit keys you need floor((N+15)/16) led drivers: e.g. for 80 key keyboard you need 5 led drivers.
If you want to put the leds into a matrix (and possibly also merge one side of the matrix with the key scanning)* then my proposal is better: e.g. for a 80 key keyboard you would need one or two led drivers (depends whether your matrix will be 8x10 or 2x8x5).
(*) https://geekhack.org/index.php?topic=48851.msg2321035#msg2321035
you can do more leds if you multiplex them or go with a tlc5958 i think
-
Something like this maybe?
https://www.adafruit.com/products/2946
(https://cdn-shop.adafruit.com/970x728/2946-02.jpg)
-
you can do more leds if you multiplex them or go with a tlc5958 i think
Correct. But that means you are updating brightness data (192 bit per row) with each multiplex switch. You can update them for each key (128 bit per row) and use a cheaper LED driver.