Pages: [1]   Go Down
Author Topic: Making a custom keyboard with arduino?  (Read 2265 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, this is my first post, and I've used the search to look for an answer, but I didn't see any similar questions, so forgive me if this has already been answered.

I am looking to build a custom keyboard, for personal use, and my first thought was to use arduino to manage it. I've got the materials problem solved, but I didn't know if Arduino was capable of  managing a <70 key keyboard, and if so, could I have a fn key that changed the use of certain keys? (i.e. fn+1=f1) Also what would muti-press limitations be?

thanks in advance!
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27361
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Using 17 pins, you can use keypad.h library to read a 72 key keypad.
Electrically arranged as 8x9, physically any way you want.
Probably easier to manage fn as seperate key not part of the keypad.
Multi-press, that would be managed in your sketch.
So 17 for matrix, fn key, and 2 pins for serial interface.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Phillipsburg, NJ
Offline Offline
Full Member
***
Karma: 6
Posts: 184
Author: Matrix Keypad Library
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

but I didn't know if Arduino was capable of  managing a <70 key keyboard, and if so, could I have a fn key that changed the use of certain keys? (i.e. fn+1=f1) Also what would muti-press limitations be?
Yes, you can use Arduino to make a full sized keyboard.  I've helped a couple of people accomplish just that.  The keypad library http://playground.arduino.cc/Code/Keypad has default support for a 10x16 (160 key) keyboard.

Multi-press will have a problem called ghosting.  That means if you press 3 keys in a triangle then a fourth key will also appear to be pressed.  Release any one of the 3 keys and the ghost will go away too.  Ghosting is normally solved by using individual series diodes with each key.
Logged

Phillipsburg, NJ
Offline Offline
Full Member
***
Karma: 6
Posts: 184
Author: Matrix Keypad Library
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you can use keypad.h library to read a 72 key keypad.
[Snip]
Multi-press, that would be managed in your sketch.
Actually, the keypad library has been multi-press capable since July of last year.  I didn't make an announcement yet because I was hoping for a relatively slow testing period.  But it's posted and I'm working with someone right now who is implementing a full multi-press (a.k.a. n-key-roll-over, nkro) keyboard.  As soon as I get a report from him I will upload the latest fixes (the last key wouldn't report that it was released).  Shouldn't be more than a day or so.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27361
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks,

I know that 6 of the inputs are analog, should I use those for the keypad only, or can I use them for the fn key or serial interface? I intend to use cherry MX switches for my keys, according to the specs on the website, there are some with diodes and some without, should I get the ones with diodes, or should I get my own diodes?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34554
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The analogue input pins can also be used like regular digital input / outputs as well.
On a UNO they are pins 14 to 19.
Logged

Phillipsburg, NJ
Offline Offline
Full Member
***
Karma: 6
Posts: 184
Author: Matrix Keypad Library
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I intend to use cherry MX switches for my keys,
Wow, these things seem to be getting popular.  Both you and the other person I'm working with are using those keys.

Quote
according to the specs on the website, there are some with diodes and some without, should I get the ones with diodes, or should I get my own diodes?
Time to learn a technique in engineering called tradeoffs. smiley-wink  If the cost of the keys with diodes is higher than buying separate diodes then it may be worth your time to do it yourself.  External diodes also mean your build won't be as neat and clean so that's another consideration.

But from a purely technichal point-of-view it would be better to get the ones with diodes.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, these things seem to be getting popular.  Both you and the other person I'm working with are using those keys.
yea, they're the best quality/cost switches I've found so far

one last question before I begin learning to build PCB's, How do I implement (physically) a mini-usb port so my keyboard can be plugged in and used (recive power and send keyboard signals)? I know that the Leonardo has a mini-usb already attached, can I just use that? if not, do I need to reroute power from the usb port to the power port on the uno?
Logged

Phillipsburg, NJ
Offline Offline
Full Member
***
Karma: 6
Posts: 184
Author: Matrix Keypad Library
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do I implement (physically) a mini-usb port so my keyboard can be plugged in and used (recive power and send keyboard signals)? I know that the Leonardo has a mini-usb already attached, can I just use that? if not, do I need to reroute power from the usb port to the power port on the uno?
If you go to the main reference page on the Arduino site there is a link to Keyboard and Mouse for the Leonardo. 
http://arduino.cc/en/Reference/MouseKeyboard

This tells you a bit about using your Leonardo as a USB keyboard.  I haven't read any of it but it may give you enough information on using the Keyboard library.
Logged

Pages: [1]   Go Up
Jump to: