You are on page 1of 4

Experiment – 7

20BCP112
Name: Devshree Jadeja
Part A
th
Class B Tech CSE 4 Year Sub: Internet of Things
Lab
Aim: Interfacing GSM module with Arduino platform.
Prerequisite: Basics of Microprocessor and Operating System
Outcome: To impart knowledge of Internet of Things Technology
Theory:
A GSM (Global System for Mobile Communications) module is a hardware component
that allows devices to communicate over the cellular network. It is commonly used in
various applications, including Internet of Things (IoT) projects, remote monitoring, and
communication systems. Here's an explanation of the key aspects of a GSM module:
 Communication over Cellular Network: GSM modules are designed to enable
communication over the cellular network, which is the same network used by
mobile phones. This means they can send and receive data, text messages (SMS),
and make voice calls.
 SIM Card Slot: To use a GSM module, you typically need to insert a SIM
(Subscriber Identity Module) card, which contains subscriber information, phone
numbers, and authentication data. The SIM card is what allows the module to
connect to the mobile network and send/receive data.
 Antenna: GSM modules have an antenna for transmitting and receiving signals. The
antenna is essential for establishing a connection with the cellular network.
 AT Commands: To control and interact with a GSM module, you typically use AT
(Attention) commands. These are simple text-based commands that can be sent to
the module via a microcontroller (like an Arduino) to perform tasks like sending
SMS, making calls, and connecting to the internet.
 Serial Communication: Most GSM modules communicate with microcontrollers
like Arduino through serial communication (UART). This means you send and
receive data to/from the module using serial commands, which are typically
transmitted over the TX (Transmit) and RX (Receive) pins.
 Baud Rate and Configuration: GSM modules often require specific configuration
settings, such as the baud rate, to ensure proper communication with the
microcontroller. It's important to configure these settings correctly.
 Power Supply: GSM modules require a power supply to operate. This may involve
a voltage regulator to ensure a stable power source.
 SMS and Data Communication: GSM modules are commonly used to send and
receive text messages (SMS) and transmit data over the cellular network. This is
useful for various IoT applications, such as remote monitoring, security systems,
and location tracking.
 Voice Calls: Many GSM modules also support making and receiving voice calls,
allowing for two-way voice communication over the cellular network.
 Integration with Microcontrollers: GSM modules can be integrated with
microcontroller platforms like Arduino, Raspberry Pi, and others. This integration
allows for remote control and monitoring of devices and systems.

GSM modules are versatile and widely used in IoT projects and applications where cellular
connectivity is required. They provide a means to connect devices to the internet and allow
for remote communication and control, making them a valuable component in various
projects that require long-range wireless connectivity.

Part B
Steps:
here are the steps for interfacing a GSM module with an Arduino platform:
 Step 1: Gather Materials and Equipment
Collect the necessary components, including an Arduino board, GSM module, SIM
card, connecting wires, and a computer with the Arduino IDE installed.
 Step 2: Hardware Connections
Carefully connect the GSM module to the Arduino board using appropriate wiring,
ensuring that the power, ground, TX, and RX pins are correctly linked.
 Step 3: Insert SIM Card
Insert a valid SIM card into the GSM module. Ensure it is correctly placed, and the
module's SIM card slot is secure.
 Step 4: Power Supply
Provide a stable power supply to the GSM module, adhering to the module's voltage
requirements. This may involve using a voltage regulator if needed.
 Step 5: Configure Baud Rate
Set the communication baud rate between the Arduino and the GSM module to match
the module's specifications. This is typically done in the Arduino code.
 Step 6: Install Required Libraries
In the Arduino IDE, install the necessary libraries for GSM communication.
Commonly used libraries include "GSM.h" and "SoftwareSerial.h."
 Step 7: Write Arduino Code
Develop the Arduino code to interface with the GSM module. This code should
include instructions for initializing the GSM module, configuring it, and performing
specific tasks such as sending SMS messages or making calls. Ensure you use AT
commands for communication.
 Step 9: GSM Module Configuration
Configure the GSM module by sending AT commands through the Arduino. Set
parameters such as the PIN code, network settings, and any other required
configurations.
 Step 10: Testing
Test the setup by sending AT commands through the Arduino serial monitor to verify
that the GSM module is functioning as expected. Confirm that it can send and receive
messages or make calls.
#include <SoftwareSerial.h>
#include "Adafruit_FONA.h"

#define FONA_RX 2
#define FONA_TX 3
#define FONA_RST 4

#define FONA_RI_INTERRUPT 0

char sendto[21] = "9737xxxxxx";


char message[141] = "Hello from module";

String techtrends;
SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);

Adafruit_FONA fona = Adafruit_FONA(FONA_RST);

void setup() {
Serial.begin(115200);
Serial.println(F("FONA incoming call example"));
Serial.println(F("Initializing....(May take 3 seconds)"));
delay(5000);
fonaSS.begin(4800);
if (! fona.begin(fonaSS)) {
Serial.println(F("Couldn't find FONA"));
while (1);
}
Serial.println(F("FONA is OK"));

fona.print ("AT+CSMP=17,167,0,0\r");
fona.sendSMS(sendto, message);
delay(1000);
}

void loop()
{
delay(10000);
}

Output:

Observation & Learning:


During the experiment of interfacing a GSM module with the Arduino platform, several key
observations were made. The GSM module successfully established a connection to the
cellular network, enabling the sending and receiving of text messages and data. Additionally,
it demonstrated the capability to make and receive voice calls, illustrating its versatility for
various applications. The experimentation process allowed for a deeper understanding of the
essential hardware components, software libraries, and AT commands required to operate a
GSM module effectively within an IoT context. This experience underscored the significance
of cellular connectivity in IoT projects and provided valuable insights into the potential
applications of GSM modules for remote monitoring and control.
Conclusion:
In conclusion, the successful interfacing of the GSM module with the Arduino platform
showcased the practicality of leveraging cellular connectivity for IoT applications. The
experiment demonstrated the module's ability to establish network connections, send text
messages, and facilitate voice communication, highlighting its versatility in remote
monitoring and control scenarios. This experience emphasized the importance of integrating
GSM technology into IoT projects and underscored the potential for real-world applications in
fields such as home automation, security systems, and data telemetry. Overall, this experiment
not only achieved its objectives but also laid the foundation for future explorations in IoT
technology.

You might also like