Tiny Keyboard on the cheap for the prop
Since I've seen so much talk about small keyboards around here, I decided I'll share an idea I had YEARS ago when playing with the basic stamp... It used RCTime.
It's fairly simple but works perfectly.· 40 keys, and you can assign them for whatever functions you want
· You can get all the parts from mouser, etc...
The keyboard needs only to measure a little over two inches tall and 3 inches wide...or so..
If anyone is interested I can post a schematic and some part numbers...
It's fairly simple but works perfectly.· 40 keys, and you can assign them for whatever functions you want
![=) =)](https://forums.parallax.com/resources/emoji/smiley.png)
The keyboard needs only to measure a little over two inches tall and 3 inches wide...or so..
If anyone is interested I can post a schematic and some part numbers...
Comments
Graham
Looks nice.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
There are 5 rows of eight, each row has eight resistors, you use RCtime to measure the resistance and work out the buttons pressed.
But does it allow you multiple buttons on the same line? If it was like an R2R ladder it could I guess.
Graham
Graham
Sharpie... I think I've made it clear that I'm not an engineer, but to my eyes... your keyboard is a work of art.
Paul: I agree with Graham. I think mini-micro-nano-keyboards are appropriate for this forum, because one of the stated goals is for an Altoids compliant Prop design... and that requires an Altoids compliant keyboard... but it is too bad that the same posts can't show up in both the sandbox and in the Prop forum. Something else for Parallax to consider after the next round of hardware.
Sharpie:
I did some rough photogrammetry on your Keyboard and it is roughly Altoids compliant... a little shaving here and a little scrunching there and presto, you have the first Altoids compliant Propeller keyboard!!!
But will it float?
I was wondering whether your board couldn't be modified slightly to become a keyboard controller...
so that an inflatable keyboard could "talk" to the keys on your board?
Chip mentioned that he wanted the engineers to be thinking of the Prop while they are in the restroom...
I would you like the engineers to be playing with the Prop in the tub!!!
If we are going to have an Altoids compliant Prop... we should be able to take it to the beach[noparse]:)[/noparse]
Rich
So if fast enough, it can read 5 keys pushed at a time...
NICE!!
Bob
Post Edited (Robert Kubichek) : 5/20/2007 9:21:33 PM GMT
I interweaved 12 common value resistors thru the I/O holes to form a voltage divider circuit that can be read with a A/D circuit. Nothing fancy but it works.
Pete
If the 8 keys in each row were binary coded you could read 40 key pushes at once [noparse]:)[/noparse]
Graham
I also have included a shot of the back of the board..· Should provide some more insight...· Hope you like.
I'm still working on drawing up the schematic, but I think that most of you can probably figure it out from the pictures....
Anyway, might have some use for someone... (The back is a battery cover from an old motorola 710·cellphone...fit the board nicely..)
Post Edited (sharpie) : 5/20/2007 11:43:42 PM GMT
The switches are part number 101-0261-EV from mouser.com....· 22 cents a peice.
The code is pretty straight forward... It takes some messing around to find the right value range for each key.. I usually made it so if it was higher than this value but lower than that then it's this key, and so on..·
Have fun, hope someone benefits from it.
Shouldn't take more than 20minutes or so to build.. You can make it as many buttons as you want within reason...· The less the better, but 40 works great.
How much time does it take to read a key/keychange???
Wouldn't it be better to have more lines of less keys if only one key per pin is detected?
Bob
For button 1 pressing any other button would need 40 unique voltages.
For button 2 pressing any other button would need 40 unique voltages.
.
.
.
Just as a·rough estimate it would require 1600 seperate tests for a 40 button keypad to read two buttons at once.
You see how quickly this becomes a mess and that is not to say there might be·some combonations that are quite close to one another ( with just my 12 keys there are some real close to one another when pressing two at a time.)
I may be off here but having played with these there could also be a temperature issue involved too.
Just my 2 cents
Pete
Edit: posted before checking for another post to this
Post Edited (Propability) : 5/21/2007 1:47:57 AM GMT
It would make sense to have less keys on more pins for the prop... this board was designed for the basic stamp a long time ago. I'm sure if I or someone else spent a couple hours thinking about it, a much better system could be worked out as to how to read the buttons, my main objective was not on how it's wired but the size of the keyboard and the buttons used... It's a realatively small setup and I thought I'd share it for the people who wanted a small input device.
Maybe I'll address this soon and see if I can come up with a nifty and more clever way to reliably read the keyboard and be able to have multiple buttons pushed simultaniously.. without taking too many pins, while keeping it super cheap.. I still have a couple uses for something like this too, so it'll be worth it..
Maybe I could work out a deal with the folks at Parallax to produce such a keyboard for the prop...
OOPS, better go back to school parrallel resistance biit me .
( ie the button pressed furthest to the left, or closest to the pin of the prop)..
So, only one key is valid at a time..
Bob
Post Edited (Robert Kubichek) : 5/21/2007 2:07:26 AM GMT
I think that using a binary progression of resistors with each key in parallel (NO)
with each binary resistance step, that when the key is pressed, that resistance is removed from the total..
It would be the same, but would read less resistance depending on amount of keys pressed..
It should be doable..
Bob
Pete
But with a twist, any amount of concurent keypresses will give a unigue resistance, that's why I said binary steps..
Bob
Post Edited (Robert Kubichek) : 5/21/2007 2:13:18 AM GMT
Pete
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://forums.parallax.com/showthread.php?p=650217
meow, i have my own topic now? (sorta)
You could probably even double up your buttons by using diodes. Basically the way that works is that where you originally had one switch, you would instead place two in parallel, but each switch is guarded by a diode. The diodes face opposite directions from each other in each pair of switches. So depending on whether you move current forward or backward will change which switch gets read. You could accomplish the reversal of polarity by connecting the other leg of your timing capacitor to another propeller pin instead of to ground, and changing the pin from low to high to reverse current flow. You'd need to rely on a bleeder resistor to get the charge off the capacitor between reads, though.
As for determining the unique keypress, the computational cost doesn't seem to me to be as bad as people are making it out to be. It's analogous to answering the question, "I have 36 cents in my pocket, what coins do I have?" Yes there's more than one right answer (I might have seven nickels) but going for every possible solution would be overengineering. We only want the simplest solution. That's the one with the fewest number of coins (or buttons). In that case, it becomes a simple matter of subtraction. A quarter is 25 cents. That fits, leaves 11. What's left? A dime, 11 minus 10 leaves 1. So I have a quarter, a dime, and a penny. Common sense answer. I don't consider other possibilities because the first one that fits is Good Enough. Just don't press more than three keys a time, darn it!
Also, I think it is important to note that the time consuming part of this operation is reading the RC time constant. Once you've read it, you don't have to read it again every time you need the value in your calculation of what the value means. So even if you did have to do 1200 operations, that's not 1200 RC time reads, just 1200 math operations, which are cheap on the Propeller.
The nice thing about this method rather than normal row-column types is the low io count, its sweet and the propeller is ideal because one cog can do all the checking giving a fast response.
Graham
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://forums.parallax.com/showthread.php?p=650217
meow, i have my own topic now? (sorta)