Send SMS based on content

How to let the GSM module send a message to the customer whenever the customer sends a message to the SIM card number in the SIM800L with only the message content being “airtime”.

Have you got a program that can receive SMS messages and display them on the Serial Monitor? If not that should be the first step.

If you have a program that you need help with then post the program.


//Include Library because we are using digital pins for connection
#include <SoftwareSerial.h>
#include “sms.h”
/Initializing digital pins for connection to serve as Rx and Tx
Rx pin is 7 and Tx pin is 8
SoftwareSerial SIM800(7, 8 );

//Variable for storing incoming messsages content
char incoming_char = 0;

void setup()
// Baudrate for serial monitor
//Baudrate for GSM shield
// Give time to log on to network.


void loop()

// Now we simply display any text that the GSM shield sends out on the serial monitor
if(SIM800.available() >0)
//Get the character from the cellular serial port.;
//Print the incoming character to the terminal.

Yes I have a code that prints out

The code you have posted just prints each character as it is received. It is not collecting a complete message. If you want to search for a particular word then you need to capture the complete message

Have a look at the second example in Serial Input Basics.