Category: IOT

Send and Receive SMS using arduino and GSM shield sim900.

by admin
Hi Please prepare the circuit as shown in image. code:
#include "SIM900.h"
#include 
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

void setup()
{
     //Serial connection.
     Serial.begin(9600);
     Serial.println("GSM Shield testing.");
     //Start configuration of shield with baudrate.
     //For http uses is raccomanded to use 4800 or slower.
     if (gsm.begin(2400)) {
          Serial.println("\nstatus=READY");
          started=true;
     } else Serial.println("\nstatus=IDLE");

     if(started) {
          //Enable this two lines if you want to send an SMS.
          if (sms.SendSMS("+919036634994", "Arduino SMS"))
          Serial.println("\nSMS sent OK");
     }

};

void loop()
{
     if(started) {
          //Read if there are messages on SIM card and print them.
        /**  deprecated method
        if(gsm.readSMS(smsbuffer, 160, n, 20)) {
               Serial.println(n);
               Serial.println(smsbuffer);
          }
          **/
          //get 1st sms
          sms.GetSMS(1,n,20,smsbuffer,160);
          Serial.println(n);
          Serial.println(smsbuffer);          
          delay(1000);
     }
};
    

Get the temperature and humidity from dht22 sensor(Part 1).

by admin
1.Connect pin 1 (on the left) of the sensor to +5V *NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1 to 3.3V instead of 5V! 2.Connect pin 2 of the sensor to whatever your DHTPIN is 3. Connect pin 4 (on the right) of the sensor to GROUND 4.Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor(As shown in image )

Send Data to IOT Event Hub using http request

by admin
Event Hubs is a service that processes large amounts of event data (telemetry) from connected devices and applications. In order to complete this blog you must have a azure account. Also you should know the following things about event hub. Event Hub is service (kind of a service bus) which collect large amount of data and store data for transforming it to real-time Analytics. Two cons over IOT event hub 1) does not provide more secure connection. 2) data communication not bi-directional (only used for device-to-cloud scenarios). Please follow the following steps to send the telemetry data to Azure event hub. 1.Log on to the Azure classic portal, and click NEW at the bottom of the screen. 2.Click App Services, then Service Bus, then Event Hub, then Quick Create. 3.follow the steps given https://azure.microsoft.com/en-in/documentation/articles/event-hubs-csharp-ephcs-getstarted/