Peço por gentileza sua ajuda para fazer um comando.

Com arduino uno + GSM shield, como faço para enviar um SMS quando o arduino detectar nível lógico 1 (5V) na entrada digital 9?

Preciso fazer uma central de alarmes, onde quando o arduino recebe 5V nas entrada ele envia o alarme via mensagem SMS.

att

Exibições: 401

Responder esta

Respostas a este tópico

obrigado!!

consegui resolver!

obrigado consegui resolver!!

Boa tarde, 

Seria algo mais ou menos como nesse post aqui:

https://www.arduinoecia.com.br/2017/09/alarme-por-sms-sim800l-e-ard...

obrigado ...consegui aki...só nao sei como manda a mesma mensagem sms pra varios celulars ao mesmo tempo.

tem como algum me ajudar com essa parte do código?

att

valeu!!

Bom dia , 

Repetindo a pergunta do Argel:

Qual é o modelo do seu GSM shield? 

Poste o Sketch que esta testando.

consegui resolver, valeu pela tenção!

#include <SoftwareSerial.h>
SoftwareSerial mySerial(9,10);
char msg;
char call;
int buttonpin=12;
void setup()
{
pinMode(buttonpin,INPUT);
mySerial.begin(9600); // Setting the baud rate of GSM Module 
Serial.begin(9600);// Setting the baud rate of Serial Monitor (Arduino)
Serial.println("press button");
}

void loop()
{
if(digitalRead(buttonpin)==HIGH)
{

Serial.println("button pressed");
delay(2000);
SendMessage(); 
}

if (mySerial.available()>0)
Serial.write(mySerial.read());
}


void SendMessage()
{

//celular 1
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+55xxxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);

mySerial.println("PROTOTIPO 02 ATIVADO");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);

mySerial.println();
delay(10000);

//celular 2
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+55xxxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);

mySerial.println("PROTOTIPO 02 ATIVADO");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);

mySerial.println();
delay(10000);


//celular 3
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+55xxxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);

mySerial.println("PROTOTIPO 02 ATIVADO");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);

mySerial.println();
delay(10000);


//celular 4
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+55xxxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);

mySerial.println("PROTOTIPO 02 ATIVADO");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);

}

RSS

© 2024   Criado por Marcelo Rodrigues.   Ativado por

Badges  |  Relatar um incidente  |  Termos de serviço