Example Code for Arduino-Make a call-V1.0
Last revision 2026/01/24
This article offers a comprehensive guide to making voice calls using an Arduino and SIM800H GPRS Shield, including hardware setup, software installation, library modifications, and sample code execution for seamless operation.
Hardware Preparation
Software Preparation
- Download and install the driver: Click to download driver
- Download and install the SIM800H Arduino Library: SIM800H Arduino Library
- Download and install the SIM800H Hardware Library: SIM800H Hardware Library
NOTE: SIM800H Hardware Library Due to the incoming serial data is too large, the original Arduino serial cache buffer needs to be changed to be larger, there are two ways:
- If your Arduino IDE is below 1.5.5 version, cut HardwareSerial.cpp to Arduino\hardware\arduino\cores\arduino and cover the original file.
- If it is version 1.5.5 or later, then cut the HardwareSerial.h to Arduino\hardware\arduino\cores\arduino and cover the original file.
Modify the library:
If your Arduino IDE is below 1.5.5 version, open the HardwareSerial.cpp file in the Arduino\hardware\arduino\cores\arduino, change # define SERIAL_BUFFER_SIZE 64 to # define SERIAL_BUFFER_SIZE 140;
If the version is 1.5.5 or later, open HardwareSerial.h file and do the same modifications.
NOTE: Not compatible with Arduino IDE1.6.*, Recommand Arduino IDE 1.0.6.
Steps
- Insert the SIM800H GPRS Shield onto UNO board;
- connect UNO to PC with USB cable;
- Use external power supply;
- Turn the switch to the "NONE";
- Open different sketch, select the right board "UNO" and "Srial port", upload sketch to the UNO;
- Don't forget to turn the switch to "Arduino".
- Open the sketch "Examples\sim800program\MakeVoiceCall" in Arduino IDE.
Sample Code
/*
Receive Voice Call
This sketch, for the Arduino SIM800H GPRS Shield,enable SIM800H Modular Caller ID, receives voice calls, get the
Answer.
created Dec 2014
by zcl
This example code is in the public domain.
*/
//libraries
#include <sim800cmd.h>
//initialize the library instance
//fundebug is an application callback function,when someon is calling.
Sim800Cmd sim800demo(fundebug);
//the setup routine runs once when you press reset:
void setup(){
//initialize the digital pin as an output.
pinMode(13,OUTPUT);
//initialize SIM800H,return 1 when initialize success.
while((sim800demo.sim800init()) == 0);
}
void loop(){
digitalWrite(13,HIGH);//turn the LED on by making the voltage HIGH
delay(200);
digitalWrite(13,LOW);//turn the LED off by making the voltage LOW
delay(200);
}
//application callback function
//Note that not too much to handle tasks in this function
void fundebug(void){
//answer the call
sim800demo.answerTelephone();
}
Result
SIM800H module is initialized, and then dial the number 15982373181.
Additional Information
- Sim800Cmd sim800demo(fundebug); This function is to recognize incoming call, if there is an incoming call, it will call the fundebug(void) in the end. You could write something to deal with the incoming call: answer or not. But do remember that do not write too much lines in the sub-function.
- sim800demo.dialTelephoneNumber("15982373181;"); This function is making a dailing. Do not forget the format ";" behind the dail number.
- sim800demo.sim800init(); This function is to finish the initial module, it's much more easier than the last version product.
AT command:
ATDXXXXXXXXXXX;\r\n
Was this article helpful?
