With this project you get the value of temperature and humidity via a missed call.
when you try to make call to the inserted SIM no. in SIM900 module, the call is autamatically dissconeected and you will receive the SMS of cureent value of temperature and humidity.
I am using DHT11 module.
for more accurate data should use DHT22 module.
monitor the status of module on serial monitor.
For more details and inquiry: rishikeshucer@gmail.com
Requirement :
Details:
Specifications:
Module Interface Description:
Library Link:
https://www.youtube.com/redirect?v=Y30iEOxl1To&event=video_description&q=http%3A%2F%2Fwww.tinyosshop.com%2Fdatasheet%2FGSM_GPRS_GPS_Shield_GSMSHIELD.rar&redir_token=89pRp-UJ_YU9vUXYHwaa_gKBEsJ8MTUwOTM4NDk3MEAxNTA5Mjk4NTcw
Code:
#include "SIM900.h"
#include <SoftwareSerial.h>
#include "call.h"
#include <DHT.h>
#include "sms.h"
int gsmTx = 2; // TX- pin to Arduino Pin D2
int gsmRx = 3; // RX- pin to Arduino Pin D3
SMSGSM sms;
#define DHTPIN 7 //DHT Output Pin connect to Arduino Pin 7
#define DHTTYPE DHT11
CallGSM call;
boolean started=false;
char sms_text[160];
DHT dht(DHTPIN, DHTTYPE);
void setup()
{
pinMode(DHTPIN, INPUT);
dht.begin();
Serial.begin(9600);
if (gsm.begin(9600))
{
Serial.println("\nstatus=READY");
started=true;
}
else
Serial.println("\nstatus=IDLE");
}
void loop()
{
float humidity, temperature;
String smsText ="";
switch (call.CallStatus())
{
case CALL_NONE: // Nothing is happening
break;
case CALL_INCOM_VOICE : // Yes! Someone is calling us
Serial.println("RECEIVING1 CALL");
delay(1000);
call.HangUp();
delay(3000);
Serial.println("CALL1 HANGUP");
humidity = dht.readHumidity();
temperature = dht.readTemperature();
delay(2000);
smsText = "Temperature: "+String(temperature,1)+"C Humidity: "+String(humidity,1)+"%";
smsText.toCharArray(sms_text,160);
//Serial.println(smsText);
sms.SendSMS("+91XXXXXXXXXX",sms_text);// Set your mobile No. on which you receive the SMS
break;
case CALL_COMM_LINE_BUSY: // In this case the call would be established
Serial.println("TALKING. Line busy.");
break;
}
delay(1000);
}