tommedema
Posts: 10
Joined: Fri Jan 13, 2012 4:15 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 4:50 pm

If I want to create a simple device with only 4 controls, I'd need 4 buttons.

Should these buttons interface with the RPi using USB? If so, are there even programmable and inexpensive keyboards with only 4 buttons?

If not, would it be possible to use the navigation pads of phones? For example http://www.dealextreme.com/p/g.....9800-81000

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 5:43 pm

A keyboard compatible USB keypads with a few keys would be the easiest as it interfaces direct with the Linux I/O drivers.  You probably have to learn about TTY settings for direct keys access (cbreak if I recall) but the you can use getchar(). But it might be the expensive way.

Alternative you have to connect the keys to the GPIO pins. Then you can use the 'Dom file I/O' method to read them or use the more complex C-code access to read them. That can be done very, very cheap. All you need is 4 push buttons or a 4-key matrix keyboard.

(I hope to give more details about both ways of accessing the GPIO over the weekend.)

tommedema
Posts: 10
Joined: Fri Jan 13, 2012 4:15 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 5:45 pm

Thanks for your answer Gert.

If you could expand on accessing the GPIO in the future that would be excellent.

Looking forward to it!

Could you give me an example of those push buttons, or 4-key matrix keyboards? And where can those be bought?

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 5:54 pm

For new: At your local electronics shop like Maplins or something alike. Online electronics are (Alphabetically): Digikey, Farnell, Maplin, RS. In fact you just need two pieces of metal making contact.(I started with a battery + lamp + paperclip + copper tack + wooden block + 3 wires)

Used: take apart any old thing with button. (As beginner I would not try remote controls as they are probably too complex.) You could try to pester your local radio/TV shop for old hardware.

Prometheus
Posts: 308
Joined: Tue Dec 13, 2011 11:09 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 5:56 pm

How about hacking up a cheap USB gamepad or joystick of some sort? Almost all (if not absolutely all, by this time) of those are plain Human Interface Devices, so should work with no problems whatsoever.

tommedema
Posts: 10
Joined: Fri Jan 13, 2012 4:15 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 5:56 pm

Prometheus said:


How about hacking up a cheap USB gamepad or joystick of some sort? Almost all (if not absolutely all, by this time) of those are plain Human Interface Devices, so should work with no problems whatsoever.


Could you give an example? Notice it needs to be integrated behind some kind of case.

Prometheus
Posts: 308
Joined: Tue Dec 13, 2011 11:09 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 6:23 pm

tommedema said:


Prometheus said:


How about hacking up a cheap USB gamepad or joystick of some sort? Almost all (if not absolutely all, by this time) of those are plain Human Interface Devices, so should work with no problems whatsoever.


Could you give an example? Notice it needs to be integrated behind some kind of case.


Certainly!

This stick from Legacy Engineering springs readily to mind, as it has a board that"s been specifically designed to be easily modified (and, as you can see from the picture there, is easily removable and not very large). By default four directions and one button are good to go, but the board can support more buttons (up to eight, apparently) if you have the ability to add them.

Granted, it doesn"t take care of the physical buttons themselves, but it interfaces via USB and presents itself as an HID, so it will "just work", as they say. (It will appear to Linux as a joystick, most likely as "js0".)

tommedema
Posts: 10
Joined: Fri Jan 13, 2012 4:15 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 6:26 pm

Thanks, but that's quite an expensive one. 19 dollars isn't far from the actual Raspberry Pi.

I'm looking for an inexpensive solution, so I may have to wait for Gert's GPIO "guide".

Prometheus
Posts: 308
Joined: Tue Dec 13, 2011 11:09 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 6:29 pm

tommedema said:


Thanks, but that"s quite an expensive one. 19 dollars isn"t far from the actual Raspberry Pi.


No problem, though it was just an example because of the small board in the stick.

I wouldn't imagine that de-casing one of these ~$6 pads from DealExtreme and using better/more suitable buttons would be any more difficult, though the board would be larger. Again, it'd just be a standard Human Interface Device.

I don't know if that's any better, but either way, I wish you luck.

Caliber Mengsk
Posts: 16
Joined: Fri Jan 13, 2012 6:08 pm
Contact: Website

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 6:40 pm

You may want to just look around for button pads like this:

http://www.sparkfun.com/products/8653

or you could also probably get away with just using tactile buttons with the GPIO pins. They are fairly cheap too:

http://www.sparkfun.com/products/10302

Sparkfun is a great site for small components, but they can be a bit pricey on some things.

If you want the super cheapest place, look at mouser.com. They have the cheapest prices and largest catalog out of anyone I've seen for component level products. A lot of their stuff will even beat out buying from china directly.

O-o I say all of this living in the US though, where these places don't cost much to ship for me, since their distribution centers are in the US also.

abqlewis
Posts: 18
Joined: Tue Sep 13, 2011 3:45 pm

Re: Where to get small keypads (functional buttons) for simple devices?

Fri Jan 13, 2012 7:05 pm

Cheap DIY 4-Key Keyboard. It's almost like he had you in mind -> http://blog.flipwork.nl/?x=ent.....224-003937

Return to “Other projects”