3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.


Extra inputs for Arduino with a keyboard

Extra inputs for Arduino with a keyboard

The Arduino is perhaps the coolest thing on earth. There are many types, the Uno, the Mega, the Pro, the Pro Mini, etc. etc.

But one thing that often can be a problem is that you only have a limited number of inputs and outputs. There are many solutions for that, ranging from multiplexers to port expanders. But one thing that gives you up to 171 extra inputs is to use an old keyboard. And that is that this instructable is going to be about.


(The image it an example of things that can be used with this. As you can see, I only put up switches and relays. What's because the keyboard controller only can handle non-time sensitive digital inputs.)
 
Remove these adsRemove these ads by Signing Up
 

Step 1What you need

What you need
«
  • IMG_2994.JPG
  • IMG_3000.JPG

What do you need? First, an Arduino. Second, an old Keyboard what still works. And that's pretty much all.

1. An Arduino.
2. An old  PS2 keyboard. It will work with a USB keyboard, but will be extra work and will not be covered here. (You only need the controller PCB)
3. A PS2 jack. Optional, you can also cut the cable.
4. Some buttons or relays and some wires to connect the buttons to the controller PCB with.
5. The Arduino IDE . There are enough tutorials on how to install it spread around the WWW.
6. The PS2Keyboard library. See further down on how to install it.
7. A good idea to use this with.

Please note what the keyboard in the image is not the one I used. I have already demounted my keyboard long ago.


Installing the library:
1. Go to this page and click on PS2Keyboard.zip. A window will now come up asking what you what you want to do with the file. Click on open.
2. You will now have an explorer window (on windows. I can't help you with other operating systems). Click on Extract all Files up to the left. Enter arduinoInstallPath /libraries (arduinoInstallPath is the place there you installed the Arduino IDE) and then click on Extract.
3. Go to arduinoInstallPath/ libraries/PS2Keyboard and delete the file "PS2Keyboard.cpp.o".
4. Done.

« Previous StepDownload PDFView All StepsNext Step »
12 comments
Mar 5, 2012. 3:03 AModalcet says:
a comment on step 2 (Wndows file downloading)

On Linux (Ubuntu 8.04 - hardy, Firefox 10.0.2)

When I left-click on download link link, a windows opens with 4 options (depending on your add-ons):

1 - Open with Archive Manager (default)
2 - DownThemAll
3 - Save file
4 - dTa OneClick

There's also a check box:: "Do this automatically for files like this from now on"

My first option is DownThemAll. It's a great Firefox add-on.

Select it and the "Add downloads" windows opens

Check your destination folder and press the "Start" button The DownThemAll main window opens with your file for downloading. When finished, the progress bar will show 100%.

If you hover with your mouse on the download name, you will see some info about your file, the most important: destination path in case you forgot where that was.

Now you can (1) go to than folder or (2) right-click on name and select an option or (3) double-click to open your downloaded file.
May 27, 2011. 1:49 PMTheHawkeye says:
I guess another question is how can you figure out which key scan be used at the same time. It seems more keys in certain areas work together than keys from other areas on a standard keyboard.
Jun 8, 2011. 6:50 AMspasysheep says:
Depends on how fancy a keyboard you use

http://en.wikipedia.org/wiki/Rollover_%28key%29
May 27, 2011. 1:47 PMTheHawkeye says:
This is agreat idea, but I have a question. It's obvious you can get inputs from the keyboard, but can you output to the board? I guess the question is really if this is one-way. It could vary I guess if there are diodes.
May 28, 2011. 10:21 AMTheHawkeye says:
The only reason I'm suspicious about outputting to the keyboard is because if you enable the on-screen keyboard you can toggle the lights and function of the physical keyboard's Num Lock, Caps Lock, and Scroll Lock.
Mar 12, 2011. 8:42 AMpatovala says:
some schematic of how to connect the switches, and what mean each cable color from the ps2 output.
May 27, 2011. 12:57 PMfortueni says:
quite*

wha'ts with the (.temp);
i like your instructable, but I think it needs more information about those relays and schematics.

Mar 1, 2011. 10:20 PMzazenergy says:
This is a pretty cool idea! Thanks for sharing. I think it would really help to give some more information on how it was made and maybe break out the steps a bit more. Good job!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
9
Followers
2
Author:02JanDal
I'm only 14 years old, so don't expect my instructables to be as good as if a 30 year old engineer had done them. I like to do things my self and see what's inside things. I really like Arduino and AV...
more »