├── GSM GPRS SIM800C Module.pdf ├── RDL GSM GPRS SIM800C MODEM SCHEMATIC.pdf ├── README.md └── Source Code ├── Arduino ├── GPRS Code ├── Power Saving Code ├── SMS Sending and Making Voice Call └── Sending SMS and Receiving SMS Code └── Raspberry Pi └── Making Voice call /GSM GPRS SIM800C Module.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchdesignlab/GSM-GPRS-SIM800C-Modem/1b9c8d4a30678de05acf663ea574202d10069536/GSM GPRS SIM800C Module.pdf -------------------------------------------------------------------------------- /RDL GSM GPRS SIM800C MODEM SCHEMATIC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/researchdesignlab/GSM-GPRS-SIM800C-Modem/1b9c8d4a30678de05acf663ea574202d10069536/RDL GSM GPRS SIM800C MODEM SCHEMATIC.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GSM GPRS SIM800C Modem 2 | ![rdl_gsm-gprs-sim800c-modem_3](https://user-images.githubusercontent.com/8509587/30510303-4be638aa-9adf-11e7-96a0-6befaee04920.jpg) 3 | 4 | GSM GPRS SIM800C Modem-RS232 is built with Quad-Band GSM GPRS engine-SIM800C, works on frequencies 850/900/1800/1900MHz. The Modem is coming with RS232 interface, which allows you connect PC,PLC,SCADA and microcontroller get connected to GSM or GPRS network. 5 | 6 | # Features: 7 | 8 | * Quad-Band 850/900/1800/1900MHz. 9 | * RS232 interface for direct communication with computer or MCU kit. 10 | * Configurable baud rate. 11 | * Power controlled using 29302WU IC. 12 | * ESD Compliance. 13 | * Enable with MIC and Speaker pins. 14 | * Enable with Audio jack. 15 | * With push push sim card holder. 16 | * With Stub antenna and SMA connector. 17 | * Input Voltage: 12V DC. 18 | * High quality PCB FR4 Grade with FPT Certified. 19 | 20 | ## Schematic: 21 | 22 | ![rdl_gsm-gprs-sim800c-modem_schematic](https://user-images.githubusercontent.com/8509587/30511498-d0808e18-9af7-11e7-9657-741478d7a6a6.png) 23 | 24 | 25 | If you have any Quiries, Questions or Concerns, please contact support@researchdesignlab.com 26 | 27 | For more details: https://researchdesignlab.com/gsm-gprs-sim800c-modem.html 28 | 29 | Other related resources: https://researchdesignlab.com/wireless/gsm-modem.html?limit=30 30 | -------------------------------------------------------------------------------- /Source Code/Arduino/GPRS Code: -------------------------------------------------------------------------------- 1 | /* 2 | * Project name: 3 | GSM GPRS SIM800C Modem 4 | * Copyright 5 | (c) Researchdesignlab.com 6 | * Description: 7 | 8 | * Test configuration: 9 | MCU: ATMEGA328 10 | Dev.Board: Arduino uno 11 | Oscillator: 16 MHz 12 | Software: Arduino 13 | 14 | */ 15 | 16 | 17 | #include 18 | 19 | SoftwareSerial mySerial(2, 3); // RX, TX 20 | 21 | char aux_string[30]; 22 | char S_Num[12]; 23 | char S_MSG[169]; 24 | char val,FLAG1=0; 25 | String buffer1="/code2.php?V1=78&V2=98&V3=67&V4=65&V5=56"; 26 | static long timer; 27 | unsigned int i=0,h=0; 28 | char uriTempString[30]; 29 | char link_1[]="v1="; 30 | int8_t len=4,p,len_call=4, K=0; 31 | char GPRS_APN[]="Tata Docomo"; //imis internet-idea rcomnet-rcom TATA.DOCOMO.INTERNET 32 | int8_t answer,val123=0, FLAG=0,kk=0,hht=0,bac=0,CNT=0; 33 | int x = 0,j=0,ch; 34 | char SMS[220]; 35 | 36 | void setup () 37 | { 38 | pinMode(7, OUTPUT); 39 | digitalWrite(7, LOW); 40 | Serial.begin(9600); 41 | delay(100); 42 | mySerial.begin(9600); 43 | Serial.println("STARTING..."); 44 | power_on(); 45 | delay(3000); 46 | 47 | sendATcommand("AT+CMGF=1", "OK", 1000); 48 | delay(1000); 49 | 50 | delay(1000); 51 | Serial.println("GSM IS READY..."); 52 | } 53 | 54 | void loop () 55 | { 56 | 57 | UPLOAD(); 58 | } 59 | 60 | 61 | void UPLOAD() 62 | { 63 | 64 | delay(300); 65 | answer = sendATcommand("AT+CIPSTART=\"TCP\",\"kanwalk.eu5.org\",\"80\"", "CONNECT OK", 15000); 66 | if (answer == 1) 67 | { 68 | K=10; 69 | delay(500); 70 | Serial.println("Connected"); 71 | answer = sendATcommand("AT+CIPSEND", ">", 5000); 72 | if (answer == 1) 73 | { 74 | mySerial.print("GET "); 75 | mySerial.print(buffer1); 76 | mySerial.println(" HTTP/1.1"); 77 | mySerial.print("Host: "); 78 | mySerial.println("kanwalk.eu5.org"); 79 | mySerial.println("Connection: close"); 80 | mySerial.println(); 81 | mySerial.write(byte(0x1A)); 82 | answer = sendATcommand("", "HTTP/1.1 200 OK", 15000); 83 | if (answer == 1) 84 | { 85 | Serial.println("Uploaded"); 86 | mySerial.flush(); 87 | } 88 | } 89 | } 90 | } 91 | 92 | 93 | void power_on() 94 | { 95 | 96 | uint8_t answer=0; 97 | start: 98 | delay(2000); 99 | digitalWrite(7, HIGH); 100 | delay(2000); 101 | digitalWrite(7, LOW); 102 | answer=0; 103 | while(answer==0) 104 | { 105 | answer = sendATcommand("", "Call Ready", 20000); 106 | answer = sendATcommand("AT", "OK", 2000); 107 | answer = sendATcommand("AT+IPR=9600", "OK", 2000); 108 | if(answer==1) 109 | { 110 | answer = sendATcommand("AT", "OK", 2000); 111 | if(answer==1) 112 | { 113 | delay(300); 114 | sendATcommand("AT+CMGF=1","OK", 1000); 115 | } 116 | } 117 | 118 | } 119 | 120 | 121 | sendATcommand("AT+CFUN=1", "OK", 1000); 122 | answer = sendATcommand("AT+CSTT=\"airtelgprs.com\",\"\",\"\"", "OK", 5000); // airtelgprs.com 123 | delay(1000); 124 | sendATcommand("AT+CIFSR", "OK", 15000); 125 | 126 | } 127 | 128 | int8_t sendATcommand(char* ATcommand, char* expected_answer1, unsigned int timeout){ 129 | 130 | uint8_t x=0, answer=0; 131 | char response[200]; 132 | unsigned long previous; 133 | memset(response, '\0', 200); // Initialize the string 134 | delay(100); 135 | while( mySerial.available() > 0) mySerial.read(); // Clean the input buffer 136 | mySerial.println(ATcommand); // Send the AT command 137 | x = 0; 138 | previous = millis(); 139 | // this loop waits for the answer 140 | do 141 | { 142 | if(mySerial.available() != 0) 143 | { 144 | response[x] = mySerial.read(); 145 | Serial.write(response[x]); 146 | x++; 147 | // check if the desired answer is in the response of the module 148 | if (strstr(response, expected_answer1) != NULL) 149 | { 150 | answer = 1; 151 | } 152 | if(x>180) 153 | x=0; 154 | } 155 | // Waits for the asnwer with time out 156 | } 157 | while((answer == 0) && ((millis() - previous) < timeout)); 158 | return answer; 159 | } 160 | -------------------------------------------------------------------------------- /Source Code/Arduino/Power Saving Code: -------------------------------------------------------------------------------- 1 | /* 2 | * Project name: 3 | GSM GPRS SIM800C Modem- Power Saving Code 4 | * Copyright 5 | (c) Researchdesignlab.com 6 | * Description: 7 | 8 | * Test configuration: 9 | MCU: ATMEGA328 10 | Dev.Board: Arduino uno 11 | Oscillator: 16 MHz 12 | Software: Arduino 13 | 14 | */ 15 | int8_t answer; 16 | int onModulePin= 2; 17 | char aux_string[30]; 18 | char phone_number[]="*********"; // ********* is the number to call 19 | char sms_text[]="Hello World"; 20 | 21 | void setup() 22 | { 23 | pinMode(onModulePin, OUTPUT); 24 | Serial.begin(9600); 25 | Serial.println("Starting..."); 26 | power_on(); 27 | delay(3000); 28 | Serial.println("Connecting to the network..."); 29 | while( (sendATcommand("AT+CREG?", "+CREG: 0,1", 500) || 30 | sendATcommand("AT+CREG?", "+CREG: 0,5", 500)) == 0 );//For Network Registration 31 | Serial.print("Setting SMS mode..."); 32 | sendATcommand("AT+CMGF=1", "OK", 1000);// sets the SMS mode to text 33 | Serial.println("Sending SMS"); 34 | sprintf(aux_string,"AT+CMGS=\"%s\"", phone_number); //To send the sms 35 | answer = sendATcommand(aux_string, ">", 2000); // send the SMS number 36 | if (answer == 1) 37 | { 38 | Serial.println(sms_text); 39 | Serial.write(0x1A); 40 | answer = sendATcommand("", "OK", 20000); 41 | if (answer == 1) 42 | { 43 | Serial.print("Sent "); 44 | } 45 | else 46 | { 47 | Serial.print("error "); 48 | } 49 | } 50 | power_off(); 51 | } 52 | 53 | void loop() 54 | { 55 | 56 | } 57 | 58 | void power_on() 59 | { 60 | uint8_t answer=0; 61 | // checks if the module is started 62 | answer = sendATcommand("AT", "OK", 2000); 63 | if (answer == 0) 64 | { 65 | // power on pulse 66 | digitalWrite(onModulePin,HIGH); 67 | delay(3000); 68 | digitalWrite(onModulePin,LOW); 69 | 70 | // waits for an answer from the module 71 | while(answer == 0) 72 | { 73 | // Send AT every two seconds and wait for the answer 74 | answer = sendATcommand("AT", "OK", 2000); 75 | } 76 | } 77 | } 78 | 79 | 80 | 81 | void power_off() 82 | { 83 | digitalWrite(onModulePin,HIGH); 84 | delay(3000); 85 | digitalWrite(onModulePin,LOW); 86 | } 87 | 88 | int8_t sendATcommand(char* ATcommand, char* expected_answer, unsigned int timeout) 89 | { 90 | uint8_t x=0, answer=0; 91 | char response[100]; 92 | unsigned long previous; 93 | memset(response, '\0', 100); // Initialice the string 94 | delay(100); 95 | while( Serial.available() > 0) Serial.read(); // Clean the input buffer 96 | Serial.println(ATcommand); // Send the AT command 97 | x = 0; 98 | previous = millis(); 99 | // this loop waits for the answer 100 | do 101 | { 102 | // if there are data in the UART input buffer, reads it and checks for the asnwer 103 | if(Serial.available() != 0) 104 | { 105 | response[x] = Serial.read(); 106 | x++; 107 | // check if the desired answer is in the response of the module 108 | if (strstr(response, expected_answer) != NULL) 109 | { 110 | answer = 1; 111 | } 112 | } 113 | // Waits for the asnwer with time out 114 | } 115 | while((answer == 0) && ((millis() - previous) < timeout)); 116 | return answer; 117 | } 118 | 119 | -------------------------------------------------------------------------------- /Source Code/Arduino/SMS Sending and Making Voice Call: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Product Name: 4 | GSM GPRS SIM800C Modem- SMS Sending and Making Voice call Code 5 | * Copyright 6 | (c) Researchdesignlab.com 7 | * Description: 8 | 9 | * Test configuration: 10 | MCU: ATMEGA328 11 | Dev.Board: Arduino uno 12 | Oscillator: 16 MHz 13 | Software: Arduino 14 | 15 | */ 16 | 17 | void setup() 18 | { 19 | Serial.begin(9600); // Initialize the serial communicatin with 9600 baud rate 20 | delay(5000); 21 | } 22 | 23 | void loop() 24 | { 25 | Serial.println("AT"); //TO CHECK THE MODEM 26 | delay(1000); 27 | Serial.println("AT+CMGF=1"); //TO CHANGE THE SMS SENDING MODE 28 | delay(1000); 29 | Serial.println("AT+CMGS=\"7735250138\""); //CHANGE TO DESTINATION NUMBER 30 | delay(1000); 31 | Serial.print("Welcome to RDL"); //MESSAGE TO BE SENT 32 | Serial.write(26); 33 | delay(1000); 34 | Serial.println("AT"); 35 | delay(1000); 36 | Serial.println("AT+CMGF=1"); 37 | delay(1000); 38 | Serial.println("ATD99xxxxxxxx;"); //TO MAKE VOICE CALL 39 | delay(1000); 40 | } 41 | -------------------------------------------------------------------------------- /Source Code/Arduino/Sending SMS and Receiving SMS Code: -------------------------------------------------------------------------------- 1 | /* 2 | * Product Name: 3 | GSM GPRS SIM800C Modem- Sending SMS and Receiving code 4 | * Copyright 5 | (c) Researchdesignlab.com 6 | * Description: 7 | 8 | * Test configuration: 9 | MCU: ATMEGA328 10 | Dev.Board: Arduino uno 11 | Oscillator: 16 MHz 12 | Software: Arduino 13 | 14 | */ 15 | 16 | int8_t answer; 17 | int onModulePin= 2; 18 | char aux_string[30]; 19 | char phone_number[]="*********"; // ********* is the number to call 20 | char pin[] = "****"; 21 | char sms_text[]="Test-Arduino-Hello World"; 22 | 23 | void setup() 24 | { 25 | pinMode(onModulePin, OUTPUT); 26 | Serial.begin(9600); 27 | Serial.println("Starting..."); 28 | power_on(); 29 | delay(3000); 30 | // sets the PIN code 31 | sprintf(aux_string, "AT+CPIN=%s", pin);//To Enter Pin 32 | sendATcommand(aux_string, "OK", 2000); 33 | delay(3000); 34 | Serial.println("Connecting to the network..."); 35 | while( (sendATcommand("AT+CREG?", "+CREG: 0,1", 500) || 36 | sendATcommand("AT+CREG?", "+CREG: 0,5", 500)) == 0 );//For Network Registration 37 | Serial.print("Setting SMS mode..."); 38 | sendATcommand("AT+CMGF=1", "OK", 1000);// sets the SMS mode to text 39 | Serial.println("Sending SMS"); 40 | sprintf(aux_string,"AT+CMGS=\"%s\"", phone_number); //To send the sms 41 | answer = sendATcommand(aux_string, ">", 2000); // send the SMS number 42 | if (answer == 1) 43 | { 44 | Serial.println(sms_text); 45 | Serial.write(0x1A); 46 | answer = sendATcommand("", "OK", 20000); 47 | if (answer == 1) 48 | { 49 | Serial.print("Sent "); 50 | } 51 | else 52 | { 53 | Serial.print("error "); 54 | } 55 | } 56 | else 57 | { 58 | Serial.print("error "); 59 | Serial.println(answer, DEC); 60 | } 61 | 62 | } 63 | 64 | 65 | void loop() 66 | { 67 | 68 | } 69 | 70 | void power_on() 71 | { 72 | uint8_t answer=0; 73 | // checks if the module is started 74 | answer = sendATcommand("AT", "OK", 2000); 75 | if (answer == 0) 76 | { 77 | // power on pulse 78 | digitalWrite(onModulePin,HIGH); 79 | delay(3000); 80 | digitalWrite(onModulePin,LOW); 81 | // waits for an answer from the module 82 | while(answer == 0) 83 | { 84 | // Send AT every two seconds and wait for the answer 85 | answer = sendATcommand("AT", "OK", 2000); 86 | } 87 | } 88 | 89 | } 90 | 91 | int8_t sendATcommand(char* ATcommand, char* expected_answer, unsigned int timeout) 92 | { 93 | uint8_t x=0, answer=0; 94 | char response[100]; 95 | unsigned long previous; 96 | memset(response, '\0', 100); // Initialice the string 97 | delay(100); 98 | while( Serial.available() > 0) Serial.read(); // Clean the input buffer 99 | Serial.println(ATcommand); // Send the AT command 100 | x = 0; 101 | previous = millis(); 102 | // this loop waits for the answer 103 | do 104 | { 105 | // if there are data in the UART input buffer, reads it and checks for the asnwer 106 | if(Serial.available() != 0) 107 | { 108 | response[x] = Serial.read(); 109 | x++; 110 | // check if the desired answer is in the response of the module 111 | if (strstr(response, expected_answer) != NULL) 112 | { 113 | answer = 1; 114 | } 115 | } 116 | // Waits for the asnwer with time out 117 | } 118 | while((answer == 0) && ((millis() - previous) < timeout)); 119 | return answer; 120 | } 121 | 122 | -------------------------------------------------------------------------------- /Source Code/Raspberry Pi/Making Voice call: -------------------------------------------------------------------------------- 1 | #Simple AT command 2 | import serial 3 | import time 4 | 5 | ser=serila.Serial('/dev/ttyAMA0', baudrate=115200) 6 | 7 | seri.write('AT\r\n') 8 | x=ser.read() 9 | print (x) 10 | ----------------------------------------------------------- 11 | 12 | ## to make a call 13 | 14 | import serial 15 | import time 16 | 17 | # 18 | ser=serila.Serial('/dev/ttyAMA0', baudrate=115200) 19 | 20 | ser.flush() 21 | 22 | ser.write('ATD**********;\r\n') 23 | time.sleep(10) 24 | ser.close 25 | ---------------------------------------------------------- 26 | --------------------------------------------------------------------------------