Recommendation on a 13+ inputs digital multiplexer.

Hello All,
I am playing with a 13 keys keyboard project (the keys are made by momentary pushbuttons) to drive an Arduino Uno and I was wondering if someone can recommend a single multiplexer IC that can accept 13 inputs or more.

I know Arduino can accept up to 14 digital inputs but since the keyboard is going to be far from the Arduino, my goal is to cut down on wires going back and forth by putting a small daughterboard with the multiplexer on the keyboard and run back and forth from Arduino: Power, Ground, the output from the multiplexer and however many wires Arduino needs to select the multiplexer port (4 probably as 2^4 = 16).

If you have any suggestion of a multiplexer, and where to buy them, I would greatly appreciate.

Thanks

Thot

P.S. I searched the forum but I mainly found references to an 8 port multiplerxer. I could use two, but that would partially defeat the purpose on cutting down on wires going back and forth from Arduino and make it for a bigger daugherboard.

.

Arduino as 20 IO, A0-A5 are D14-D19.
You could run some 20 conductor ribbon cable back & forth or 2 pieces of 10 conductor.
http://www.dipmicro.com/store/IDCC10
http://www.dipmicro.com/store/WIRE28X10GR

Then you could PCINTs on the arduino for a fast response to key presses, or multiple key presses.
Or scan all the inputs quickly looking for a pressed key

Thanks for the quick reply!

The keyboard needs to be relatively free to be carried around on stage, much like a singer with a microphone and I thought reducing the number of wires will help accomplish that.

Your solution is feasible and I think I may end up doing something like that.

I was thinking to use RG5 (Ethernet) cables, either 1 cable (8 wires) or 2, if the multiplexer idea goes nowhere.

BTW, what is "PCINTs " is it something to do with interrupts? If so, this is a topic I avoided so far, but I may have to deal with it, can you point me to a good tutorial/book etc.?
I use PC (not Mac).
I was planning to scan the inputs quickly in my program, but maybe there is a better way.

Thanks again

PCINTs are part of what Arduino does, search the playground and/or the forum for a library.
Or I can send an example from home, does 4 PCINTs, once you understand it you can expand to more.
Basically a PCINT gets input as a whole port haivng an interrupt, the code then reads the port and sees which one it was and acts from there. Takes ~4uS I think, so pretty quick.

If you want true portability, go wireless. Get a 434 MHz RF module and run the virtual wire library on a promini, with your keyboard connected to that.

Try scanning first, if not responsive enough go to PCINTs.

Thot:
If you have any suggestion of a multiplexer, and where to buy them, I would greatly appreciate.

P.S. I searched the forum but I mainly found references to an 8 port multiplerxer. I could use two, but that would partially defeat the purpose on cutting down on wires going back and forth from Arduino and make it for a bigger daugherboard.

I assume you mean this: http://www.arduino.cc/en/Tutorial/ShiftIn

You won't need more wires, those chips can be chained together so they act just like a 16-channel chip (or 24...or 32....). You just connect the output of one to the input of the next one.

Thanks again for the replies.

Crossroads: The "Wireless route " was going to be my next step (if I can make the whole thing work with wires, that is). I was thinking bluetooth but I don't know if there is a module for this and even if there is, what would be the simplest solution, Bluetooth or RF?

fungus: I was not aware of that, thanks for pointing it out.

Have you considered Repurposing an existing keyboard ? The keys are generally connected in a grid so rather than having to read 100 keys you can just read the columns, the key is then to switch the rows on one by one, each key connects a unique combination of row and column if you know which row is switched on, its easy to know which keys are pressed.

This is my example but there are many other similar approaches, you can even combine this with shift in to get the required pin count down to 5 -

Duane B

Thot:
I was thinking bluetooth but I don't know if there is a module for this and even if there is, what would be the simplest solution, Bluetooth or RF?

It depends on the distance and what you want to connect to.

RF is certainly less expensive - RX/Tx pairs for <$10, or nrfl2401+ transceivers for $5-6 each.
Wiring up 13 keyboard switches to a promini and 1 wire for a TX module won't take long, and then a simple loop to read the keys and create 2 bytes for virtual wire to send out.

DuaneB:
Have you considered Repurposing an existing keyboard ?
RCArduino: Five Dollar Synthesiser (post in progress)

Duane B

Hello DuaneB.
I was aware of your $5 Keyboard, it came up during my researches. It's amazing but it sounds a bit complicated. My project is simpler and I wanted to see if I can do it from the ground up.
fungus: The distance is not much (same room say) but cost is important (and when isn't? :)).
I think I'll just go with 1 wire per push switch (plus common ground) for the time being and later explore Crossroads' RF option for true portability (I'll have to do some more research on that, any good tutorial out there?).

Thanks again