# Calculator keypad detection technique

I have a simple 8 digit calculator and want to use it in a way that instead of pushing the keys on keypad, connecting the keypad wire to an Arduino to control the calculator.

In general I know how the Arduino can read the matrix keypad, but it seems this calculator keypad is not using the scan technique that makes a column wire to 1 and then reading the row wire to detect the digit pressed.

There are 11 wires from MCU to the keypad and there are 24 keys on the calculator keypad.

I checked all 11 wires with an oscilloscope: 5 of them have 1.58 volts and 6 of them are 0 volts. There is no pulse on any of them.

The calculator works with a 1.5 volt coin battery. In my test, I connected an AAA battery and at that time battery voltage was 1.62 volts.

I found that the calculator MCU will convert 1.5 volts to 3 volts for internal use.

My question is what technique is used in this calculator to read keypad?

• Ali, many of us have had to reverse engineer. You "scope" things out and write down what you find out. Right now, I believe the two are inseparable in your mind and are a single system to you where you don't know what part is hardware and what part is software. You need to tease apart these two things. I had to do a similar thing in converting an IBM Model 85 Electronic typewriter into a printer device. I examined the keyboard, noted the reed relays, spent time scoping and documenting, then developed a successful design. Worked first time I tried. Just document, for now. Write us, later. – jonk Jul 17 at 9:40
• Have you tried seeing what happens to the voltages when you press the keys? There must be something more happening that you haven't seen yet. – Simon B Jul 17 at 16:16

It is possible that the matrix is not scanned continuously by the calculator, but only when it detects a keypress. But it does not matter, just figure out for each button which two of the 11 wires it connects to.

• I know which two wire connection for desire digit , but in this way i must use 24 transistor to connect wires for digits . But I don't want to use transistor . I want to connect arduino ports to 11 lines of keypad and simulate the keypress by arduino . – Ali Jul 17 at 8:33
• Like I said, the calculator scans the matrix after it has detected any key has been pressed. What happens when any button is pushed? Either a 1.5V line is pulled low, or 0V line is pulled to 1.5V depending on how the calculator MCU wants to detect it. After this the matrix is scanned which can be reverse engineered with an oscilloscope. – Justme Jul 17 at 8:48
• Thanks a lot for your help – Ali Jul 18 at 16:11
• As you said , normal scanning starts after key press. – Ali Jul 18 at 16:16

Your Arduino does not operate at 1.5V so it's not very practical to try to simulate key presses with it.

Sounds like you have a 5 x 6 matrix so 5x 74HC4051 controlled by 3 + 5 = 8 lines would work. You wire all the select inputs to the 4051s in parallel (3 total control lines) and /enable each 4051 individually to select the desired matrix point, so only one of the 5 control lines (at most) is low at a time. You could reduce the number of lines a bit more by using an active-low demux chip like 74HC138 but it's probably not worth it.

Power the xx4051s from the Arduino MCU's power supply (if it's a 5V I/O Arduino, from 0V and 5V). Connect the common to the calculator so that all the voltages are within that range.

The xx4051 analog switches will work fine controlled with 5V and switching 1.5V.

• I tested with arduino for one digit key using analog read , it worked . Arduino uno has 6 analog port and is enough for this 5x6 matrix . Thanks for your hint – Ali Jul 18 at 16:28