# Illuminate keyboard using Scroll Lock key

I have a keyboard that I'd like to illuminate when pressing the Scroll Lock key, but I'm not really good when it comes to designing something like that.

I'm planning to use a transistor that will take the current from the Scroll Lock LED, so when activated the transistor will take the higher current from the keyboard input to light one or two LEDs.

I came up with this design but need some help, I don't really know well how to wire the transistor. I measured the Scroll Lock LED voltage on load and it is 2v, I don't know the current since I believe I'd need to unsolder one pin of the LED to measure it (I'm assuming the current is 20mA?).

This is the transistor's datasheet: http://www.futurlec.com/Transistors/C1815.shtml

The resistors on the light LEDs would depend on the LEDs I choose, if possible I'd use white LEDs, if not blue.

I know the transistor leads are actually ECB, I draw them like EBC for the order.

EDIT: Ok I want to add more information, I checked the amperage of a PS/2 keyboard, it was easy because I just had to split a jumper.

The most consuming configuration was with the three LEDs ON and pressing one or more keys continuosly, in that case the amperage was less than 30mA (26.3mA). The voltage is 5.1V.

According to this: http://www.computer-engineering.org/ps2protocol/ PS/2 voltage can go from +4.5V to +5.5V and the max current is 275 mA. Which gives me hopes I can wire the LEDs internally.

I have two white 3.5V 20mA LEDs that work just fine at 3.2V 17mA, so adding them would be around 34mA. That is, less than 30mA from the keyboard plus 34 for the light = less than 64 mA in the worst case (I have to add more components so it will be a bit more at the end), with all the Keyboard LEDs the lights ON and typing.

The circuit would consume less than the max 275mA from the PS/2 protocol.

The other option I'm considering is to make a Joule Thief, and run the lights right from the Scroll Lock LED but I don't know if the frequency of the Joule Thief could interfere with the keyboard or the computer in some way.

• what is the power rating of LED's which you are going to use Oct 21, 2013 at 5:19
• Depends on the color, the blue ones are 3.7 volts 20mA, whites 3.2v 20mA, those are from RadioShack but I may buy from a local store some with other values (if they ever know what the values are). Oct 21, 2013 at 8:27
• The link is broken (the whole www.computer-engineering.org site is broken (the domain expired)). Some alternatives are (essentially the same content by the same author, but slightly different titles and modification dates): The PS/2 Mouse/Keyboard Protocol (2003-05-09), The PS/2 Keyboard Interface (2003-04-01), and The AT-PS/2 Keyboard Interface (2001). Aug 27, 2022 at 16:14
• (The message opening the link is "computer-engineering.org is parked free, courtesy of GoDaddy.com.".) Aug 27, 2022 at 16:26
• Fritzing has taken hold... Aug 27, 2022 at 17:33

1. The idea is generally speaking possible.

2. You must know where exactly the scroll lock led is connected. There are 2 possible variants - between the +5 and some output and between ground and some output.

3. You should use a transistor in common emitter schematic.

4. Learn to draw schematics. Now you are like a stone age man writing a letter using pictures. It is very hard for you and very hard for others. Learn the alphabet of the electronics - schematics.

While I like the general idea here, I can't recommend this solution because the amount of current needed to drive LEDs enough to use as light sources is probably too much for your PS2 or USB port.

And before people jump on me and say that USB allows 500 mA, I'd like to point out that the keyboard has to tell the hub how much current it's using, and these LEDs will make the actual current go over that current setting.

You need to be powering something like this from its own power source. Maybe even another USB port. (There's something in the USB spec about devices that don't hook up the data pins, like those USB gooseneck lamps and a lot of USB chargers.)

Anyway, if you manage to secure a proper power source, the next thing is to figure out how much current to feed the LEDs. Personally, I recommend getting the LEDs and hooking them up through a resistor to a power supply, and changing the resistor until you get what you want. Don't just use the "max forward current" on the data sheet; this level is determined by LED thermal performance, not whether it's a proper brightness. Some of the ultra-efficient ones can get blindingly bright if you're not careful.

Once you've determined the current, add them up and pick your transistor. If you're using a BJT, we're going to use the common-emitter configuration, and remember that the VCEsat is going to reduce the voltage across the current-limiting resistor and adjust the resistor as needed. Choose your BJT such that 1) it can handle the output current (IC), and 2) it can handle the heat (transistor temperature should be around VCEsat * current * Theta_JA (thermal impedance, in deg. C per watt, plus ambient temperature).

Then take the collector current and divide by the minimum hFE of the transistor. This gives you the minimum base current. This is the current you'll need to tap off that scroll lock LED pin; hopefully it's not much.

The emitter-follower circuit you have isn't going to work because it will set the emitter voltage to around the base voltage (gain of 1, hence the name).

• An USB port will supply 100 mA without any current demand negotiation. A quick search through the white LEDs at DigiKey shows a large number of options rated at 50 mA or below, with very decent illumination ratings. Also, the OP wants to illuminate a keyboard, not a room, so presumably the kind of power a small toy LED flashlight consumes (for instance 3 Volts 20 mA) ought to suffice, no? Oct 21, 2013 at 8:07
• Yeah a couple ~3v 20mA LEDs will do more than better. Oct 21, 2013 at 8:36
• I was inspired by this video: youtube.com/watch?v=iOn72Y5DT6M there he uses the same voltage from the Scroll Lock LED so I'm hoping my idea is possible. Oct 21, 2013 at 8:51
• @AnindoGhosh My point was that the keyboard is already using some part of that 100 mA, and likely isn't declaring itself as a 500 mA load, so the LEDs will have to live with whatever current is left. If power can be obtained from a second USB port, then 100 mA it is. Oct 21, 2013 at 14:41
• I think that if I use a dedicated USB port I would prefer drilling a hole on the table and putting a switch to it, but I wouldn't like to do that, it's too messy. I'll try to check the current to see if I have any chance to put the LEDs internally. Oct 23, 2013 at 2:17