0% found this document useful (0 votes)
116 views

GSM Gprs Projects For IDE Arduino

This document provides an overview of GSM and GPRS cellular communication technologies and describes several microcontroller projects using GSM/GPRS modules. It introduces two common GSM/GPRS boards: the GSM Click board for PIC microcontrollers and the SIM900 GSM/GPRS shield for Arduino. The document then presents example code and instructions for projects using these boards, including sending SMS text messages, transmitting sensor data like temperature via SMS, and building an SMS-controlled relay. It aims to teach readers how to complete basic GSM/GPRS projects with microcontrollers.

Uploaded by

Martín Vázquez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views

GSM Gprs Projects For IDE Arduino

This document provides an overview of GSM and GPRS cellular communication technologies and describes several microcontroller projects using GSM/GPRS modules. It introduces two common GSM/GPRS boards: the GSM Click board for PIC microcontrollers and the SIM900 GSM/GPRS shield for Arduino. The document then presents example code and instructions for projects using these boards, including sending SMS text messages, transmitting sensor data like temperature via SMS, and building an SMS-controlled relay. It aims to teach readers how to complete basic GSM/GPRS projects with microcontrollers.

Uploaded by

Martín Vázquez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

GSM/GPRS PROJECTS

Based on PIC Microcontrollers and Arduino

Dogan Ibrahim
Ahmet Ibrahim

an Elektor Publication
LEARN DESIGN SHARE

GSM-GPRS 170301.indd 3 03-04-17 09:04


Contents

Contents

PREFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

CHAPTER 1 • GSM and GPRS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

1.2 GSM Network Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.3 1G, 2G, 3G, 4G and 5G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.4 Using GSM and GPRS in Microcontroller Projects . . . . . . . . . . . . . . . . . . . . . . . . . 16

1.5 The GPRS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

1.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

CHAPTER 2 • GSM/GPRS BOARDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.1 GSM Click Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2 Using The GSM Click Board with a PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.3 GSM Click Board GSM AT Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.3.1 Syntax of AT Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

2.3.2 General Purpose AT Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

2.3.3 Phonebook Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

2.3.4 Clock Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

2.3.5 Alert Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

2.3.6 Operator and Network Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

2.3.7 Some Useful General Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

2.3.8 Call Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

2.3.9 Sending and Receiving SMS Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

2.4 SIM900 GSM/GPRS Shield for Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

2.4.1 SIM900 Shield GSM AT Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

2.5 Using the AT Command Tester . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

2.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

2.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

CHAPTER 3 • MICROCONTROLLER DEVELOPMENT TOOLS . . . . . . . . . . . . . . . . . . . . . 63

3.1 Software Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

3.1.1 Text Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

●5

GSM-GPRS 170301.indd 5 03-04-17 09:04


GSM/GPRS PROJECTS

3.1.2 Assemblers and Compilers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

3.1.3 Simulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

3.1.4 Integrated Development Environment (IDE) . . . . . . . . . . . . . . . . . . . . . . . . . . 65

3.2 Hardware Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

3.2.1 Development Boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

3.2.2 Device Programmers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

3.2.3 Breadboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

3.3 Example Program for the Clicker 2 for PIC18FJ Development Board . . . . . . . . . . . 72

3.4 Example Program for the Arduino Uno Development Board . . . . . . . . . . . . . . . . . 81

3.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

CHAPTER 4 • P
 IC MICROCONTROLLER GSM CLICK BOARD GSM PROJECTS . . . . . . . . 84

4.1 PROJECT 1 – Sending An SMS Text Message to a Mobile Phone . . . . . . . . . . . . . . 84

4.1.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

4.1.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

4.1.3 Improved Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

4.2 PROJECT 2 – Sending the Temperature as SMS Text Messages . . . . . . . . . . . . . . . 98

4.2.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

4.2.2 The Temperature Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

4.2.3 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

4.3 PROJECT 3 – SMS Controlled Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

4.3.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

4.3.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

4.3.3 Improved Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

4.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

CHAPTER 5 • A
 RDUINO UNO SIM900 GSM/GPRS SHIELD GSM PROJECTS . . . . . . . . 133

5.1 PROJECT 1 – Sending SMS Text Messages to a Mobile Phone . . . . . . . . . . . . . . . 133

5.1.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

5.1.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

5.1.3 Modified Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

5.2 PROJECT 2 – Sending the Temperature as SMS Text Messages . . . . . . . . . . . . . . 140

●6

GSM-GPRS 170301.indd 6 03-04-17 09:04


Contents

5.2.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

5.2.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

5.3 PROJECT 3 – SMS Controlled Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

5.3.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

5.3.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

5.3.3 Improved Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

5.4 PROJECT 4 – Controlling Room Temperature With SMS Commands . . . . . . . . . . . 159

5.4.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

5.4.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

5.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

CHAPTER 6 • GPRS PROJECTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

6.1 GPRS Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

6.2 Reading the Contents of a Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

6.3 UDP/TCP Data Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

6.4 PROJECT 1 – Sending Temperature Data to a PC Using UDP . . . . . . . . . . . . . . . . 179

6.4.1 The Hardwares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

6.4.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

6.5 PROJECT 2 – Sending Temperature Data to a PC Using TCP . . . . . . . . . . . . . . . . 188

6.5.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

6.5.2 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

6.6 PROJECT 3 – Storing the temperature data on the cloud . . . . . . . . . . . . . . . . . . 196

6.6.1 The Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

6.6.2 The Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

6.6.3 The Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

6.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206

INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

●7

GSM-GPRS 170301.indd 7 03-04-17 09:04

You might also like