I've been pondering on a project involving my Analog keyboard(digital piano) and Arduino which involves having LEDs on each key and lighting up whenever a key should be pressed. My keyboard currently has 61 keys and the idea was to have 4 multiplexes to link up every key, the problem is that the Arduino itself simplify does not have enough pins to link up 4 multiplexes. Is there a way to link a multiplex to another multiplex?
- Letβs see your current proposed schematic.
Consider I2C port expanders, for example the MCP23017, which supports 8 different I2C addresses. Two I2C lines can control up to 128 outputs..
4 16x1 mixes will need 8 outputs to select 1 of 64 inputs. All 4 address lines of each mix are driven by the same 4 outputs; the other 4 outputs are used to select any one mux.
The mux outputs all tie to the same input on the Arduino.
Alternatively, all 4 muxes could be left enabled, and a 1x4 mux used to select one of the 4 mux outputs; that would reduce you to 6 outputs and 1 input.
127..... One is the master...
There are some 20 different "Arduino".......
Don't confuse I2C addresses with I/O pins. In the port expander mentioned there are 16 I/O pins, all separate. 8 port expanders with 8 I2C addresses control 128 pins.
Don't have one yet, still pretty new to this so everythings in planning phase.
I have an Arduino uno currently
Cool! That was the rough idea I had in my head. Trying to see what sensor I should use to detect when the keys are pressed. The model of the keyboard I'm using is this:
Maybe some kind of distance sensor?
Most people use a specialized keyboard decoder IC, generic ICs are shown in post #10.
There is almost certainly one in the keyboard you linked above.
Are you using just the keyboard out of that midi controller, or do you intend to use the midi controller itself?
The manual states the keys are velocity sensitive, usually that is accomplished by having two switch contacts per key.
Have you considered using shift registers to read the key switch states into the arduino?
Not quite, whats a shift register?
First, can you clarify what you are trying to do?
Do you want to light up an LED at each key, or are you wanting to read the key switches with the Arduino?
I want it to light up to show what key to press. When pressed, it moves on to the next set of keys. Does that make sense?
Do you know where to find specialized decoder ICs? Do I have to make it myself or is there a place particularly that sells them?
Ah, that makes it easier, since the actual key press is sent out over midi, instead of having to detect that directly with the Arduino. You just need a way to drive 61 LEDs.
All the major electronics suppliers sell keyboard decoder ICs, like Digikey, Mouser, etc. but...
I want it to light up to show what key to press.
Then the keyboard decoder is irrelevant. Sorry, I misunderstood the project. There are keyboards for teaching beginners that already do what you want.