2x Xbee Series 1 with 1x Uno and 1x Mega

For the discussion of Arduino related topics.

Moderator: phalanx

Post Reply
Posts: 1
Joined: Wed Dec 06, 2017 8:22 am

2x Xbee Series 1 with 1x Uno and 1x Mega

Post by adenong » Wed Dec 06, 2017 9:44 am

Hi guys. I'm very new to arduino and xbee series 1. the main objective of my project is to able to control the lighting system from point A to point B using Xbee to transmit and receive. Right now i'm able to control the lighting from Xbee_A 'COM' by typing '1' as LED ON and '2' as LED OFF to the xbee_B. Furthermore, i would like to improvise the system by transferring data of the temperature values from point B back to point A. But i'm clueless on how to do that. Even after researching for days, i have no idea at all.

Xbee_A connected to shielding(https://www.cooking-hacks.com/communica ... xb-bt-rfid) to Arduino UNO
-jumper wire of DIN to pin 4, and DOUT to pin3

Xbee_B connection to shielding(https://www.cooking-hacks.com/communica ... xb-bt-rfid) to Arduino Mega
no jumper connection


Code: Select all

SoftwareSerial xbee(2,3);
char word1="";

void setup() {
  // put your setup code here, to run once:

void loop() {
  // put your main code here, to run repeatedly:
  if(Serial.available()>0)//if key in something in COM
    word1=Serial.read();//words equal what ou type
    xbee.println(word1);//xbee print out words

Code: Select all

#include <dht.h>
#define DHT22_PIN A8 
int LED=13;
char letter;
dht DHT; //DHT 22 

float hum;  //Stores humidity value
float temp; //Stores temperature value

void setup()

void loop(){
int chk = DHT.read22(DHT22_PIN);
  hum = DHT.humidity;
  temp= DHT.temperature;
    Serial.print("Humidity: ");
  Serial.print(" %, Temp: ");
  Serial.println(" Celsius");
if(Serial.available() >0)
  letter = Serial.read();
  if(letter == '1')
    //50% brightness manually from control station
    digitalWrite(LED, HIGH);
  if (letter=='2')
Any kind soul able to help me out with this? I would really grateful if anyone can help me out.

Post Reply