Collision avoidance in Xbee real time communication

Hi,

Can someone pls help me with my project? I have a problem in xbee communication.When many transmitter XBees transmit sensor information together,in real-time,to a single receiver Xbee,there is a collision problem and hence i don get my data correctly at the receiver.Help me resolve this problem…I am new to this…Kindly help me

Thank u

Which XBee’s, series 1 or 2?

What are the XBee’s setup parameters?

Properly setup the XBee’s detect collisions and retransmit.

I would also ask just how many XBees are trying to transmit at the same time ?

XBees use IEEE 802.15.4 which is a CSMA/CA (carrier sense multiple access with collision avoidance) protocol. 802.11 also uses CSMA/CA.

You can disable CSMA/CA in the XBee configuration settings. Be sure it’s enabled. And you need to assure that MAC layer ACKs are enabled, for error correction to try to work. This done, it is very unlikely that your problems are colliding data frames at the RF level. More likely, its problems with your flow control strategy, as below. Remeber, the air link bit rate is 250Kbps, but the net data rate on a perfect link, large frames, is 80Kbps or so, due to the half duplex mechanism of 802.15.4.

Series 1 XBees do not use ZigBee which is a protocol stack above 802.15.4. Zigbee has no role in CSMA/CA, but it is a needless complexity for most hobby/student uses.

Series 2 XBees must use Zigbee for political reasons.

With CSMA/CA on, the only way you get truly coincident transmissions by XBees is if node A cannot receive node B’s signal, because of positioning so that the RF path from A to B is heavily blocked. But even with this, the chance is almost nil, of A and B becoming “syncopated” so their transmissions very, very often are within a milisecond of one another.

More often, the problem is that A and B are sending to C, and XBee C. And your interface to C uses a programming strategy that fails to receive data from C very efficiently and at a high baud rate. The XBee S1 (non-ZigBee) has a one frame buffer. So back to back frames, esp. large frames, can overwhelm the XBee’s buffering unless your microprocessor is efficient. XBee Series 2 (S2) are much more complex about all of this, being based on Zigbee which is, frankly, a giant overkill in complexity unless you want repeaters - i.e., mesh networking. If you do want meshing, and don’t the ZigBee the standard, Digimesh on S1 XBees is far better.

If you are using the XBees in “transparent” mode, there is a world of other problems you face if you do not provide for flow control, AND if your sensors send more than 80 bytes or so per measurement - a frame is about 90 bytes. Arrange your data to avoid this.

Best is to not use transparent mode. Use the Digi XBee binary API, for which there is great documentation, and lots of library code.

But the simplest possible approach is to arrange a data transfer that doesn’t hit the 90 byte per frame limit, doesn’t send more than 2 or so frames per second, and your receiving end has a high baud rate and good strategy to accept incoming data without polling, or some such.

This is all about good flow control methods and it is simple for us pros, but bewildering to a novice.