Go Down

Topic: Arduino + Xbee-Pro 868 temperature system (Read 6109 times) previous topic - next topic

opiskelija

Jul 08, 2013, 02:30 pm Last Edit: Jul 08, 2013, 02:42 pm by opiskelija Reason: 1
Iam trying to measure temperature with two Xbee-Pro 868 and Arduino Uno. I have LM35 temperature sensor connected with breadboard into router Xbee 5V, GND and DIO1 pins. I have connected coordinator Xbee into Arduino with this Xbee shield:
http://arduino.cc/en/Main/ArduinoWirelessProtoShield

And these are the Xbees Iam using with wire antennas:
http://www.cooking-hacks.com/index.php/xbee-868-mhz-sma-module.html

This is the arduino code, which is quite similar to code used in this tutorial:
http://www.youtube.com/watch?v=rnBx2yqKn_E

Code: [Select]
float temp;

void setup() {
 Serial.begin(9600);

}

void loop() {
 if (Serial.available() >= 21) { // Make sure the frame is all there
   if (Serial.read() == 0x7E) { // 7E is the start byte
     for (int i = 1; i<19; i++) { // Skip ahead to the analog data
       byte discardByte = Serial.read(); // Discard bytes we don't need
     }
     int analogMSB = Serial.read(); // Read the first analog byte data
     int analogLSB = Serial.read(); // Read the second byte
     int analogReading = analogLSB + (analogMSB * 256);
     temp = analogReading / 10.0; // Convert analogreading into Celsius
     Serial.print(temp);
     Serial.println(" degrees C");
   }
 }  
}


I have configured my Xbees with X-CTU. Their modem is XBP08-DP and function set is XBEE-PRO 868 SINGLE CHANNEL and version is 1061. Configurations are quite similar to factory settings (all configurations in attachments in text format).

Coordinator/baseradio configurations:
Changed PL = 0, AP = 2

Router configurations:
Changed PL = 0, AP = 2, AD1/DIO1 = 2, IR = 3E8

I have connected Arduino to computer with usb cable and Iam using this usb adapter with router xbee
http://www.aliexpress.com/item/20PCS-5V-1A-USB-EU-Plug-Travel-Wall-AC-Power-Wired-Charger-Adapter-For-Samsung-Galaxy/1002511071.html

This setup works fine with series 2 Xbee radios, but when I try with these Xbee-Pro 868 it is not working. I use arduino serial monitor to see the temperature, but when I open it Iam getting the same value (51.50 degrees C) all the time and it doesn't react when I try to warm or cool the sensor. For sure it is at least sending something. I have tested the LM35 sensor and it is working.

Is there something wrong with my configurations?

What is the difference with these function settings in X-CTU:
XBEE-PRO 868 SINGLE CHANNEL
XBEE-PRO 868 SINGLE CHANNEL - 232 ADAPTER
XBEE-PRO 868 SINGLE CHANNEL - 485 ADAPTER
XBEE-PRO 868 SINGLE CHANNEL - AIO ADAPTER
XBEE-PRO 868 SINGLE CHANNEL - DIO ADAPTER
XBEE-PRO 868 SINGLE CHANNEL - USB ADAPTER

Is this Xbee-Pro 868 compatible with Arduino Uno or Xbee Shield or Xbee Explorer?

Xbee-Pro 868  radios require 500mA even up to 800mA. Xbee Explorer can give 500mA and Arduino Uno about 450mA, Iam not sure about Xbee Shield. Is this correct?


PaulS

Quote
Is this Xbee-Pro 868 compatible with Arduino Uno or Xbee Shield or Xbee Explorer?

They should be compatible with the Uno and the XBee Explorer. The only compatibility issue with the XBee shield would be power-related. That shield has an onboard regulator that drops the 5V provided to 3.3V for the XBee.

Quote
Xbee Explorer can give 500mA and Arduino Uno about 450mA, Iam not sure about Xbee Shield. Is this correct?

You are correct about the Arduino's ability to provide 450 mA, and about the USB-device's ability to provide 500 mA. Whether or not you are correct about being unsure of the shield's capabilities is for you to decide.

Clearly, though, you have a power problem.

What do the bytes that you are discarding tell you?
The art of getting good answers lies in asking good questions.

opiskelija

Thank you for your answer.

I think also that too low power is the problem. Any solutions for this are welcome.

I will try to establish connection between xbees without arduino and see if that works.
I will also check the discarded bytes of the code.

opiskelija

Ok, I have figured that the problem is not power-related since Iam using the lowest power level (PL=0). Transmitter current consumption is only 80mA and receiver 65 mA.

Every second Iam receiving the following hex values: 7E 0 12 92 0 7D 33 A2 0 40 99 4C 35 FF FE 2 1 0 0 2 3 FF 5A and this is not changing. The last two values FF and 5A should change when the temperature changes.

Right now I have no idea where the problem is. Here is some of my configurations:

Transmitter                 Receiver
MT = 3                        MT = 3           multi-transmit
CE = 0                        CE = 1            coordinator enable
PL = 0                         PL = 0           tx power level
RO = 3                        RO = 3           packetization timeout
AP = 2                        AP = 2            API enable
D0 = 1                        D0 = 1            AD0/DIO0 configuration
D1 = 2                        D1 = 0            AD1/DIO1 configuration
IR = 3E8                      IR = 0            sample rate

cantore

I am using two xbee pro 868 with arduino without problems. Using these shield:
http://arduino.cc/en/Main/ArduinoWirelessShield
http://shieldlist.org/libelium/xbee

I have never encountered electrical problems. I use API and AT mode and I can confirm you that the same library written for Xbee series 2 ZigBee works perfectly with the pro 868 xBee.

opiskelija

I have not solved the problem. The project is frozen for me, but I hope this topic helps someone with similar problems.

gc9n

any solution???
i will glad to know if you found something...

gc9n

I have exactly the same problem . I am sure that this is configuration related. Can someone help here?

gc9n

I found the solution in case someone need it
The vref pin must be connected to 3.3v also the temp sensor must be connected to 3.3

This happen because I thought that my USB xbee adapter does that by default .. Like in the YouTube example........ :D  :smiley-lol:

Go Up