4
\$\begingroup\$

I wish to control a classic cellphone using an Arduino Nano by connecting the cellphone keys to digital pins, and switch them using a program that I will put on the Arduino. The idea is to make a pseudo-GSM shield, and be able for example to send SMS messages, make a call, or just print a text on the LCD of the cellphone.

The 2 issues that I found :

  1. The cellphone that I use contains 25 keys, but the nano contains just 13 digital pins, so is there a smart way to use few pins to control the 25 keys?
  2. To switch on/off a key I thought to use a transistor, where E(mitter) and C(ollector) connected respectively to GND and V+ of the key and B(ase) connected to arduino. by setting HIGH or LOW on that pin it will open or close EC circuit of the transistor.

Question: Is there a smarter way to switch ON/OFF the keys using just few components (because in my case I will use 25 transistors and it's a lot !!)? And should I to use the same power source for the Arduino Nano and the cellphone?

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Your English good. I Removed the last few lines. \$\endgroup\$ – Mahendra Gunawardena Sep 16 '15 at 10:44
  • 1
    \$\begingroup\$ Take a look at multiplexer. Maybe is the thing you're looking for. \$\endgroup\$ – Pedro Quadros Sep 16 '15 at 11:40
  • 2
    \$\begingroup\$ If you reverse-engineer the keyboard you will find that it uses a matrix type connection (lines connecting to columns). You do not have to use the same power source for both but the grounds need to be connected if you want to use transistors to switch. You could also use optocouplers instead of transistors for switching, then no need to connect the grounds. \$\endgroup\$ – Bimpelrekkie Sep 16 '15 at 12:36
  • \$\begingroup\$ Thanks you for your answers guys :-). I took a look at multiplexer and yes it seems a good solutions to reduce number of used pins, and by the way I found that I have some 74h595 chips, so It's time to make them useful for this project. \$\endgroup\$ – mha Sep 17 '15 at 0:15
  • \$\begingroup\$ The optocouplers seems nice idea to isolate the 2 circuit and are easier to use, but don't have them in my hand now, so I'll keep the transistor method for this moment. by the way I discover that I have an old wired phone, and I discover that is full of transistors (MPS-A42, S8550, S9014). \$\endgroup\$ – mha Sep 17 '15 at 0:20
1
\$\begingroup\$

If we make a number of assumptions we can describe how to go about using a Arduino Nano to control a cell phone keypad with no or minimal additional hardware. If you find the assumptions are not valid you will have to do some work to find a solution. A standard way to design a keyboard is to place switches on a wire grid such that they short a "row" wire with a "column" wire. The most efficient way to arrange switches is in a (near as possible) square grid. So we assume a 5 by 5 grid is used for 25 switches. Further we assume the rows are "scanned" and the column are "sensed" and that the logic voltage is compatible with the Arduino Nano. Finally we assume that the phone will scan the switches much slower than the Arduino runs such that we can sens a row voltage change and, in turn, drive the column voltage fast enough to emulate a button press. If all these assumptions are true, then we need to configure 5 Arduino Nano pins as inputs. One for each row. And 5 Arduino Nano pins as output. One for each column. To activate a fake switch we wait until the row which contains the fake switch is activated. Then we drive the column active which contains the fake switch. There are many more details which you will have to work through. For instance, the phone will likely try and debounce the switch closure. So a fake switch will likely have to remain closed for many cycles of the keyboard scan.

\$\endgroup\$
-1
\$\begingroup\$

I would consider using the Microchip MCP23017 I2C port expander. It contains 16x GPIO pins in addition to 2x interrupt pins.

Notes:

  • The interrupt capability could prove to be very useful in your case: it would allow you leave the Arduino in sleep while waiting for a key to be pressed, and then wake when you actually want to read the keys. This would be much more efficient than constantly pulling data from a MUX or PISO (parallel in serial out) shift register.
  • You can attach up to 8 of these chips on a single I2C bus.
  • Pins not used for reading buttons can be configured as additional (low-ish speed) outputs or inputs.
  • It can handle 5V and 3.3V logic.
  • The MCP23008 is a smaller version of the 017, with 8x I/O pins.
\$\endgroup\$
2
  • \$\begingroup\$ The keypad is almost certainly matrix-scanned, so you cannot just go and arbitrary drive the lines, rather you have to detect the scanning pattern and drive lines with appropriate voltages at appropriate times. Further, you seem to have read the question's intent backwards - it is not about monitoring the keyboard but about injecting fake keypresses. \$\endgroup\$ – Chris Stratton Mar 10 '16 at 19:31
  • \$\begingroup\$ @ChrisStratton, thanks for the notes. As I am new to this field and to this forum, should I delete this attempted answer? \$\endgroup\$ – Caleb Reister Mar 11 '16 at 6:05
-1
\$\begingroup\$

You could use only five pins to control the whole thing using a [[FIVE]] bit demultiplexer. You may still need the transistors depending on how the keypad operates, but you should look at how the keypad is wired, and there is a good chance that you can use just a few pins and apply voltage to the keypad data cable. On second thought, you may not need transistors if you power the cellphone from the same power source that the arduino uses, just make sure not to overvolt the phone if it uses 3.3V logic. If it does, you may need a logic level converter. (Sorry for the wrong bit count, I did my math wrong :/ Thanks for pinting that out.)

\$\endgroup\$
1
  • \$\begingroup\$ His cellphone has 25 keys. Four-bits decoded will only provide for a maximum of 16 keys. \$\endgroup\$ – tcrosley Mar 8 '16 at 0:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.