Go Down

Topic: Recommendation on a 13+ inputs digital multiplexer. (Read 958 times) previous topic - next topic

Nov 13, 2012, 07:05 pm Last Edit: Nov 13, 2012, 07:07 pm by Thot Reason: 1
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.



.
There are three kind of people in the world: Those who can count, and those who can't

CrossRoads

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
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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
There are three kind of people in the world: Those who can count, and those who can't

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

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.

There are three kind of people in the world: Those who can count, and those who can't

DuaneB

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 -

http://rcarduino.blogspot.com/2012/10/five-dollar-synthesiser.html

Duane B
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

CrossRoads

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.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Have you considered Repurposing an existing keyboard ?
http://rcarduino.blogspot.com/2012/10/five-dollar-synthesiser.html

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

There are three kind of people in the world: Those who can count, and those who can't

Go Up