PDA

View Full Version : A new hardware mod I want to make, but have no clue how to do it



[mAd]Dr.Death
08-19-2006, 11:04 PM
Well, basically I want to make some kind of panel that has LED's on it for every key of the keybaord, and I want to attach or display this panel somewhere nearby the computer. Everytime a key is pressed on the keyboard, I want the corresponding light to light up on the LED light board.

Now, I'm not too sure how one would go about making something like this, but I think it would be a neat thing to do.

I guess that the LED board would have to hookup to the PC through USB. But then there would have to be some kind of program running in the background that says "The A key has been pressed, light up the corresponding A location LED" to the LED board.

Unfortunately for me, I've never taken any programming or electronics classes, but I know that something like this could be done. Though I don't know where to get started on this project.

I think it would make a pretty cool casemod to have this LED Light panel hanging on the side of your case. The lights would be flashing, but it would correspond to what keys you're pressing on the keyboard. It would also be pretty nead to have this panel hanging near the area where I have all my routers and switches setup too, or even to make some gigantic board and set it up in the frontyard for christmas lights.

Alternatively, instead of having the corresponding LED light light up, you could also make a LED Board that spells out each key as the key is pressed, though that's not what I'm going for, it would still be a neat effect. So as you type, each letter is spelled out on the board as it is pressed.

So uh, if anyone can point me into the right direction, or help me out or something, I'd appreciate it.

antigen
08-20-2006, 01:06 AM
I have a feeling your W,A,S,and D led's are going to get a workout... I'd make them easy to replace :)

[mAd]Dr.Death
08-20-2006, 03:14 AM
I have a feeling your W,A,S,and D led's are going to get a workout... I'd make them easy to replace :)

Good idea, but don't led's pretty much last forever? Well, around 10 years according to wikipedia.

Blis
08-20-2006, 06:03 AM
I dont really know much about programing or electronics but it doesnt sound like it would be too hard if you do a bit of reading.

I'd start by learning bout led's and the required circuitry then look for some open source keyloggers and see what you can steal from those.

Multiplex
08-20-2006, 06:18 AM
I'll get you some of the basic relevent info you need and you can figure it out from there. This probably isn't an easy newbie mod to make as you will need some electronics background to capture and interpretethe key stroke codes. First though I would:

*Assemble the LED board
*Buy an electronic bread board so you can assemble a device to capture signals (use a hardware keylogger as a basis for your design)
*Splice out a USB cable and run it into the bread board so your device can get the signal and then pass it back into the USB.
*Get a list of USB keyboard signal codes and get your device to interpret them.

Here's your information index:
A USB pin out guide (http://www.interfacebus.com/Design_Connector_USB.html)
PS2 pin out (half-way down page) (http://stason.org/TULARC/pc/pc_pinout.html)
Keyboard theory w/ diagrams, two way serial signal description, and the (all important) list of hex commands for each key press. (http://www.beyondlogic.org/keyboard/keybrd.htm)
USB/PS2 do it yourself keyloggers. Mod these to capture keystrokes. (http://www.keelog.com/diy.html)
Basic through advanced LED theory and usage. (http://www.gizmology.net/LEDs.htm)

This took me about 5 minutes of digging (although I have electronics background) but I hope this helps.

Gruthar
08-20-2006, 06:29 AM
Here's what I would do given your outline. There probably is a better way and I'm no electrical engineer, but meh...

Basically, your LED panel could be controlled by a series of microcontrollers. You have your main microcontroller, which will be responsible for communicating with your computer and the sub-microcontrollers, which in turn would be wired up to clusters of LEDs (one LED per MCU pin). Your driver would have to run in the background and send key strokes to your LED panel's primary MCU. Crappy MS Paint Illustration:

http://gruthar.antiliger.com/kbledpnl.jpg

A few points to consider:

You should figure out how many LEDs you want to use. If you want one for every single key, you probably won't be able to run your LED panel without an external power supply, plus you'll need enough secondary microcontrollers for all the LEDs.

You'll probably have to program the microcontrollers yourself, and will have to learn a programming language for your driver. I've done a little of screwing around with embedded systems - I would suggest Java or C# for your driver, as I had a hell of time trying to find the right classes for C/C++ and the former two are easier for beginners to work with. As for the microcontrollers, you can program some of them in C - otherwise you'd have to use their assembly language, which can be a PITA and is probably not necessary for something this simple.

You should also figure out if you want to be able to change your LED system or not, as this might affect what type of microcontroller you get. You could use one-time-flash MCUs for your secondary MCUs (since they'll basically be fancy switches), but might want to use a reprogrammable MCU for the main one, in case you later decide you want to use your LED panel for something else or want to have it display things differently.

HTH, and forgive me if I'm getting ahead of myself or missing stuff - it's 4 AM.

Multiplex
08-20-2006, 06:32 AM
Yeah, Gruthar has some good ideas. If you are talking about using microcontrollers you're (probably) going to need an IC flashing tool though unless it has a built in serial interface. I don't really have a lot of experience with that type though. If you don't want to buy one (they are mid-priced) then you can stop by your local university electronics engineering program to ask if you can use theirs (they usually will).

I wouldn't worry about external power, you could just splice it out of the USB which is higher powered bus (as far as peripherals go).

Gruthar
08-20-2006, 06:44 AM
I dunno how much LEDs consume, but I think it's around 10-12 mA...? I know USB is supposed to supply up to 500 mA, and can go beyond that, but beyond 500 mA it's no longer 'USB compliant.' I don't know if that means nasty things'll happen or not, hence mentioning the external power supply. :dunno:

Multiplex
08-20-2006, 06:54 AM
Each standard (low illum) LED consumes between 20 and 35 mA (and between 2 and 4 volts). I guess it depends on how many keypresses you want to support at once. :)

antigen
08-20-2006, 02:28 PM
I'm not the best in the world with circuits and stuff... but isn't there a way to build a mod like that and not have to write code for it?

Seems to me like there could just be a connector in between the keyboard and the computer that intercepts the signals before they reach the computer. You know, keyboard plugs into box (IN), box gets plugged into computer (OUT1) and LED circuit board (OUT2).

That's my idea. But I have no idea how to build it :)

Multiplex
08-20-2006, 02:44 PM
I'm not the best in the world with circuits and stuff... but isn't there a way to build a mod like that and not have to write code for it?

Seems to me like there could just be a connector in between the keyboard and the computer that intercepts the signals before they reach the computer. You know, keyboard plugs into box (IN), box gets plugged into computer (OUT1) and LED circuit board (OUT2).

That's my idea. But I have no idea how to build it :)

Read over the links I posted carefully. Pay close attention to the "Do it Yourself" hardware keylogger. That is what is going to capture the signals on their way to the computer. You are going to want to base your design off of those schematics.

I think you're a little confused and maybe I can help: Gruthar is talking about programming microcontrollers. You shouldn't need to write any drivers for your computers or any applications to support your device which runs in Windows XP. You should be able to accomplish this with just generic hardware purchases from Radio Shack.

In summary, you want to build a modified keylogger, which will splice into your USB cable between the computer and the keyboard. You're gonna make that keylogger interpret the hexidecimal signal codes for keypresses and make a corresponding LED light up on your light board (that's where the microcontrollers come into play).

Each of those links I posted has a ton of good and very relevant information in it. I suggest you read those over before trying to design anything.

Blis
08-20-2006, 05:08 PM
I've had an idea I think I could make work but its a bit ghetto.

I popped the keys off my keyboard and noticed theres some pretty big grooves between the holes they push into,about a centemete wide.The gap between the bottom of one of my keys when its depressed and the groove is about half a centemeter.

See where i'm going here? lol i told you it was ghetto

Drill holes in your keyboard so you can run two wires from each LED through the troughs to a key.Attatch 1 to the bottom of the trough and the other to the underside of the key and make a simple switch to complete the circuit when its pressed.You could use a piece of a small spring or something.

That would be a lot of wires but i'm assuming the wire needed to power an LED with would be pretty thin.If you ran them in from the top,down through the rows between the keys,I think there would be enough room.On my keyboard anyway.

All you'd have to learn is how to wire up an appropriate power supply.

Pretty ugly but its the only way simple enough i could do it.

EDIT: I just had another thought, when the keys arent being pressed,the wires underneath them could be lighting LED's underneath the keys themselves.

If you cut out a piece of semitransparent plastic film and placed it so that it sat between the keys and the LED's it might make a nice lighting effect.

I'm kinda high when i'm writing this.Its probably a crazy idea :)

sir_digalot
08-20-2006, 08:31 PM
the problem you are going to face as i think you have seen is the fact that the keyboard "converts" the signal into a serial stream for the PC to understand what it is doing, there is no real way of intercepting this stream without a controller to decode the signals,

blis idea is close too literally making a whole bunch on switches but it would only work on that one PC keyboard

the other way would be to "intercept" the connections Before they actually hit the controller o nthe keyboard but again what you will have is a unique keyboard i thikn you need somethign to plug in between any keyboard to act as an interface. but for that i am afraid you will need some programmming even a new driver interface...

i think the drill holes and pray method is best :D


edit:

i found this, maybe it helps?

http://www.instructables.com/id/ERQH5YWNUIEP2874LM/

go through all the screens it can help you alot

Multiplex
08-20-2006, 09:17 PM
the problem you are going to face as i think you have seen is the fact that the keyboard "converts" the signal into a serial stream for the PC to understand what it is doing, there is no real way of intercepting this stream without a controller to decode the signals,

Each unique key is assigned a hex code. It's that simple.


the other way would be to "intercept" the connections Before they actually hit the controller o nthe keyboard but again what you will have is a unique keyboard i thikn you need somethign to plug in between any keyboard to act as an interface. but for that i am afraid you will need some programmming even a new driver interface...

That's ghetto and probably won't work.

Gruthar
08-21-2006, 01:01 AM
Well, how I see it, you can stick the LED panel either in between the keyboard and the computer OR just give it its own serial or USB port and leave the keyboard alone. If you put the LED panel between the keyboard and PC, you will have to deal with the hex codes from the keyboard (but would not need a software driver). If you give the panel its own port (thus making it independent of your keyboard), you'll need a software driver to report the keystrokes to the panel. That I'm aware of, there's no easy way to do it purely through hardware short of installing switches underneath each key - you'll have to do a little programming at some point.