ADC or 'one input' Keypad Decoder

BCJKiwi

Senior Member
This project is a collaboration between Jon Henry and myself. Jon has kindly hosted the site for the schematics and the calculators.
Jon also has the full breakdown on his application and the background to the project from his perspective on his site along with photos etc.

The task was to find the simplest way to decode a keypad constructed from an 'off the shelf' Matrix type keypad or a keypad constructed from Tact or similar type separate keys.

Two solutions are offered - the simplest being for the separate keys which requires no calculations and simply consists of a few resistors and a readadc at the PICAXE. This has been reliably tested from 8 through 20 keys. To use the same concept for the Matrix type keypad requires more effort in selecting the correct resistor values but this effort has been reduced for you if you utilise the 'ADC Keypad Decoder Spreadsheet' which can be found here. Jon's overview is Here. Both are on Jon's Website.

It seems that JON's WEBSITE is no longer accessible - SEE POST #10

The original thread with all the gory details of how we arrived at the endpoint is Here.
 
Last edited:

BCJKiwi

Senior Member
I had seen this solution but was not entirely happy with it.
It relies on the contact resistance of the keys at one end, and the ADC intervals are not as large.
For a user needing a solution for keypads other than 12key, the ADC Keypad Decoder Calculator provides the answers and provides for tuning for the maximum steps between ADC values.
 

BCJKiwi

Senior Member
ADC 'One Input' - Mixed Inputs and Diode Protection

The above work was done for analysing keypad or keypad-like switch arrangements.

Have just extended it to other arrangements including status outputs from a datalogger. As I wanted to be sure not to cause any problems with the device outputs, and to mix those outputs with switches, the addition of BAT85 diodes on each output resolved this problem.
 

Attachments

wilf_nv

Senior Member
Hybrid MUX + ADC encoder

This ADC One Input circuit will only detect one active mixed input with the highest priority (nearest to the ADC input). All other inputs are ignored. OK for some momentary keyboard applications but less flexible for "mixed" applications.

When combined with a free running 4017 counter that drives the Vcc side of each switch and enables the mixed inputs one at a time, the circuit can encode all 10 of 10 mixed input using just one PICAXE pin.

Each input is scanned in turn by the active high 4017 output and the successive analog values, measured at the ADC input, are used determine which inputs are active.

wilf
 

BCJKiwi

Senior Member
That is well understood Wilf.

The ADC 'one input' has it's place and is very simple in both concept and execution. If you need something more then you need something more - not the ADC one input.
 

slurp

Senior Member
This looks like it could work well for the joystick switches too. (Ref. RS 516-316) where you have four directions and a centre push.... I don't believe that you can make a push as the same time as direction :)

I was a little puzzled by the maths present on Jon's overview, then noted the spread sheet was calculated as b1=(b0+X)/Y rather than b1=b0+X/Y where X is a halfstep and Y is a full step of the ADC reading.

regards,
colin
 
Last edited:

BCJKiwi

Senior Member
An updated Sreadsheet calculator has been loaded on Jon's site here. SEE POST #10

This now includes specific calculators for 12 key Matrix keypads.
 
Last edited:

BCJKiwi

Senior Member
Here it is - not sure what is happening on Jon's Website as the root is still active (but requires a password to access).

Here is the spreadsheet. It is an Excel spreadsheet compressed with winzip and renamed to .txt for upload.

So;
download, rename extension to .zip, unzip, open with excel
 

Attachments

westaust55

Moderator
Here it is - not sure what is happening on Jon's Website as the root is still active (but requires a password to access).

Here is the spreadsheet. It is an Excel spreadsheet compressed with winzip and renamed to .txt for upload.

So;
download, rename extension to .zip, unzip, open with excel
Funnily enough I went looking for the ADC based keypad information on Saturday and found that Jon’s website was not available. Luckily I had previously downloaded the spreadsheet (for that rainy day).

But this is just one example of why we should endeavour to post the information here is this, the PICAXE forum.

I have commented on this before, as while folks have all the best intentions, I am frequently finding broken links where linked sites elsewhere (away from the PICAXE forum) are no longer available.
 

BCJKiwi

Senior Member
I agree Westy,

However in this case, Jon was the instigator of the original thread and has all his project information and methodolgy posted there so it seemed an appropriate place at the time. However, all is NOT lost as it is also now here!
 

slurp

Senior Member
It's been ages since I first saw this technique, just got around to an application:
ControlPad (Front).jpgControl Pad (Back).jpg

This is pad has two strings of switches so that you can operate both side of the controller together. I'm really pleased with the results even if the board construction could have been better. that's isolation routing with an old cnc miller recovered from a closing school.

Best regards,
Colin
 
Top