Keypad alternatives - any thoughts?

westaust55

Moderator
Hi all,

Recently started experimenting with PICAXE microcontrollers and have so far spent some nights working with comms to LCD displays (AXE033 = 2x16 LDC + DS1307 RTC and a 4x20 LCD).

But there is only so far one can go with having outputs alone so starting to look at setting up a keypad for some input.
Looking to do something in far less space that a standard PC keyboard for a compact experimenters set.

In searching around I have identified a couple of IC’s that will help and reduce the amount of code to get input into a PICAXE.
The first is the E-Labs ETE1144 encoder for a 4x4 16-key pad. These only require 2 inputs for “Data Valid” and “Serial Input”
The second that I have identified are the MM74C923N 20-key keypad encoder with output on 5 parallel lines (there is 74C922 for a 4x4 16-key pad as well using 4 parallel lines) plus needs a 5tgh input for the Data Available status signal/interrupt.

An archived posting (Archive 4) mentions using a 74C165 8-bit Shift register in conjunction with a 74C922 for a serial keypad configuration. Looking at this dual IC arrangement the required IO is 4 as 2 in 2 Out used for Serial Data, Data Avail, Shift/Load, Clock. Thinking that it just may be possible to invert the Data Avail signal with a transistor to directly load the shift register when a key is pressed to save one PICAXE Output so down to 3 I/O pins required. Still need to pass the Data Avail signal to the PICAXE so code knows when data is available.

The cost of the ETE1144 and the 74C922+74C165 combo is about the same.
Then, I could get a 74C923 instead of the 74C922 which will enable use of up to 20-keys (4 x 5 matrix) – that would allow me to have 5 extra keys for Special or extra values/commands. Maybe even add a few extra key type pushbuttons direct into the spare inputs of 8 bit shift register as “Shift”, “Ctrl” and “Alt” type modifier keys so each of the main keys can have multiple values. That could give 20 x 3 = 60 values.
Has anyone else gone down either of these paths and can offer comments on the pro’s and con’s.

I am leaning towards the 74C923+74C165 approach which while not as elegant does have the advantage of being able to hand 20 keys instead of the more usual 16 keys plus some “modifier” buttons.
Has anyone else gone down either of these paths?
Any comments, schematics, code examples, etc would be appreciated.

Regards
Westaust55
 

eclectic

Moderator
I'm only just conscious here, but, ..

One input / one TSOP38/ Infrain / one cheap IR remote control (fixed in position).
Cost ~ £2 - £3.

Programming = if infra = ... then.

e.
 

Tom2000

Senior Member
I recently helped a guy with a project. He needed to set a couple of time delays.

While we were noodling around over the user interface details, he came up with the brilliant idea of using BCD thumbwheel switches to both set his delays and act as a display. His idea simplified the project immensely, and made for very smooth operation of his unit.

I don't know if thumbwheels are an answer to your particular problem, but it's something for folks to keep in mind for other applications. I'll admit that I've never given them any thought, but they might have simplified a couple of past designs.

Thumbwheel switches are readily available, at good prices, in the surplus channels.

Good luck!

Tom
 

BeanieBots

Moderator
Have a look in the projects section. There is an analogue version.
My favourite method is to use just a few buttons with a menu system.
The "best" really depends on your application and what the 'user' needs to input.
 

Dippy

Moderator
Or you could use a second PICAXE and do your own strobe keypad reader and feed it serially to your main PICAXE.

Main advantage is that you can do your own code and make it how you want. You could have it so that:-
1. multiple keystrokes can be stored
2. a pin out so that main PICAXE knows that key data is waiting. Then on main PICAXE yo can interrupt and do a reliable Serin.
3. Autorepeat if ever needed.
4. Set your own debounce criteria.

I've only done this on a nude PIC (for keypad switches and rotary switches) but the coding is fairly easy.
 

BCJKiwi

Senior Member
I guess we need more info else it's just that - a guess.

Post 1 starts with a standard keyboard but less space,
then something simpler but with shift / ctrl / alt modifiers,
then gets down to 16 or 20 keys.

Can you advise what it is you reallly want to achieve?
 
Last edited:

westaust55

Moderator
Keypad alternatives

Quote: " Can you advise what it is you reallly want to achieve?"

I am looking to build up a compact keypad type input device for experimentation purposes. Not a specific project/application but an input device that I can use depending upon where my future experiments take me.


Thoughts on later mounting the PICAXE protoboard, LCD displays, keypad, Power Supply module and other bits into a compact box and bring out spare I/O for future use.

As I mention in post 1, I am not looking for a full keyboard - I know my 40X1 can handle a standard PC keyboard using 2 pins.


Some further searching around has not located any small economically priced (ie keypads available locally (ie in Australia) with more than 16 keys (these are about AUD$10).

I have today found that an E-lab EDE1188, at $AUD22 each, which can handle up to an 8x8 key matrix is available for just AUD$2 more than a EDE1144 (only a 4x4 key matrix).

In a first reading of the data for the E-lab chips is seems the Data Available signal is set and then serial data is immediately sent so the Data Avail signal needs to be used as an interrupt to avoid loss of keystrokes.

The more home brew 74C923+74C165 can be clocked by the PICAXE so no chance of last data unless do not get the data out of the 74C165 before next keypress.

The idea of using a PIAXE o8 as an intermediate controller which can also act as a buffer is starting to sound good.

Regards
Westaust55
 

BeanieBots

Moderator
Have a look around at other "economy" devices such as central heating controllers and/or digital watches for ideas. Often only two or three buttons.
Many LCD units (eg Scott Edwards) have a hexpad interface which is interrupt driven (no missed key strokes) and can be read with either serial or I2C.
 

hippy

Ex-Staff (retired)
Some plug-in keyboards for mobile phones and PDA give a serial output which can be used fairly easily with SERIN. Then there are those slightly larger fold-away keyboards for the same, and of course the rubber roll-up keyboards which can be used just like a normal PC keyboard.

Google ( or other search engine ) is the best place to find which phone / PDA keyboards are serial compatible.

Some PDA's can run Terminal Emulators and have a serial link so you get a really nice display and a stylus touch-sensitive virtual keyboard in a very samll package. Some Psions are particularly nice in that respect. You could remoev the keyboard from one of those if that's all you wanted.

http://en.wikipedia.org/wiki/Psion_Revo

My favourite ( because I've never paid more than £1/$2 for them ) "Portable LCD / Keyboard" is the Amstrad NC100 but at A4 is bigger than you're looking for.

http://www.geocities.com/homeofoscarvermeulen/zcn.html
 

papaof2

Senior Member
The Palm IIIxe is available on ebay for $15-$20US (sometimes less - ebay US has several groups of 5 for $50US today). It can do serial at speeds from 300 baud to 57600. Two AAA cells provide about 10 hours of continuous operation (rechargeables or a make-your-own AC adaptor are also feasible).

It has a dot-addressable 160x160 grayscale display (with optional backlighting).

I wrote an interface program for the Palm to send screen taps, keypresses, and characters to a PC (for a universal wired A/V controller that never made it to production). The program also accepts commands from a PC (or other serial master) to define the screen, in terms of lines, boxes, buttons, and text. Defined screens can be saved by name for instant recall. This might be a way to have a menued system controller that connects to an embedded PICAXE for configuration and display: i.e., a menu to set the parameters for an irrigation system, another menu for configuring a heating/cooling system, another menu for each system to display its status - limited only by screen size and your imagination ;-)

If you're using a chip with hserin, or using a separate chip to handle serial in, this might be an option.

If anyone is interested, let me know and I'll make the code and some sample screens available online.

John
 

Rickharris

Senior Member
you can make a simple membrane pad from aluminium foil and card.

Take a sheet of card - A5 and fold in half -

Make a further card that fits inside the folded card and cut holes where you want the keys.

At the position of each hole On the inner side of one side of the folded card glue a square of aluminium foil.

On the other side glues a large square of foil to cover the whole side - connect this to + volts.

When you press on the top surface you connect the foil patches to + volts making a switch. the individual patches can be connected to inputs to be read.

As an alternative you can set up a matrix as in the code lock PDf file.
 

westaust55

Moderator
Keypad alternatives

Hi all,

Thanks for the comments. Certainly provides food for thought and some novel approaches such as the home made keypads as suggested by RickHarris.

A check here on PDA and Mobile keypads found many are either expensive or have limited no of keys. Even found a PC type numeric keypad with about 12 extra keys for an inbuilt calculator function.

Looked at the PICAXE combination lock kit as mentioned by RickHarris which uses a PICAXE 18 chip. An 18X would give me 6 outputs for key matrix if using i2c comms plus 5 inputs so max of 30 keys possible (or up to 35 keys if I used serial comms).
I would also need to buy parts or pre-built board to program this IC but tentatively more flexible. All up about AUD$32+ freight for PICAXE18X and programmer/proto board.

The E-labs EDE1188 for ~AUD$16 can handle up to 8 x 8 keypad matrix but can obviously be used with fewer keys. This chip has a serial output. Not as versatile in terms of per-coding the keys and would need to put some code into the main PICAXE to decode which might otherwise be handled in a separate PICAXE18 .

Thinking that I can start with a few 4x4 keypad matrix side by side (for say 48 keys) which will be compact at around 60mm x 180mm. Can use one as number pad, and two as alpha pad (32 keys).

So for now think I may buy the EDE1188 and a few 4x4 keypads and can also think about the PICAXE approach later.

Regards
Westaut55
 

demonicpicaxeguy

Senior Member
here's desert for an idea that works,

i recently used a 10pot and the 8bit adc capability to "cycle" through the whole alphabet and numbers on a 2X16 lcd screen as a way of quicking entering text, together with two switches it worked out very well

i used 1 switch for "enter" and the other for "cancel" and to change to the desired letter on the screen you simply turn the pot

with a little practice and provided you know the alphabet it's almost preferable the common way of enter text in a mobile phone
 

premelec

Senior Member
well... it may not be _that_ bad an approach as I watch people fiddling with their iPods and Apple notebooks which make things whiz by as you wave your finger on the touch pad left and right... they seem to like it... also for disabled folks it might work well supplanting the rectangular array which you point and click on... I could see that you might not want to go through the characters in alphabetical order but would have some other order where frequently used stuff is only a slight [lemon flavored?] twist away... anyhow we do need better input modes for compact devices... so have another drink and consider, dream, develop and enjoy...
 

BCJKiwi

Senior Member
Surely the foot pedals are reserved for 'enter' and 'cancel' and the left hand does the numbers and punctuation while the right hand does the letters;)

Reminds me of the hand grip 5 button keypad used in binary fashion - that's 32 combos. Don't recall what the trick was to get the rest of keys, maybe a sticky switch to shift it all to the next block of 32 etc.
 
Last edited:

demonicpicaxeguy

Senior Member
well... it may not be _that_ bad an approach as I watch people fiddling with their iPods and Apple notebooks which make things whiz by as you wave your finger on the touch pad left and right... they seem to like it... also for disabled folks it might work well supplanting the rectangular array which you point and click on... I could see that you might not want to go through the characters in alphabetical order but would have some other order where frequently used stuff is only a slight [lemon flavored?] twist away... anyhow we do need better input modes for compact devices... so have another drink and consider, dream, develop and enjoy...
i'm broke at the moment and that effort took a whole bottle of straight jim beam, and i'm not sure how many woodstock's and aparently i had somthing to say to the dog........ don't ask

with a little refinement what you would do is have it "scroll" through the letters by how commonly they get used statistically, in a similar fashion to how the qwerty keyboard came about,
it is somthing you do get used to ,
after a little while of fiddleing , it was suprising how easy is was once you got used to it although i'd maybe even look at using a flexing resistance strip instead,

heck with a little practice even a simple pressure resistive setup could even be very usable
you could have say a flexi resistance strip thingo inside a glove or somthing of that nature,
 

Tom2000

Senior Member
DPG, your text entry device reminds me of an ad I saw many years ago, when micros were just gettting into the hands of hobbyists. There were some really wacky ideas being marketed back then. (Anyone remember the Exatron stringy floppy? :) )

The unit being marketed was a one-haned text entry device. It was a sort of hemisphere. You'd place your hand over it, and your fingers would rest over conveniently-located switches.

To enter your text, all you'd have to do was click in encoded ASCII!

For reasons I could never fathom, that device never caught on. :)

Tom
 

demonicpicaxeguy

Senior Member
there were a few good idea around back then, i don't think people were as open minded and adaptive to new devices as they are today , which is probably why a lot of ideas that were very good at the time and could have made things quite interesting didn't get much of a go

tom2000, i think my father in law still has one somwhere.....

the microwriter is an interesting one would be interesting to put it into somthing thats easier to hold and a little more portable, but the general concept is fairly sane
 
Last edited:

westaust55

Moderator
Keypad alternatives

Re-reading though the options put forward by various people, the second post suggested the infrain command.

In further reading the PICAXE manuals Part 1 (pages 26 to 29) on pin allocations and part 2 (pages 78 to 85) about the BASIC commands available I note that the infrain/infraout BASIC commands are not available for the 28X1/X2 and 40X1/X2 PICAXE chips.
 

westaust55

Moderator
Keypad alternatives

Hi eclectic,

You are correct there.

The 28X1/x2 and 40X1/X2 parts are using the new command for the infra red comms.

All a case of working one's way through the entire BASIC manual - something I am still doing . . . .
 
Top