SIM900 gsm gprs

Good evening colleagues.
I am trying to write a routine in code for arduino Uno and SIM900 gsm gprs that recognizes the caller's phone number and if it is known then activates an output port. But it doesn't work for me

#include <SoftwareSerial.h>

#define RX_PIN 10
#define TX_PIN 11

SoftwareSerial gsmSerial(RX_PIN, TX_PIN);
String knownNumber = "+1234567890";

int ledPin = 13;

void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
gsmSerial.begin(9600);

Serial.println("GSM initialized");
}

void loop() {

if (gsmSerial.available() > 0) {
String callerNumber = gsmSerial.readString();
callerNumber.trim();

Serial.print("Incoming call from: ");
Serial.println(callerNumber);


if (callerNumber == knownNumber) {
  Serial.println("Known number. Activating port.");

  
  digitalWrite(ledPin, HIGH);
} 

}
}

Most of the time, the problem exists with the power supply. Please check your power supply. You need a 5V, 2A power supply for this GSM module. You have to use separate power supply for the Arduino and the GSM. Powering the module from Arduino board's VCC and GND will not work.

You can also see this project for some references. It uses the same GSM module that you're using: Women Safety Device with GSM and GPS location tracking, Smart Purse - Share Project - PCBWay

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.