Introduction: Basic Phone Using GSM and Arduino

Picture of Basic Phone Using GSM and Arduino

Description:-

In this instructable an Arduino uno with a GSM shield is used to perform four cellular operations. These are

1-Make calls

2-Receive calls

3-Send SMS

4-Recieve SMS

All you need:-

1. A GSM shield with 900A/900 Sim module (preferably by ATRIM electronics).

2. A 4x4 button Matrix keypad.

3. A 16x2 LCD as display.

4. A Ardiuno UNO R3.

5. Some Male to female & Female to male connecting wires.

6. A PC for programming& uploading the Code using Arduino IDE

Step 1: Making Hardware Connections-

Picture of  Making Hardware Connections-

·

A-Connections of GSM shield &Arduino:-

1. GND of Shield-GND of Arduino.

2. Tx of Shield-Pin 10(Rx of Software Serial) of Arduino.

3. Rx of Shield-Pin 11(Tx of Software Serial) of Arduino.

·
B-Connections of Matrix Keypad & Arduino:-

As shown in figure

C-Connections of LCD & Arduino:-

As shown in figure

Step 2: Programming of Arduino.

·

A. Interfacing code for GSM:

We interface Arduino with GSM shield using AT commands. So, take an overview of some commonly used AT commands:

1. AT: Test weather GSM shield respond

2. AT+CIMI: Request International Mobile Subscriber Identity

3. ATD+91XXXXXXXXXX : Dial the specified number ( replace x with number)

4. AT+CMG=1: Switch on the messaging mode of gsm

5. AT+CNMI=2,2,0,0, 0: Turn on the message indicator

6. ATH: Halt call

7. ATA: Pick up incoming call

8. AT+COPS: Get the service provider name

9. AT+CSQ: Get signal strength

·
B-Interfacing code for Input Matrix:

These two functions are used in interfacing of Input Matrix with Arduino-

1.      Return_Keypad_Values()
: Return the value of key pressed (in char)
2.      Take_input():
Enter a 10 digit number using matrix and use
  • * key : For deleting last digit
  • # key : Call the entered number

Returns: Number entered through keypad ( in String Object)

C-Interfacing of LCD:

Mainly 3 functions are used for interfacing of LCD with Arduino

1-      lcd.begin():
initializing the LCD with Arduino
2-      lcd.setCursor(x,y):
Set the cursor at  x column & y row
3-      lcd.print(“hello”)-This
function is use to print any text or number on LCD.

Step 3: Upload the Code

Picture of Upload the Code

1. Code is available on this Github repository here.

2. Download the repository here in zip.

3. Unzip it and open the all_phone_operations folder.

4.Open all_phone_operations.ino in Arduino ide and upload it (as shown in figure).

Step 4: Operation

Picture of Operation

·

A.Send call:

By pressing button ‘A’ you will be in Send call mode. LCD will prompt to enter a number to call.

These buttons are used in send call mode

  • ‘D’-used for cancel calling operation.
  • ‘*’-used to delete printed digit.
  • ‘#’- Call on dialed number.

· ·

B.Send SMS:

  • Press ‘B’ key for configuring shield in send message mode
  • ‘Enter number’ will be prompted your LCD. You need to enter a 10 digit numbe
  • These buttons are also used in Send message mode.
  • ‘D’: Used for cancel calling operation.
  • ‘*’: Used to delete printed digit.
  • ‘#’: Call on dialed number.


C.Receive call and SMS

Module configures itself in receiving mode when it starts and the LCD will show a response as soon as a call or SMS is received. The program uses only two button for user interaction in case of response received.

  • ‘*’: used to show the received SMS/ Pick up Call.
  • ‘#: used to halt or terminate message / terminate incoming Call

If you find it useful, Please share it.

Step 5:

Special thanks and Credit to Mr. devvrat Arya and Mr. Harsha Deva boley Shetty for this Article.......

And there is a tip for all users to use vcc and ground of ICSP port.

Comments

PrateekS14 (author)2016-07-16

Good one code...

Eric Brouwer (author)2016-07-12

Thanks for sharing. I scanned through your code, and like the way you handle the different functions. I am also currently busy with a SIM800 module.

Just a finding. With the standard SoftwareSerial library, the length of the received SMS will be limited to a maximum of 64 characters. This include all the SMS details, not just the actual message.

Example of a complete received SMS:
+CMT: "+278####6071","","16/07/12,20:21:53+08"

You have 312 Ad-Hoc SMSs remaining which expire on 2016-08-06

Example of same message using the standard SoftwareSerial library:
+CMT: "+27820096071","","16/07/12,20:21:53+08"

You have 312 Ad-Hoc7899urhbfu34u90

To overcome the loss of part of the SMS, I increased the SoftwareSerial receive buffer size from 64 to 200. This resolved all my problems with received SMS's.

With any editor, open the SoftwareSerial file containing the definitions. In my case, it is NewSoftSerial.h.

devvrata1 (author)Eric Brouwer2016-07-15

My code uses a halt function which wait for about 3 sec till the Serialserial reload and read cycle can run several times. That how i was able to fetched the whole msg . But your way is really a quick fix for this problem. Thanks, i will iterate the code.

Eric Brouwer (author)devvrata12016-07-16

Thanks for this. Now your code also makes a lot more sense to me. It just shows that there is no single method to get results. Each programmer makes up his/her own methods, but in the end, we all get the same results.

DIY Hacks and How Tos (author)2016-07-12

Awesome. Building your own phone would be way more fun than just buying one.

About This Instructable

3,240views

26favorites

License:

Bio: I am a B.tech student ....I do all these things for learning nd fun
More by Agam Tyagi:Weather bot & Weather station using GSM shieldBasic phone using GSM and Arduino
Add instructable to: