I'm in the process of planning my first custom mechanical board. The only thing that I'm having trouble with is the LED back lighting. I'm going to use orange leds which draw 2.0 volts and 20 mA. I think the leds running at 3 mA is about the light output I'm looking for. I'm not sure how to wire all the leds in parallel. I can't seem to be able to picture how it would workout for just a single pin. I attached the key layout that I'm going to make. It is a 16 by 9 matrix which would take up 25 pins on a Teensy 2.0. Would there even be enough pins on the Teensy to wire all the switches and the leds?
If someone could tell me if the Teensy could handle everything for the keyboard and help me with a wiring diagram that would be awesome.
Custom board backlighting questions
-
- Location: Central FL
- Main keyboard: G710+
- Main mouse: G602
- Favorite switch: Mx Brown
- DT Pro Member: -
- Attachments
-
- keyboard-layout.png (46.03 KiB) Viewed 946 times
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
Here's how backlight LEDs are usually wired:

All of them on one pin, preferably one that supports PWM (so that it's easier to manage various levels of brightness). You might want to have indicator LEDs (Caps, Scroll, Num Locks) on separate pins.
Another solution is to have a dedicated LED driver chip (which then talks to the Teensy via I2C or something similar). This requires 2 teensy pins.

All of them on one pin, preferably one that supports PWM (so that it's easier to manage various levels of brightness). You might want to have indicator LEDs (Caps, Scroll, Num Locks) on separate pins.
Another solution is to have a dedicated LED driver chip (which then talks to the Teensy via I2C or something similar). This requires 2 teensy pins.
- vvp
- Main keyboard: Katy/K84CS
- Main mouse: symetric 5-buttons + wheel
- Favorite switch: Cherry MX
- DT Pro Member: -
flabbergast's post is good. The only think I would add is if your LED's have only 2 V forward voltage then you can put two led in series into each parallel branch blabbergast did draw. That will halve your power consumption. It is also great if you can dedicate one IO pin to control the backlight. The point is that you will probably need to have backlight switched off till your keyboard is enumerated. Check out this post to see some related notes.
Also I would probably try to find some good FET instead of a bipolar transistor. This will save you the base resistor (you do not need it) and it will almost for sure lower the collector-emitter voltage drop. In general, the idea is like this. If the current switched is low then FET is typically better. If the current being switched on is high then bipolar transistors (or rather IGBTs) may get better. The reason why it is so is that a fully open bipolar transistor behaves more like a diode while fully open FET behaves more like a small resistor. You can find FETs with drain-source resistance of about 45 mΩ with gate-source voltage of 5V easily. That gives you at most 2.25 mV voltage drop at 0.5 A (which is the maximum you can pull from USB). You can find even much better FETs but they will be bigger than 3 mm. With a bipolar transistor your voltage drop will be probably around 0.3 V. If you know better (with lower voltage drop) bipolar transistors then please post.
Also I would probably try to find some good FET instead of a bipolar transistor. This will save you the base resistor (you do not need it) and it will almost for sure lower the collector-emitter voltage drop. In general, the idea is like this. If the current switched is low then FET is typically better. If the current being switched on is high then bipolar transistors (or rather IGBTs) may get better. The reason why it is so is that a fully open bipolar transistor behaves more like a diode while fully open FET behaves more like a small resistor. You can find FETs with drain-source resistance of about 45 mΩ with gate-source voltage of 5V easily. That gives you at most 2.25 mV voltage drop at 0.5 A (which is the maximum you can pull from USB). You can find even much better FETs but they will be bigger than 3 mm. With a bipolar transistor your voltage drop will be probably around 0.3 V. If you know better (with lower voltage drop) bipolar transistors then please post.