Send SMS/Text from Arduino using SIM800L GSM/GPRS Module [DigitSpace.com]
Sponsored by: DigitSpace
Product used: SIM800L Module Replace SIM900A GSM GPRS 5V Serial with Antenna
If you’re looking for Send and Receive SMS, here’s an article: Send/Receive SMS using SIM800L with Arduino + DHT11/MLX90614 [DigitSpace.com]
Hello, and welcome to another easy and step-by-step tutorial, this time we’re about to see how to send SMS/Text from the Arduino Uno board to your phone using SIM800L module, we gonna see how to send a simple text, then we’re going to send some data acquired from the DHT11.
HALT !!!! Don’t forget that this type of modules require a SIM card, micro-Sim size, and make sure that the card doesn’t have a “Pin Code” put it in your phone first and remove the “SIM Lock”, and have enough credit to be able to send a SMS, this depends on your country providers.
We can now continue… There are several versions of the module but I used this one:
It worked very well, and very easy, it can be powered directly from the Arduino, but I don’t recommend that, it’s sketchy… It’s better to power it using a Lithium battery and a converter.
This one comes also with a 3dBi antenna and its uFL-SMA converter, and it improves the signal reception and makes it a lot better.
It has 7 pins, I used two for power (5V/GND), and then TXD/RXD/GND for the UART communication, you may need or not to add the GND, it depends on your wiring.
You can communicate with the module using some AT Commands, we gonna see some of them.
Here’s the full list of commands.
N.B: For the power I’ll be using a 7.4V Li battery with a buck converter (actually a buck-boost), it’s more stable.
Notice also that the module has 2 LEDS, one for Power (ON/OFF), and one that blinks:
- Blinks every 1s: Means it’s looking for signal reception.
- Blinks every 2s: Means it’s communicating GPRS Data.
- Blinks every 3s: Means it’s connected to network and ready.

Test 1
In the test 1 we’re going to wire the module with Arduino Uno board, add a push button, the idea is that when we press the button, the Arduino will send a simple (String) SMS to a phone number via the SIM800l.
Wiring
Wiring is easy, the Arduino is also powered by the “battery” or the 5VDC source, the button is always on HIGH level because I’m using the internal pull up, when pressed it goes low… then RX/TX with TXD/RXD (from Sim800l).
Libraries
No special library is required… only SoftwareSerial and it’s already installed
Code
Here you can download the full code from Drive (The website editor isn’t good to be able to copy from it).
The code contains comments for your help.
Result


The button defines the general case… You can use any trigger you want: Tripwire, Sensor threshold….
Test 2
The test number 2 is really similar to the first one, now instead of a simple message, we’ll be able to send some sensor value, and here I’ve chosen the DHT11, because it’s very easy and a classic.
Wiring
As the first one, now we add the DHT11 and its data pin is on pin 8
Libraries
The only library required here is the DHT 11 one: Download from Github
Install it if you didn’t have already.
Code
Download the code with comments from Drive.
Result
Here I add the Serial monitor functions in a single function “Serialcom”, you can communicate with the module and test all the AT Commands you want when you are in standby mode, but when the button is pressed, a SMS will be sent to the phone number containing the Temperature and Humidity current values.


Well, that’s it for the tutorial, I hope you find it useful, now you can send easily a SMS to your phone… Now you only have to chose which information to send and what’s your prefered trigger or threshold.
Remember to subscribe to the channel if you want to support.
Thanks to DigitSpace for their sponsorship.
Categories
Yassine View All
Automation and Electrical Engineer, Electronics amateur trying to share my little projects.
very good project
Super 👍🏾
Possible que vous le faites aussi pour le module GSM SIM900