Reversing the use of a KeyPad

Hi guys

I've tried few search here but it's hard to choose the correct words for the search. So if something exist already about this topic please excuse me....

What I basically would like to know is if it is possible to use the structure of a keypad on reverse. I mean what if I connect a relay to a row/column combination (as per keypad connections) and put those pins High/Low?

I mean in a standard keypad combination like the img attached, what if I connect relays instead of switches and instead of reading pins I write those pins HIGH,LOW (or even the third-state)?

Thx for help m8s still strugling to get couple of pins free, almost succeeded to save one.... another one or two and I'm done :wink:

Ciao
Armando

Untitled.jpg

you would only be able to drive one relay at a time.

you would need both an PNP and NPN to handle the power.

other than that, it would work.

Thanks dave for reply.

is this because you cannot "turn on" 2 rows and 1 column at the same time.
I mean what if one "turn on", as per previous attached image, row 4 and 5 and and column 2? don't you get 8,9,0 and # "turned on"? or is shorting 2 pins dangerous?

Thanks for help!
Armando

One of the search terms you need is "matrix". Look up keypad matrix, LED matrix, etc.

An LED matrix circuit will work for some low current relays, but you need flyback diodes on each relay coil.

It works for displays. Search for "multiplex display" and "charlieplexing". But that relies on the human persistence of vision. Relays don't work like that.

But there are other ways to do multiplexing. Serial-to-parallel chips such as shift registers might be relevant here.

Thx to al for reply!

yeah, matrix and chalieplexing is, probably, where my questions come from. amd shift registers is something up for the near future...

At the moment I've already a mechanical (dip-switch) switcher project almost done, I just wanted to implement it with Arduino (indeed only the ATM chip) and, being this latter almost done (I do miss one pin up to now but that should be solved it tonight with a 6 buttons keypad routine), I wanted, whether possible to use the same circuitry and pcb (relays, uln2803, ecc) already in the former project.

Thanks guys for help,
Armando

It works for displays. Search for "multiplex display" and "charlieplexing". But that relies on the human persistence of vision. Relays don't work like that.

I did not suggesting multiplexing. Matrix connections work just fine with relays.

Well, the 2803's are good enough for switching the low side for most relays, even though they're pretty crappy as far as driver arrays go.

With LEDs, it's common to go through each column in turn, and in that way, you can turn on any of the LEDs, not just one (or ones that shared one line), since your eye doesn't see the flicker as long as you do it faster than ~100hz. Relays are probably not so cooperative though - there are probably ways to make it work, but you'd probably be better off with shift registers and the like.

Thx DrAzzy

as I said shift register will be taken on soon :), just started with Arduino couple of months ago, still lots of things to digest :slight_smile: ! so you'll hear from me soon...

...oh and in the mean time (I thought it would have taken the whole night...) thx to Ralph_S_Bacon and switchMatrix , I've "saved one pin" !! and the switcther is working great!

Ciao