GSM Module (Sim800L) Not Sending Messages, Why?

Hi, I just wanna ask about something. Everything is working in our project and nothing was detected error in our codes. But the GSM Module still doesn’t send messages to the phone we set the StringNumber to.

Can someone check what is wrong with our programming or if its fine, what to do since it is still not sending messages?

P.S: We are also using the PIR motion sensor in this one.

#include <SoftwareSerial.h>
SoftwareSerial sim(2, 3);

String number = "09661379150";

int motionPin = 2;
int percentValue = 0;
int sensorValue1 = 0;
int sensorValue2 = 0;
int sensorValue3 = 0;

void setup() {
  Serial.begin(9600);
  delay(5000);
  Serial.println("System started...");

  sim.begin(9600);
  delay(250);
  sim.print("AT+CNMI=2,2,0,0,0\r");
  delay(1000);
  

}

void loop() {
  readMotion();
  delay(300);
  }


void thiefMessage()
{
  sim.println("AT+CMGF=1");
  delay(1000);
  sim.println("AT+CMGS=\"+639661379150\"");
  delay(1000);
  String SMS = "Hi, motion has been detected.";
  sim.println(SMS);
  delay(100);
  sim.println((char)26);
  delay(1000);
}

void readMotion()
{sensorValue2 = digitalRead(motionPin);

    if (sensorValue2 == 1)
  {Serial.println("Hello, motion has been detected.") ;


    thiefMessage();
    delay(300);}



  else if (sensorValue2 == 0);


}

The picture attached is how our project looks like.

Kim_Mirae's 82585071_497648347551886_2208487044190044160_n.jpg:

In this like of your code:

Kim_Mirae:

SoftwareSerial sim(2, 3);

You configure the SoftwareSerial library to create a serial port named sim on pins 2 and 3. But in the picture you posted, it's clear that the SIM800L is not connected to pins 2 and 3. In fact, you have your PIR sensor connected to pin 2!

Fix your SoftwareSerial library pin assignments in the sketch and see if it starts working.