Call and Message using Arduino and GSM Module
Make/answer call and Read/send SMS using Arduino
Sometimes
people find it difficult to use the GSM Module for its basic
functions like calling, texting etc.,
specifically with the Microcontrollers. So here we are going to build a Simple Mobile Phone
using Arduino, in which GSM Module is used to Make the Call, answer
the Call, send SMS, and read SMS, and also this Arduino phone has Mic
and Speaker to talk over this Phone. This project will also serve as a proper interfacing of
GSM Module with Arduino, with all the Code needed to operate any Phone’s basic functions.
Components Required:
·
Arduino Uno
·
GSM Module SIM900
·
16x2 LCD
·
4x4 Keypad
·
Breadboard or PCB
·
Connecting jumper wire
·
Power supply
·
Speaker
·
MIC
·
SIM Card
Working Explanation:
In
this Arduino Mobile Phone Project, we have used Arduino Uno to
control whole system’s features and interfacing
all the components in this system. A 4x4
Alphanumeric Keypad is used for taking all kind of inputs like: Enter mobile number, type messages, make a call,
receive a call, send SMS, read SMS etc. GSM Module is used to communicate with the
network for calling and messaging purpose. We have also interfaced a MIC and a Speaker for Voice
Call and Ring sound and a 16x2 LCD is used for
showing messages, instructions and alerts.
Alphanumeric is
a method to enter numbers and alphabets both by using same keypad. In this method, we have interfaced
4x4 keypad with Arduino and written Code for accepting
alphabets too, check the Code in Code section below.
Working
of this project is easy. All the features will be
performed by Using Alphanumeric Keypad. Check the Full code and a Demo Video below to
properly understand the process. Here
we are going to explain all the four features of the projects below.
Explaining Four Features of Arduino Mobile Phone:
1. Make a Call:
To
make a call by using our Arduino based Phone, we have to press ‘C’ and
then need to enter the Mobile Number on which we want to make a call. Number will be entered by using alphanumeric
keypad.
After entering the number we
again need to press ‘C’. Now Arduino will process for connecting the call
to the entered number by using AT command:
ATDxxxxxxxxxx;
<Enter> where xxxxxxxxx is
entered Mobile Number.
2. Receive a Call:
Receiving
a call is very easy. When someone is calling to
your system SIM number, which is there in GSM Module, then your system will
show ‘Incoming…’ message over the LCD with incoming number of
caller.
Now we just need to Press ‘A’ to
attend this call.
When we press ‘A’,
Arduino will send given command to GSM Module:
ATA
<enter>
3. Send SMS:
When
we want to send a SMS using our Arduino based Mobile Phone, then we need to
Press ‘B’. Now
System will ask for Recipient Number, means ‘to whom’ we
want to send SMS.
After entering the number we
need to press ‘D’ and
now LCD asks for message. Now we
need to type the message, like we enter in normal mobile, by using keypad and
then after entering the message we need to press ‘D’ to
send SMS. To Send SMS Arduino sends given command:
AT+CMGF=1 <enter>
AT+CMGS=”xxxxxxxxxx” <enter> where: xxxxxxxxxx is entered mobile number
And
send 26 to GSM to send SMS.
4. Receive and Read SMS:
This
feature is also simple. In this, GSM will receive SMS
and stores it in SIM card. And
Arduino continuously monitors the received SMS indication over UART. We just need to Press ‘D’, to
read the SMS, when we see the New Message symbol (like a envelope: See the Video at the end) on the LCD. Below is the SMS Received indication displayed on the
Serial port is:
+CMTI: “SM” <SMS stored location>
+CMTI: “SM”,6 Where 6 is message
location where it stored in SIM card.
When
Arduino gets this ‘SMS received’ indication then it extracts SMS storing location
and sends command to GSM to read the received SMS. And show a ‘New Message Symbol’ over
the LCD.
AT+CMGR=<SMS stored
location><enter>
AT+CMGR=6
Now
GSM sends stored message to Arduino and then Arduino extract main SMS and
display it over the LCD and then after reading this SMS Arduino Clear the ‘New SMS symbol’ from the LCD.
Note: There is no coding for MIC and Speaker.
Check
the Full code and a Demo Video below to properly understand
the process.
Circuit Diagram and Explanation:
Circuit
Diagram of this for interfacing GSM SIM900 and Arduino is given
above.
16x2 LCD pins RS, EN, D4, D5,
D6 and D7 are connected with pin number 14, 15, 16, 17, 18 and 19 of Arduino
respectively.
GSM Module’s Rx and Tx pins are directly connected with
Arduino’s pin D3 and D2 respectively (Ground of Arduino and GSM must be connected with
each other).
4x4 keypad Row pins R1, R2,
R3, R4 are directly linked to pin number 11,10, 9, 8 of Arduino and Colum pins
of keypad C1, C2, C3 are linked with pin number 7, 6, 5, 4 of Arduino. MIC is directly connected at mic+ and mic- of GSM
Module and Speaker is directly connected at SP+ and SP- pins
for GSM Module.
Programming Explanation:
Programming
part of this project is little complex for beginners. In this code we have used keypad library #include
<Keypad.h> for interfacing simple keypad for entering numbers. And for entering alphabets with the same keypad,
we have created function void alfakey(). Means we have made every key multi functioning and
we can enter any character or integer by using only 10 keys.
Like
if we press key 2 (abc2), it will show ‘a’ and if
we presses it again then it will replace ‘a’
to ‘b’ and if
again we press three times then it will show ‘c’ at
same place in LCD.
If we wait for some time
after pressing key, cursor will automatic move to next position in LCD. Now we can enter next char or number. The same procedure is applied for other keys.
#include
<Keypad.h>
const
byte ROWS = 4; //four rows
const
byte COLS = 4; //four columns
char
hexaKeys[ROWS][COLS] =
{
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte
rowPins[ROWS] = {11, 10, 9, 8}; //connect to the row pinouts of the keypad
byte
colPins[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad
customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS,
COLS);
void
alfakey()
{
int x=0,y=0;
int num=0;
while(1)
{
lcd.cursor();
char key=customKeypad.getKey();
if(key)
{
if(key=='1')
{
num=0;
lcd.setCursor(x,y);
.... .....
........ ....
Demo & Code
Call and Message using Arduino and GSM Module
Reviewed by XXX
on
สิงหาคม 27, 2560
Rating:
ไม่มีความคิดเห็น