Hello guys, I have this keyboard matrix but I do not know what is the pinout. There are 9 contact membranes and 5 actual outputs/inputs. I would like to be able to know where am I supposed to send current and where and how am I supposed to read it.
Here is the matrix :
The best way is to generate an annotated schematic. From that everything else will fall in place.
You can ask the OEM (Original Equipment Manufacture) for this or look in service manuals, you will probably get lucky.
Excuse me what do you hear by an annotated schematic?
Nothing!
This is what one is.
An annotated schematic is a detailed circuit diagram that includes additional notes and labels to clarify the design. It helps others understand the circuit by providing important details that might not be obvious from the symbols alone.
Key Features of an Annotated Schematic:
- Clear Labels Every component (resistors, capacitors, ICs, microcontrollers, etc.) should be labeled with names and values (e.g., R1 = 10kΩ, C1 = 150µF).
- Power and Ground Connections Clearly indicate where power (e.g., VCC, 5V, 12V) and ground (GND) are connected.
- Wire Labels If necessary, label important wires/signals (e.g., SCL, SDA, TX, RX, PWM).
- External Components Show anything connected to the circuit, like sensors, motors, or displays.
- Notes/Comments Provide explanations where needed, especially for complex sections.
- Connection Lengths (if important) If wire length impacts performance (e.g., longer than 10"/25cm), note it.
- Reference to Datasheets If a component requires special wiring, provide a link or note to its datasheet.
Why Use an Annotated Schematic?
- Helps you and us debug your issues more easily.
- Makes it easier for others to understand and help.
- Ensures you’ve wired everything correctly and logically.
Example Tools to Create One:
- KiCad (powerful, free)
- Eagle (widely used for PCB design)
- EasyEDA (online and easy to use)
- Hand-drawn (if neat and clearly labeled)
Okk that's basically what I thought and it is indeed great and I would indeed love to do one! My problem though is that I lack informations : I do not even know where are VCC and GND, the search for the product online didn't help, do you know how I could proceed?
I'm already gonna try stuff with a multimeter
Here is the schematic, so I finally got which switch is linked to which pin but... well... I need help like, I cannot set 1 as an output pin because otherwise I can't put 4 or 3 as output and there is a 4-3 switch. And the same goes for output as 3 and output as 4... Do you have any ideas of how I could use such a board?
It's late in the evening here and my eyes are getting tired so perhaps I've got it wrong, but if your schematic is correct, then it looks like buttons 7, 8 & 9 are wired in parallel.
Applying a logic 1 to pin 1 would result in a logic 1 on pin 3 regardless of whether button 7, 8 or 9 was pressed.
It's not that late here and I saw the same thing.
Initially it was looking like bog standard row/column matrix. Then I got to 7, 8 and 9 and saw what you did. And 5 pins isn't enough to do that anyhow. Charlieplexing perhaps? I thought that was just for LEDS though. Maybe 7 8 and 9 were all under 1 large button? Shrug.
I'M REALLY SORRY FORGOT TO MENTION IT
(7, 8 and 9 pins are under 1 large button so sorrryyyy @markd833 and @van_der_decken...)
@hadeskin can you show us photos of both sides of the board under brighter lighting.
Do you know what each button was used for? Maybe there was a larger stop or enter pad that spanned several buttons.
EDIT: Ah your reply came in whilst I was typing.
Then they're really only 7 distinct keys and 5 pins is plenty.
Something like:
const uint8_t pins[] = {
pin1, pin2, pin3, pin4, pin5
};
.
.
.
for(int i=0; i<5; ++i ) {
pinMode(pins[i], INPUT_PULLUP);
}
.
.
.
pinMode(pin1, OUTPUT);
digitalWrite(pin1, LOW);
if( !digitalRead(pin2) ) {
// key4 pressed
} else if( !digitalRead(pin3) ) {
// key789 pressed
} else if( !digitalRead(pin4) ) {
// key 6 pressed
} else if( !digitalRead(pin5) ) {
// key 3 pressed
} else {
pinMode(pin1, INPUT_PULLUP);
pinMode(pin2, OUTPUT);
digitalWrite(pin2, LOW);
if( !digitalRead(pin5) ) {
// key 1 pressed
} else {
pinMode(pin2, INPUT_PULLUP);
pinMode(pin3, OUTPUT);
digitalWrite(pin3, LOW);
if( !digitalRead(pin4) ) {
// key 5 pressed
} else if( !digitalRead(pin5) ) {
// key 2 pressed
}
pinMode(pin3, INPUT_PULLUP);
}
}
Not checked for accuracy; no warranty is expressed or implied. But it's that kind of thing.