multiple key but with low pin+multiple key press

hello, i am new to this arduino and still in the process of learning. I need some help regarding to this circuit(see attachment) key scanning. I already read in the forum that somebody already did it(i think) but i don’t know how he do it. can someone shed some light.

the thread

From the circuit it shows that it need diode at every switch,but is it possible if not using diode?

this thread said it is possible,but maybe i am mistaken. can somebody please confirm?

mnasraff: From the circuit it shows that it need diode at every switch,but is it possible if not using diode?

It's possible, but since Halloween's approaching just be aware of ghosting.

That form of keypad needs the diodes. The typical matrix keypad, when the input and output pins are separate, can do single keys without diodes. On your form of keypad, where the pins are used as both inputs and outputs, you need the diodes to correctly detect single key presses. The way to read this keypad is to set six of the seven pins to INPUT_PULLUP and set one of the pins to OUTPUT and LOW. This will cause a LOW on those pins grounded to the LOW pin through their respective switches and diodes. Without the diodes if you press the button that connects B to A you will see LOW on B when you pull A LOW but also LOW on A when you pull B low.

The diodes also give you N-key rollover: the ability to detect any number of simultaneous key presses.

johnwasser: That form of keypad needs the diodes. The typical matrix keypad, when the input and output pins are separate, can do single keys without diodes. On your form of keypad, where the pins are used as both inputs and outputs, you need the diodes to correctly detect single key presses. The way to read this keypad is to set six of the seven pins to INPUT_PULLUP and set one of the pins to OUTPUT and LOW. This will cause a LOW on those pins grounded to the LOW pin through their respective switches and diodes. Without the diodes if you press the button that connects B to A you will see LOW on B when you pull A LOW but also LOW on A when you pull B low.

The diodes also give you N-key rollover: the ability to detect any number of simultaneous key presses.

but i read in some thread that it can be done without diode,by setting the OUTPUT to HIGH instead of LOW. Can you please reconfirm?

mnasraff: but i read in some thread that it can be done without diode by setting the OUTPUT to HIGH instead of LOW. Can you please reconfirm?

Without the diodes the switches short the pins together. I can't think of any way to distinguish between the the button that shorts A to B and the button that shorts B to A. Even if you add pull-down resistors on all of the pins and use HIGH output instead of LOW you would have the same problem. I still can't think of a way to distinguish between the the button that shorts A to B and the button that shorts B to A.

If you can provide a pointer to the thread that told you that you don't need diodes in your keypad design then I'd like to see how they explain how to do it.

I see how you could double the number of buttons by adding a pin: having diodes in both directions. The added pin would switch some resistors between pull-up and pull-down so half the keys can be sensed with a LOW drive (and pull-ups) and the other half with a HIGH drive and pull-downs.