461Views16Replies

Author Options:

How to make a 'keyboard' Answered

Ok... I want to make a little keyboardish thing with 4 buttons and it would connect via USB and one button would send the MEDIA_PLAYPAUSE key, another would send the MEDIA_NEXT, MEDIA_PREVIOUS, and MEDIA_STOP keys... I have no clue how to do this though... Any ideas?

16 Replies

user
perkinsb1024 (author)2007-05-22

Thanks for all the feedback, but let's say I wanted to do it from scratch, coding the microcontroller using the method in explained in that "ghetto programming" instructable... does anyone have any advice on that?

Select as Best AnswerUndo Best Answer

user
VIRON (author)perkinsb10242007-05-22

It's EASY.
http://youtube.com/watch?v=BsqsR0Eom_0
EXCEPT for all the ridiculous PC compatibility overhead.

Select as Best AnswerUndo Best Answer

user
perkinsb1024 (author)VIRON2007-05-23

Wow! Great link. To bad it doesn't show you how to make them. Anyway, I got a book on this, so hopefully, I'll be able to slap something out. Thanks.

Select as Best AnswerUndo Best Answer

user
VIRON (author)perkinsb10242007-05-23

Once you have buttons, you connect them in rows and columns, and connect them to pins on the microcontroller. The chat device MC did not have enough pins so I used a CD4017B chip (50 cents probably) to add more for checking all the rows. And diodes on the columns to convert to binary and save more pins. The chip in your PC keyboard is a microcontroller and it just checks all the buttons and tells the PC which one was pushed or unpushed... and it uses a crappy code, which in the old days would have been ASCII and would have made sense, but no, everything about PC's takes a really long time to do from scratch even if it's simple. If you have a lot of diodes you can make a keyboard that reads itself, except for shift buttons need to read separately. The talking keyboard used only diodes for reading itself. As simple as it gets is hook up the buttons to the pins.

Select as Best AnswerUndo Best Answer

user
trialex (author)perkinsb10242007-05-22

Try searcing around for a HID routine for your microcontroller, for example "AVR USB HID" gave some pretty good examples for an atmel microcontroller... in fact this looks like what you are trying to do... http://www.obdev.at/products/avrusb/hidkeys.html

Select as Best AnswerUndo Best Answer

user
perkinsb1024 (author)trialex2007-05-22

YUCK! This stuff is all nasty, but I guess I'll get to work. Thanks for the help everyone, I'll post a finished instructable when (most likely if) I finish...

Select as Best AnswerUndo Best Answer

user
trialex (author)perkinsb10242007-05-22

Yep. That's why hacking an existing USB keyboard would be the way to go. Good luck though if you give it a go from scratch - I'd certainly be interested in it!

Select as Best AnswerUndo Best Answer

user
hack124x768 (author)2007-05-21

Easiest thing to use is a USB game controller, a USB numeric keypad works too. Just put in in a custom housing and solder your buttons to the appropriate contacts. If it is a keypad, the OS should recognize it right away, if it is a gamepad, you may need a driver.

Select as Best AnswerUndo Best Answer

user
Punkguyta (author)hack124x7682007-05-21

xbox controller for example, I have a program/drivers for mine so I can assign buttons to any keyboard key or media buttons and also use it as a mouse.

Select as Best AnswerUndo Best Answer

user
westfw (author)2007-05-21

If you have (or can find) a cheap keyboard that has the keys you want, it is probably a relatively simple manner to extract just the controller and connect it to new buttons for the functions you want. This is explained somewhat in The Arduino Booklet

Select as Best AnswerUndo Best Answer

user
westfw (author)westfw2007-05-21

Ah. There's an instructable. Finding old instructables is getting to be a pain.
Hacking a Keyboard

Select as Best AnswerUndo Best Answer

user
trialex (author)2007-05-21

If you are willing to use winamp as your media player, there is an instructable External Winamp Control which you could use.

Otherwise USB is not an easy thing to interface with. The easiest way to do it would be to re-use the circuit board that is inside an existing USB keyboard, and only hook up four keys.

Select as Best AnswerUndo Best Answer

user
lemonie (author)2007-05-21

I'll assume that like myself you have a USB keyboard. My machine will operate quite happily with the USB and a PS2 keyboard. You could hack a PS2 down to the buttons you need?

L

Select as Best AnswerUndo Best Answer

user
VIRON (author)2007-05-21

It's really easy or really hard.
The easy way is to get rid of the USB computer and run a
phone wire from a VCR to a box with buttons on it.
The hard way was figured out in this project:
https://www.instructables.com/id/E472H22CXTEXCFCWRD/

Select as Best AnswerUndo Best Answer

user
VIRON (author)VIRON2007-05-21

oops I forgot. You can also modify the remote control of a DVD player. It has way too many buttons anyway for something that just plays.

Select as Best AnswerUndo Best Answer

user
VIRON (author)VIRON2007-05-21

Or use a game controller. Some programming required.

Select as Best AnswerUndo Best Answer