Wireless Telemetry Using a very Few Sensors, Xbee, LCD.

Transmitter Side Code:

int tempC;
int tempPin = 0;
int ldrPin = 1;
int brightness = 0;
void setup()
{
  Serial.begin(9600); //opens serial port, sets data rate to 9600 bps
}

void loop()
{
  tempC = analogRead(tempPin);           //read the value from the sensor
  tempC = (5.0 * tempC * 100.0) / 1024.0; //convert the analog data to temperature
  delay(20);
  brightness = analogRead(ldrPin);

  Serial.write('<');
  Serial.print(tempC);
  Serial.write('>');
  Serial.print(brightness);
  Serial.write(']');

  delay(1000);                           //wait one second before sending new data
}

Receiver Side Code:

#include "LiquidCrystal.h"
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);

#define IDLE  0
#define RECEIVING1 1
#define RECEIVING2 2

int remotetemp = 0;
int remotebrightness = 0;
byte status = IDLE;

void setup()
{
  // initialize serial communication:
  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.clear();
}

void loop() {
  if (Serial.available()) {
    int c = Serial.read();
    if (status == RECEIVING1 && c >= '0' && c <= '9') {
      remotetemp = remotetemp * 10 + (c - '0');

    } else if (status == RECEIVING2 && c >= '0' && c <= '9') {
      remotebrightness = remotebrightness * 10 + (c - '0');

    } else if (status == RECEIVING1 && c == '>') {
      status = RECEIVING2;

    } else if (c == ']') {
      status = IDLE;

      // remote value received completely, do something with it
      lcd.setCursor(0, 0);
      lcd.print("Temp is: ");
      lcd.setCursor(10, 0);
      lcd.print(remotetemp);
      lcd.setCursor(13, 0);
      lcd.print(".C");
      lcd.setCursor(0, 1);
      lcd.print("Brightness: ");
      lcd.setCursor(13, 1);
      lcd.print(remotebrightness);
    } else if (c == '<') {
      status = RECEIVING1;
      remotetemp = 0;
      remotebrightness = 0;
    }
  }
}

{pdf}http://iportal.mohapatra.rocks/images/stories/projects/Wireless telemetry Basic.pdf|app:google {/pdf}