Noob here, help needed :) SIM900 will jam the other sensor when receiving a sms

Hello All,
I have a problem with PIR sensor and GSM module SIM900 while receiving SMS
if I send a SMS to SIM900, PIR signal output goes HIGH and system recognize this as a motion detected.

it seems that problem is when SIM900 starting communication to Arduino Nano (also tested Arduino ATMEGA 2560, hardware usart1 or softwareSerial) signal pin on PIR sensor goes HIGH no matter if it is connected to arduino.

simplest test which I've tried was,
1.Enabled communication Initial communication (on arduino hardware USART and USART1 OR USART and softwareSerial on atmega 2560 , USART and softwareSerial on NANO ))
2. turn on SIM 900
3. rx tx (and gnd) from SIM900 connected to arduino
4. PIR signal pin connected only to oscilloscope.
5. in loop I have only reading serial function

if I send sms to sim900 I can see on osciloscope signal pir pin goes HIGH.

SIM900 is connected to battery turnigy 3s 11,1V 5200mAh so it is capable to power SIM900
Arduino and pir sensor is connected to USB

similar topic was not resolved in 2017

SIM900 will jam the other sensor when receiving a sms

I've also simple code with motion detection provided below

nanoPirGsm.ino (1.99 KB)

/******************************
GSM TX -> ArduinoNANO PIN 2
GSM RX -> ArduinoNANO PIN 3
GSM GND -> GND
PIR GND -> GND
PIR VCC -> 5V PIN on Arduino
PIR SIGNAL -> Arduino PIN 4
GSM External Source -> battery 
ArduinoNANO source -> USB


if motion is detected program goes to if clausule and send SMS "Motion"
pirDetect is set to 1 to ensure to send only 1 SMS. Once the pir sensor 
detected NO movement pir signal is set to LOW,
than pirDetect is set back to 0 and program is waiting for next occurence
****************/


#include <SoftwareSerial.h>


int pirPin = 4;
int pirStat = 0; 
int pirDetect=0;
int i=0;


SoftwareSerial mySerial(2, 3);


void setup() {
  pinMode(pirPin, INPUT); //PIRsensorinput
  Serial.begin(9600); //init USART
  mySerial.begin(9600); //init software usart
  delay(100);
  mySerial.println("AT");
  updateSerial();
  mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
  updateSerial();
  mySerial.println("AT+CNMI=1,2,0,0,0");
  updateSerial();
}


void loop() {
  pirStat = digitalRead(pirPin); 
  if (pirStat == HIGH && pirDetect==0) { 
    i++;
    pirDetect=1;
    mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
    delay(1000);
    mySerial.println("AT+CMGS=\"+421*********\"");//change ZZ with country code and xxxxxxxxxxx with phone number to sms
    delay(1000);
    mySerial.println("motion!!!"); //text content
    delay(1000);
    mySerial.write(26);
    delay(7000); //7 seconds is here because of this problem with GSM, and gsm continously triggers pir sensor.
                 //if there is no delay pirStat goes HIGH because of sending/receiving SMS
    
  } 
  if (pirStat == LOW){
    pirDetect=0;
  }
  updateSerial();
  }


void updateSerial()
{
  delay(500);
  while (Serial.available()) {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(mySerial.available()) {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
  }
}

PROBLEM SOLVED !!!
I tried to disconnect GND RX and TX from sim900 and PIR sensor goes still HIGH after sending SMS, so I realized that it could be interference from GSM antena and chip on PIR sensor contains amplifier... so for quick test I changed small antena with external antena with 2meters long cable and it works !!!!
later on I will put the SIM900 to metal box and antena will be 2 meters away from any electronics on my project

on the picture is antena and my project (garage door opener, pir sensor alarm, nrf24l01, wireless ESP for application )

Great to see you solved it even before anyone could respond, and thanks for reporting back on it.

Good luck with the rest of your project.

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