Interfacing Old Mobile Phone With Pic Or Arduino. (Cheapest GSM Project).
Hi my dears followers, Like it is mentionned in the article title. Today i m trying to demonstrate how we could make a GSM project using any type of MCU Connected to an Old mobile phone.
The idea was not the same used usually, In Fact i m not going to use a GSM Module like SIM900.
To make this real idea I collect a lot of old mobile phone
Hi my dears followers, Like it is mentionned in the article title. Today i m trying to demonstrate how we could make a GSM project using any type of MCU Connected to an Old mobile phone.
MCU Interfacing |
The idea was not the same used usually, In Fact i m not going to use a GSM Module like SIM900.
GSM usually used module |
The idea is since there is many old mobile phone (cheap phone) why not to hack their GSM Circuit to used an our project.
You dont have to collect many mobile phone like i did. To make your project. Just look for one, google it and collect any information could help you.
Information like:
Information like:
- Which Communication Protocol is using
- Current and Voltage Adaptation
- Is there a naked TX/RX like in Nokia 1100
Nokia 1100 - F-Bus, M-Bus, Both, None ???
- Sms Text,PDU ??
This project idea was given to me by a friend of mine, he explain me that was very nice to have an GSM based Control project without using a module but by using a simple old phone like this one (Nokia 1100).
I remember that I saw this guy trying to connect Tx Rx pins of Nokia 1100 to Tx Rx pins of a simple PIC (16F877). In this moment I noticed thats there is a mistake because the voltage in both side is different.
I thought thats the only problem is here, and I start thinking why to pay 50 € for a GSM module when we could use a simple old mobile phone.
I remember that I saw this guy trying to connect Tx Rx pins of Nokia 1100 to Tx Rx pins of a simple PIC (16F877). In this moment I noticed thats there is a mistake because the voltage in both side is different.
I thought thats the only problem is here, and I start thinking why to pay 50 € for a GSM module when we could use a simple old mobile phone.
In fact mobile phones are different from one to other.
Most of Nokia Mobile phone and here i m talking about Nokia 3310, Nokia 1100,... used F-Bus and M-Bus protocol in their GSM network circuit.
Most Nokia phones have F-Bus and M-Bus connections that can be used to connect a phone to a PC or in our case a microcontroller. The connection can be used for controlling just about all functions of the phone, as well as uploading new firmware etc. This bus will allow us to send and receive SMS messages.
M-Bus is a one pin bi-directional bus for both transmitting and receiving data from the phone. It is slow (9600bps) and only half-duplex. Only two pins on the phone are used. One ground and one data. M-Bus runs at 9600bps, 8 data bits, odd parity, one stop bit. The data terminal ready (DTR) pin must be cleared with the request to send (RTS). This powers the electronics in the cable and I think it sets it for M-Bus operation.
F-Bus is the later high-speed full-duplex bus. It uses one pin for transmitting data and one pin for receiving data plus the ground pin. Very much like a standard serial port. It is fast 115,200bps, 8 data bits, no parity, one stop bit. For F-Bus the data terminal ready (DTR) pin must be set and the request to send (RTS) pin cleared.
F-Bus is not the same protocol usually used in GSM module so to use it you have to make your own F-bus Cable converter.
- Nokia Family
Most of Nokia Mobile phone and here i m talking about Nokia 3310, Nokia 1100,... used F-Bus and M-Bus protocol in their GSM network circuit.Most Nokia phones have F-Bus and M-Bus connections that can be used to connect a phone to a PC or in our case a microcontroller. The connection can be used for controlling just about all functions of the phone, as well as uploading new firmware etc. This bus will allow us to send and receive SMS messages.
M-Bus is a one pin bi-directional bus for both transmitting and receiving data from the phone. It is slow (9600bps) and only half-duplex. Only two pins on the phone are used. One ground and one data. M-Bus runs at 9600bps, 8 data bits, odd parity, one stop bit. The data terminal ready (DTR) pin must be cleared with the request to send (RTS). This powers the electronics in the cable and I think it sets it for M-Bus operation.
F-Bus is the later high-speed full-duplex bus. It uses one pin for transmitting data and one pin for receiving data plus the ground pin. Very much like a standard serial port. It is fast 115,200bps, 8 data bits, no parity, one stop bit. For F-Bus the data terminal ready (DTR) pin must be set and the request to send (RTS) pin cleared.
F-Bus is not the same protocol usually used in GSM module so to use it you have to make your own F-bus Cable converter.
Personally I found a bit of Difficulty using this one specially when i found in the net that there is other phone like Siemens or Sony Ericsson could simply support AT command.
All what you have to do is to use their charging cable.
- > Vbatt - Power Charging (used for charging).
- > Gnd - GND (main ground).
- > Tx connected to MCU RX (using a resistor to limit current ).
- > Rx connected to MCU TX (using a voltage devider from 5v to ~2,75v).
- > CTS need to be connected to ground in order to work
- > RTS
- > DCD
- > Audio P - AUDIO L
- > AUDIO - GND
- > Audio N - AUDIO R
- > GND Mic
- > EPP EPP 1 (EXT MIC.)
Noting is easier than this :)
So to connect this mobile phone to an Arduino or a PIC all what you have to do is to follow this. The resistors using is to adept current and voltage between the phone and the MCU.
So to connect this mobile phone to an Arduino or a PIC all what you have to do is to follow this. The resistors using is to adept current and voltage between the phone and the MCU.
Arduino interfacing |
Pic Interfacing |
Now let's speak about program after connecting the phone to the MCU.
- We send serially AT, We received OK . Fine thats Work :D
- To check SMS format we send AT+CMGF=0 , We received OK . Fine this phone support PDU Format message.
- We send AT+CMGF=1 and we received error :/ here is the problem . the phone cant support text message format.
There is no problem if we convert our text message to PDU format before send it or convert received text from PDU format to TEXT.
Here i give you two link, the first is to convert PDU to Text and the second is the inverse.
First One
Second One
Here i give you two link, the first is to convert PDU to Text and the second is the inverse.
First One
Second One
Lets Code...
void createSMS(){
phone.println("AT+CMGS=66");
delay(2000);
phone.print("
07911256536621F801000B911296683049F300043554686973206973206D652069206D2061796D656E206C6163686B68656D2C2057656C636F6D6520696E206D7920626C6F6773697465");
phone.write(0x1A); // Ctrl+Z
phone.write(0x0D); //CR
phone.write(0x0A); //LF
}
...and it works ! ...an SMS with "This is me i m aymen lachkhem, Welcome in my blogsite" on it was send by calling the createSMS() function.