Example Code for Arduino-Send SMS (Library)
Last revision 2026/01/24
The article provides a comprehensive guide on how to send SMS using Arduino with the SIM808 library. It covers hardware and software preparations, including installation steps, and offers a detailed explanation of the function commands to send SMS effectively.
Hardware Preparation
- DFR0355 SIM808 with Leonardo mainboard x1
- GSM & GPS Antennas (Included) x1
- External power supply (7-23V, DC) x1
- SIM card (GSM/GPRS) x1
- FIT0265 Micro USB Cablex1
Software Preparation
- Download and install the Arduino IDE: Click to Download Arduino IDE
- Download and install the SIM808 library: SIM808 library
Preparations
- Install library to
Arduino-1.5.*\libraries(not Documents\Arduino\Library) - Upload sample sketch
File > Examples > SIM808 > SendSMS - Open Serial Monitor (9600 baud, Newline)
- Send the receiver number after you see the message GSM initialized
- Send a message after you see the message Now, enter SMS...
- After a while the receiver will receive the message
Result


Function Explanation
- sms.beginSMS(): Send the transformed number to SIM808 module
- sms.print(): Print the message to be sent, and it will send the message into SIM808 module
- sms.endSMS(): Finish the message-delivering task
Was this article helpful?
