Explora Libros electrónicos
Categorías
Explora Audiolibros
Categorías
Explora Revistas
Categorías
Explora Documentos
Categorías
1.6 Metodología
1.6.1 Materiales
Software Hardware
Arduino Modulos SIM900
Putty Tarjeta Arduino
Sensor de Temperatura
1 PC
Cable Serial
puerto serial
GSM/GPRS Shield
Especificaciones
Banda cuádruple 850/900/1800/1900 MHz - funcionaría en redes GSM en
todos
países de todo el mundo.
GPRS multi-slot clase 10/8
Estación móvil GPRS clase B
Cumple con la fase GSM 2/2 +
Clase 4 (2W @ 850 / 900MHz)
Clase 1 (1W @ 1800 / 1900MHz)
Control mediante comandos (GSM 07.07, 07.05 y SIMCOM mejorado AT
Comandos)
UNIVERSIDAD TÉCNICA DE AMBATO
FACULTAD DE INGENIERÍA EN SISTEMAS, ELECTRÓNICA E INDUSTRIAL
PERÍODO ACADÉMICO: MARZO 2017 – SEPTIEMBRE 2017
Elementos
Estado Descripción
Off SIM900 no está funcionando
64ms On/800ms Off SIM900 no registrado en la red
64ms On/3000ms Off SIM900 registrado en la red
64ms On/300ms Off Comunicación GPRS está establecida
1.6.3 Desarrollo
Configuración de la velocidad de arduino
La velocidad para el puerto serial de la SIM900 es de 19.2Mbps, para lo
que en la configuración de arduino utiliza un método que determina su
funcionamiento.
void setup()
{
SIM900.begin(19200); //Configura velocidad serial para el SIM900
delay(3000); //Retardo para que encuentra a una RED
Serial.begin(19200); //Configura velocidad serial para el Arduino
pinMode(2,OUTPUT);
}
UNIVERSIDAD TÉCNICA DE AMBATO
FACULTAD DE INGENIERÍA EN SISTEMAS, ELECTRÓNICA E INDUSTRIAL
PERÍODO ACADÉMICO: MARZO 2017 – SEPTIEMBRE 2017
SIM900.println("ATD0999234469;");
void espera_mensaje()
{
salir = 1;
while(salir==1)
{
if(SIM900.available() >0)
{
incoming_char=SIM900.read(); //Get the character from the cellular serial
port.
Serial.print(incoming_char); //Print the incoming character to the terminal.
salir = 0;
}
}
}
void modo_recibe_mensaje()
{
//Configura el modo texto para enviar o recibir mensajes
SIM900.print("AT+CMGF=1\r"); // set SMS mode to text
delay(100);
SIM900.print("AT+CNMI=2,2,0,0,0\r");
// blurt out contents of new SMS upon receipt to the GSM shield's serial out
delay(1000);
}
void loop()
{
int iniciar;
int value = analogRead(sensorPin);
temperatura = (value*5 / 1023.0);
inicio:
iniciar=Serial.read();
if(i<2){
Serial.println("DISPONIBLE");
Serial.println("M-->MENSAJE");
Serial.println("L-->LLAMAR");
i++;
}
UNIVERSIDAD TÉCNICA DE AMBATO
FACULTAD DE INGENIERÍA EN SISTEMAS, ELECTRÓNICA E INDUSTRIAL
PERÍODO ACADÉMICO: MARZO 2017 – SEPTIEMBRE 2017
if(iniciar=='L')
{
i=1;
Serial.println("LLamando....");
llamar(); //Llama
//modo_recibe_mensaje();
Serial.println("OK-1");
delay(100);
SIM900.println();
delay(5000);
goto inicio;
//while(1); // Esperate por tiempo indefinido
}
if(iniciar=='M')
{
i= 1;
Serial.println("Mensajeando....");
//llamar(); //Llama
mensaje_sms(); //Envia mensaje
//
Serial.println("OK-2");
delay(100);
SIM900.println();
delay(5000);
goto inicio;
//while(1); // Esperate por tiempo indefinido
}
/*
modo_recibe_mensaje();
for(;;)
{
if(SIM900.available() >0)
{
delay(100);
SIM900.println();
delay(30000);
while(1); // Esperate por tiempo indefinido
}
Tabla 1: Código de configuración en Arduino