TEMPERATURE + ORARIO + XBEE  

IN PREPARAZIONE...

 

ARDUINO  + RTC SHIELD

 

      Collegamento degli XBEE  con Arduino

 

Sezione TRASMISSIONE con xbee

PROGRAMMA di Trasmisssione  dati.

#include <Wire.h>

#include "RTClib.h"

RTC_DS1307 RTC;

int inPin =2; //Pin ingresso sonda di temperatura

int temp = 0; //Variabile della temperatura

int k =0;   // Contatore conteggio temperature 

void setup ()

{

    Serial.begin(9600);

    Wire.begin();

    RTC.begin();

       RTC.sqw(1);              //0 Led off - 1 Freq 1Hz - 2 Freq 4096kHz - 3 Freq 8192kHz - 4 Freq 32768kHz

  if (! RTC.isrunning()) {

    Serial.println("RTC is NOT running!");

    // following line sets the RTC to the date & time this sketch was compiled

    RTC.adjust(DateTime(__DATE__, __TIME__));

  }

}

void loop ()

{

    DateTime now = RTC.now();

        Serial.print(now.year(), DEC);

    Serial.print('/');

    Serial.print(now.month(), DEC);

    Serial.print('/');

    Serial.print(now.day(), DEC);

    Serial.print(' ');

    Serial.print(now.hour(), DEC);

    Serial.print(':');

    Serial.print(now.minute(), DEC);

    Serial.print(':');

    Serial.print(now.second(), DEC);

    k = k +1;

    temp =(5.0 * analogRead(inPin)*100)/1024;

    Serial.print( "  ");

    Serial.print(k);

    Serial.print(" lettura  ");

    Serial.print(temp);

    Serial.println(" gradi");

    delay(3000);

}

     

Stazionando nel raggio d'azione degli xbee(max 1400 m. senza ostacoli)

con un portatile ,in ricezione, Terminal con software X-CTU

                

ho un controllo a distanza.