Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Connecting GSM With Arduino Mega 2560
WhatsApp
Sr Karthiga
4y
45.7k
0
2
100
Article
gsm900.zip
Introduction
In this article, I will explain about sending and receiving emergency warning messages from
Arduino
Mega 2560. It can easily send and receive messages at the time of emergency.
Parts Of List
Arduino Mega 2560
GSM
Bread Board
Jumper Wires
GSM:
GSM means Global System For Mobile, it can be used to send and receive a message in a critical area.
It can also act as the GSM modem.
It can have a PIN configuration and MIC is also attached.
Figure 1: GSM Board
Connection:
ArduinoMega 2560 To GSM Board:
Connect the RX pin of the GSM board to the 04 of the Arduino Mega 2560.
Connect the TX pin of the GSM board to the 03 of the Arduino Mega 2560.
Connect the 5V power supply to the Arduino Mega 2560.
At last, connect the 12 DC voltage to the GSM board.
LED To Arduino Mega2560:
Connect the positive pin is digital pin 11 in the Arduino Mega2560
Connect the negative pin in the GND to the Arduino Mega 2560.
Figure 2: Connection from GSM to Arduino Mega2560
Programming:
#include<SoftwareSerial.h>
SoftwareSerial firstSerial(03,04); RX/TX
int
led=11;
void
setup()
{
pinMode(led,OUTPUT);
firstSerial.begin(9600);
Serial.begin(9600);
delay(1000);
}
void
loop()
{
if
(Serial.available()>0)
digitalWrite(led,HIGH);
switch
(Serial.read());
}
void
sndmsg()
{
firstSerial.println(
"AT+CMGF=1"
);
delay(1000);
firstSerial.println(
"AT+CMGS=\"+xxxxxxxxxx\"\r"
);
//Enter Your Mobile Number instead XXXX while Testing
delay(1000);
firstSerial.println(
"sms messagers sender "
);
delay(100);
firstSerial.println((
char
)23);
delay(1000);
}
Explanation:
For sending a message it will have a mobile number in the code.
For receiving the message it will have the SIM card inside the GSM modem.
When the message is sent, the LED glows.
Output:
Figure 3: Output
Read more articles on
Arduino
:
Windows Remote Arduino - Part One
Controlling LED Using Arduino Mega 2560
Arduino
Arduino Mega 2560
Connecting GSM
IOT
Up Next
Ebook Download
View all
Raspberry Pi -Sensorial Symphony of Connectivity
Read by 704 people
Download Now!
Learn
View all
Membership not found