Skip to main content
based on the OP's other questions it is SIM800 not GSM800, removed signature, improved punctuation
Source Link

How to send messages to multiple numbers using Arduino uno & GSM 800SIM800 module..?

I am using following code to send message using arduino unoArduino Uno & GSM800SIM800 module. But I need to send same message on multiple numbers then what changes should iI make in my code..Please help..??

Advance Thanks Nilesh Surwade

How to send messages to multiple numbers using Arduino uno & GSM 800 module..?

I am using following code to send message using arduino uno & GSM800 module. But I need to send same message on multiple numbers then what changes should i make in my code..Please help..??

Advance Thanks Nilesh Surwade

How to send messages to multiple numbers using Arduino uno & SIM800 module?

I am using following code to send message using Arduino Uno & SIM800 module. But I need to send same message on multiple numbers then what changes should I make in my code.

How to send massagesmessages to multiple numbers using Arduino uno & GSM 800 module..?

I am using following code to send massagemessage using arduino uno & GSM800 module. But I need to send same massagemessage on multiple numbers then what changes should i make in my code..Please help..??

How to send massages to multiple numbers using Arduino uno & GSM 800 module..?

I am using following code to send massage using arduino uno & GSM800 module. But I need to send same massage on multiple numbers then what changes should i make in my code..Please help..??

How to send messages to multiple numbers using Arduino uno & GSM 800 module..?

I am using following code to send message using arduino uno & GSM800 module. But I need to send same message on multiple numbers then what changes should i make in my code..Please help..??

Source Link

How to send massages to multiple numbers using Arduino uno & GSM 800 module..?

I am using following code to send massage using arduino uno & GSM800 module. But I need to send same massage on multiple numbers then what changes should i make in my code..Please help..??

const int buttonPin = 8;   // Main gate sensor 1
const int buttonPin1 = 7;  // Main gate sensor 2
const int buttonPin2 = 9;  // Store room sensor 1
const int buttonPin3 = 10; // Store room sensor 2

bool i = false;
bool j = false;
bool k = false;
bool l = false;

void setup()
{
  Serial.begin(9600);
  
  pinMode(buttonPin, INPUT);
  pinMode(buttonPin1, INPUT);
  pinMode(buttonPin2, INPUT);
  pinMode(buttonPin3, INPUT);

  digitalWrite(buttonPin, LOW);
  digitalWrite(buttonPin1, LOW);
  digitalWrite(buttonPin2, LOW);
  digitalWrite(buttonPin3, LOW);

  delay(1000);
}
void loop()

{
  sensor1();
  sensor2();
}
  void sensor1()
  {
  if (digitalRead(buttonPin1)== LOW && digitalRead(buttonPin) == HIGH  && i == false)

  {
    Serial.println("OK");
    delay(1000);
    Serial.print("AT+CMGF=1\r\n");
    delay(500);
    Serial.print("AT+CMGS=\"");
    Serial.print("+91...................");
    Serial.print("\"\r\n");
    delay(2000);
    Serial.print("Main Gate is Closed");
    Serial.write(0x1A);
    delay(1000);
    i = true;
    j = false;
   
  }
  
  if (digitalRead(buttonPin)== LOW && digitalRead(buttonPin1) == HIGH &&  j == false)
  {
    Serial.println("OK");
    delay(1000);
    Serial.print("AT+CMGF=1\r\n");
    delay(500);
    Serial.print("AT+CMGS=\"");
    Serial.print("+91........................");
    Serial.print("\"\r\n");
    delay(2000);
    Serial.print("Main Gate is open");
    Serial.write(0x1A);
    delay(1000);
    j = true;
    i = false;
  }
  }
  void sensor2()
  {
  if (digitalRead(buttonPin2) == HIGH && digitalRead(buttonPin3)==LOW && k == false)
  {
    Serial.println("OK");
    delay(1000);
    Serial.print("AT+CMGF=1\r\n");
    delay(500);
    Serial.print("AT+CMGS=\"");
    Serial.print("+91....................");
    Serial.print("\"\r\n");
    delay(2000);
    Serial.print("Store room is Closed");
    Serial.write(0x1A);
    delay(1000);
    k = true;
    l = false;
  }
  if (digitalRead(buttonPin3) == HIGH &&digitalRead(buttonPin2)== LOW && l == false)
  {
    Serial.println("OK");
    delay(1000);
    Serial.print("AT+CMGF=1\r\n");
    delay(500);
    Serial.print("AT+CMGS=\"");
    Serial.print("+91....................");
    Serial.print("\"\r\n");
    delay(2000);
    Serial.print("Store room is Open");
    Serial.write(0x1A);
    delay(1000);
    l = true;
    k = false;
  }
}

Advance Thanks Nilesh Surwade