geekhack

geekhack Projects => Making Stuff Together! => DIY Discussions ARCHIVE => Topic started by: nanu on Sat, 29 August 2009, 10:28:12

Title: Switching LEDs In A Filco
Post by: nanu on Sat, 29 August 2009, 10:28:12
You could also try something like pin sockets (http://www.allelectronics.com/make-a-store/item/SIP-30/SNAPPABLE-30-PIN-SIP-SOCKET-.1-CENTERS/-/1.html) between the PCB and the LEDs, to afford capricious swappability.
Title: Switching LEDs In A Filco
Post by: sixty on Mon, 31 August 2009, 02:06:10
I think there is no possible way (at least under windows) to make the LED state change without the actual key state changing. So your idea regarding the wpm-o-meter might not work out, since as soon as caps lock comes in it would stArT mAkInG yOu TyPE likE thIs.
Title: Switching LEDs In A Filco
Post by: JohnElliott on Mon, 31 August 2009, 02:51:01
Quote from: sixty;113271
I think there is no possible way (at least under windows) to make the LED state change without the actual key state changing.


Actually, there is. You use IOCTL_KEYBOARD_SET_INDICATORS (http://msdn.microsoft.com/en-us/library/ms791035.aspx). Here's a demo project (http://www.codeguru.com/cpp/w-p/system/keyboard/article.php/c2825).
Title: Switching LEDs In A Filco
Post by: sixty on Mon, 31 August 2009, 03:38:07
Quote from: JohnElliott;113275
Actually, there is. You use IOCTL_KEYBOARD_SET_INDICATORS (http://msdn.microsoft.com/en-us/library/ms791035.aspx). Here's a demo project (http://www.codeguru.com/cpp/w-p/system/keyboard/article.php/c2825).

Interesting. Just compiled the sample source and it does not seem to work though. Telling me scroll lock should be flashing, just that it does not. Have you used this method before? Any idea what might be the problem? Keyboard is connected using USB.
Title: Switching LEDs In A Filco
Post by: kode on Mon, 31 August 2009, 04:04:56
Yeah, I once used a plugin for winamp that flashed the leds without me SuFfErrInG sTuDLyCaPs.
Title: Switching LEDs In A Filco
Post by: sixty on Mon, 31 August 2009, 04:23:06
Quote from: sixty;113277
Interesting. Just compiled the sample source and it does not seem to work though. Telling me scroll lock should be flashing, just that it does not. Have you used this method before? Any idea what might be the problem? Keyboard is connected using USB.


Okay, just tested with a PS2 keyboard. Works flawless. I converted the example code to .net and I am now able to use the .dll in my own applications. This is great stuff. Thanks for sharing the link!
Title: Switching LEDs In A Filco
Post by: sixty on Mon, 31 August 2009, 07:18:45
That method is great stuff. A friend helped me out a bit and these are the results so far:


My next idea would be to make a MB SENSO/SIMON clone that could use only the keyboard LEDs with the according keys below (/, *, - on numpad) - along with the pc speaker beep. How freaking cool would that be? I will start writing that tonight, maybe.
Title: Switching LEDs In A Filco
Post by: o2dazone on Mon, 31 August 2009, 12:29:40
that is crazy
Title: Switching LEDs In A Filco
Post by: molto on Mon, 31 August 2009, 16:41:44
Quote from: sixty;113277
Interesting. Just compiled the sample source and it does not seem to work though. Telling me scroll lock should be flashing, just that it does not. Have you used this method before? Any idea what might be the problem? Keyboard is connected using USB.
It doesn't work because the sample code is not PnP-aware (hyphen correct?). It just tries to access the first keyboard device (which is often, but not necessarily, a virtual one) in an obsolete way.
The right approach is to enumerate all GUID_DEVINTERFACE_KEYBOARD (http://msdn.microsoft.com/en-us/library/bb663141.aspx) instances by using the SetupAPI (http://msdn.microsoft.com/en-us/library/ms791318.aspx) and RegisterDeviceNotification() (http://msdn.microsoft.com/en-us/library/aa363431.aspx).
Alternatively, you can set ConnectMultiplePorts and SendOutputToAllPorts in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kbdclass\Parameters to 1 (and restart) in order to run the keyboard class driver in compatibility mode.
Title: Switching LEDs In A Filco
Post by: talis on Mon, 31 August 2009, 19:05:05
Should have gone with the pink (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=67-2062-ND) ones.
Title: Switching LEDs In A Filco
Post by: talis on Mon, 31 August 2009, 19:56:46
The typical Vforward of a red/green/yellow LED is about 1.6-1.7V, as long as you choose a blue LED with the same or higher Vforward you will draw the same or less current so you should be fine.

If you have a multimeter with a diode checker (look for the --|>|--- symbol), you can be even safer and use it to measure the forward voltage.
Title: Switching LEDs In A Filco
Post by: nanu on Mon, 31 August 2009, 20:40:44
Hi, electronics newb here.
Since the Vforward of blue/white LEDs is usually 3V or more, is it possible that I could
just replace resistors somewhere, for a keyboard that has dim green LEDs?
Title: Switching LEDs In A Filco
Post by: talis on Mon, 31 August 2009, 23:30:49
1/(1/r1+1/r2) is the resulting parallel resistance =P.

You run the risk of damaging the output of the controller if you start drawing too much power from it, so be careful decreasing the resistance.

To calculate the current that the old LED was drawing, you need to know the output voltage (probably +5v in most cases), the Vforward of the LED, and the resistance.

I = V/R = (Vcc-Vforward)/R = (5-Vfoward)/R in most cases.

Given that initial current, you can compute the new resistor needed to maintain the same current draw with (this is the Vfoward of the new LED):

R = V/I = (Vcc-Vfoward)/I = (5-Vfoward)/I

Then pick the next largest available standard resistance value.

That should guarantee its as bright as can be, without risking any damage to the controller.
Title: Switching LEDs In A Filco
Post by: sixty on Fri, 04 September 2009, 11:38:15
Quote from: molto;113477

Alternatively, you can set ConnectMultiplePorts and SendOutputToAllPorts in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kbdclass\Parameters to 1 (and restart) in order to run the keyboard class driver in compatibility mode.


This does not seem to work - I just checked and this reg entry is already set to 1 for me. Any idea?
Title: Switching LEDs In A Filco
Post by: sixty on Fri, 04 September 2009, 11:51:23
Quote from: ripster;114760
May be time to start your own LED Blinkomatic post.


good call!
Title: Switching LEDs In A Filco
Post by: nowsharing on Mon, 15 March 2010, 13:33:33
Sorry to dig up this old post, but I too would be thrilled if one of the software guys could come up with a windows program (or browser plug-in?) like Ripster proposed.

There are a lot of interesting/semi-useful things that could be done with the leds, just to brainstorm: volume display, a programmable tea timer, custom alerts (email, messaging, etc), Ripster's rad WPM idea, a blink for each key pressed (two-three for combos), BPM display in audio players, 3-2-1 countdowns for things like power/sleep on/off, etc.

I'm a space-saver user and can imagine the usefulness of this, I'm sure the normal-sized M users could come up with wilder ideas. I won't pretend to know how any of the programming works though :)
Title: Switching LEDs In A Filco
Post by: nanu on Mon, 15 March 2010, 16:05:35
The more relevant thread is maybe http://geekhack.org/showwiki.php?title=Island:7031
Title: Switching LEDs In A Filco
Post by: TheSoulhunter on Sun, 02 May 2010, 20:00:56
I can confirm 3.2V LEDs seem to work (http://geekhack.org/showwiki.php?title=Island:9765) on blue Mx Filco boards, no side-effects so far...
 
Whats the worst that can happen?
From my understanding it's just that the LEDs won't get enough voltage so they run dimmed, or simply not at all, no?
Title: Switching LEDs In A Filco
Post by: TheSoulhunter on Sun, 02 May 2010, 20:55:55
USB specs: 5V, 0.5A -> 5V * 0,5A = 2,5W
Hard to believe 2,5W is enough to start a fire! :P
Title: Switching LEDs In A Filco
Post by: TheSoulhunter on Mon, 03 May 2010, 08:31:43
My bet: A defective USB port running way over specs, that, or a cigarette...
Title: Switching LEDs In A Filco
Post by: kishy on Mon, 03 May 2010, 10:11:09
Quote from: TheSoulhunter;178420
My bet: A defective USB port running way over specs

Which reminds me, I have a USB keyboard that clearly states a max rating of 5V 1.07A on the label. WTF is that?

(http://geekhack.org/picture.php?albumid=33&pictureid=252)
Title: Switching LEDs In A Filco
Post by: TheSoulhunter on Mon, 03 May 2010, 10:36:41
Just noticed some extensions of the USB specification (USB On-The-Go) allow up to 1.5A for USB1 and up to 1.8A for USB2,
which was introduced for faster charging of mobile devices such as cellphones and MP3-players... >.>
Title: Switching LEDs In A Filco
Post by: kishy on Mon, 03 May 2010, 10:44:42
That keyboard is from 98/99ish. I don't think that was even "USB1" material yet; wasn't there a pre-USB1 implementation that really REALLY sucked?

(I mean the sort of thing you find on Socket 7 mobos from 1996, 1997)
Title: Switching LEDs In A Filco
Post by: JBert on Mon, 03 May 2010, 14:47:24
Quote from: TheSoulhunter;178319
I can confirm 3.2V LEDs seem to work (http://geekhack.org/showwiki.php?title=Island:9765) on blue Mx Filco boards, no side-effects so far...
 
Whats the worst that can happen?
From my understanding it's just that the LEDs won't get enough voltage so they run dimmed, or simply not at all, no?
Just make sure you add a resistor in there (http://led.linear1.org/why-do-i-need-a-resistor-with-an-led/). Just chaining them could cause a blow-out of the entire chain should one LED be overloaded and drop in resistance.

They also have a LED calculator (http://led.linear1.org/1led.wiz).
Title: Switching LEDs In A Filco
Post by: TheSoulhunter on Mon, 03 May 2010, 17:43:30
Still don't understand...
It seems logical that you need to add resistors when operating 2.2V (ie. red) LEDs on sockets for 3.2V (ie. green/blue/white/uv).
But when operating 3.2V LEDs on a 3.2V or 2.2V socket, you shouldn't need a resistor, and as I didn't change the circuit, the chance for a "blow-out" should be the same, no?
Title: Switching LEDs In A Filco
Post by: JBert on Tue, 04 May 2010, 13:20:16
My bad, you wanted to replace existing LEDs. I was mistaken because I've seen you talking about USB's 5V supply...

In that case you're right: the resistors already on the keyboard should be sufficient. You may still risk to draw too much current through some switching transistor, although those should be up to the load if the keyboard was designed well. Just don't add LEDs where there were none before.
Title: Switching LEDs In A Filco
Post by: vhaarr on Thu, 03 June 2010, 09:59:46
Actually a blinking LED might be a nice addition for the Caps Lock.
If any of you play any online games, you'll notice a lot of the kids TYPE IN CAPS OFTEN. AND I, FOR ONE, FIND IT VERY ANNOYING. :P

Perhaps a blinking LED would set them straight? I'll have to suggest that mod to my youngest brother, who is an avid gamer!
Better yet, I recently bought one of these (http://gizmodo.com/255567/bull****-button) "Bull****" buttons. Perhaps the circuitry and speakers could be ripped out and placed inside the keyboard to repeat indefinetely while the Shift or Caps Lock keys were active.

That would be rockin'!
Title: Switching LEDs In A Filco
Post by: washuai on Thu, 03 June 2010, 11:21:44
Yea, ice is better to cool down with in the summer.  I'm gonna accrue some debt, when those get done.  Although, aside from occasional hail that maybe bounces once before melting, it is not like I see much in the way of ice, near the seashore.

I prefer mellow LEDs, though.  Green is easier on the eyes, than red, unless you are color blind?