I bought a Xbee, s1, module. I tried to make a communication between PIC microcontroller and MATLAB software. It works very well at small distance e.g. 1-3 m but if distance becomes larger the communication between them is lost wether was inside or outside :shock: . although in the datasheet of Xbee was mentioned that the distance can be 100 m.
I read the power level, it was at the highest level. I only changed the data rate to 115200 bit/sec.
I don’t know what I should do to reach to 100 m distance ??? :?
something fundamentally wrong… XBee series 1, non-PRO model, is about 2mW. You didn’t say which antenna you’re using. If it’s the small wire antenna, line of sight should be at least 30m. The XBee Pro has 60mW. I’ve obtained 1/2 mile with a pair of PRO models, where one is simply a wire antenna and the other is an elevated 5dBi gain connected to the XBee via the U.FL version.
Suggest you keep the baud rate much less than 115,200 unless you have flow control in your software, because the effective (net) sustained rate (not burst) is far less than 115200.
So tell us more about the antenna types/arrangements.
as for the xbee, it is 1mW Chip Antenna - Series 1 (802.15.4). it has built-in antenna. both xbees version is 10EC, I used two breakouts; one for PIC and the other has usb connection. it’s better for me to put baud rate at highest rate,115200 bps, because I want to manage a robot using MATLAB software. therefore, I have to receive the sensors readings and sending the required commands all the time.
moreover, I tried xbees at 9600 bps but with same results which the signal of communication was lost at around 4m.
is there any configuration parameter that I should change???
XBee Series 1, chip antennas… antennas need to face one another; they’re somewhat directional.
You should see 30m or more. 100m is pretty marginal with these non-Pro models and the chip antennas are small but poor.
For 100m, you’ll need the Pro models. One end of the link should use the Pro model with the U.FL antenna connector and this should use a U.FL to type N coax adapter, and that connects to an appropriate directional gain antenna. The other XBee can use a wire antenna. Assuming line of sight. If non-line-of-sight, tell us more and we’ll help you.
RF planning takes some thought and a little simple math to predict whether what your circumstances are will likely work.
You say you’re getting only 3m. Is this with the range test software from Digi?
stevech:
XBee Series 1, chip antennas… antennas need to face one another; they’re somewhat directional.
did you mean that Xbee modules should be on the same horizontal plane and vertical one?? :shock: , because in my project, there is a robot has to move around its station where the control command processing happens, so the control station will get the sensor readings via Xbee modules from the robot and send back the suitable commands. Briefly, the wireless communication between the robot and its control station must be in circular area not a small sector or a line because the robot will move around the station. do you get me?? what should I do ? should I think about another module or this xbee module is good choice for my project??
I made a small test at 9600bps to figure out what usually happen to the signal, I found that; if I carry the module and move away in any direction the signal and the transmitted data are lost as the distance enlarges and as the carried module shocks significantly at distances larger than 2meven if I tried to keep them at a line of sight. after that, it needs for a while to be returned depending on the timeout set for the UART command.I was able to send and receive data at around 10m :dance: but with this lost problem :doh: does the xbee modules should be constant?? :think:
stevech:
You say you’re getting only 3m. Is this with the range test software from Digi?
No, I prepared a code for the PIC18f4520 at mikrobasic software using the UART library. I tried the range test at X-CTU but it did not work, I search on the internet but I did not find how to use this test :( , should both Xbee modules connect to PC's or Laptops??
Thank you so much for your time and effort Mr.stevech
As I recall, there is an XBee for beginners here or on the Internet somewhere.
XCTU talks to an XBee via a USB or serial connection to a PC/laptop.
The chip antennas on the board… have a radiation pattern that’s more or less a half-sphere emanating from the blue face of the antenna. VIsualize this as if it were light. The robot antenna will need to face the sky and be clear of obstructions unless the operating range is quite short, say, 10m or less. The controller end of the link needs to have the chip facing the robot for max range. The wire antennas are better. But for 30m or so, the chip antennas can work well.
again, you should see 30m or more with series1 even with the chip antennas. Use the XCTU range test so you eliminate the chance that you have misconfigured the XBees.
I did the range test successfully. range test showed that there is sometimes a bad connection. I think if I could take a signal from assi pin to detect the existence of serial communication signal or not before sending any data. do you know if it will work???
how do you advice about the best programing language rather than mikrobasic???
This is a big negative to me(as a hobbyist) about PICs, no good free tools.
Arduino has great free tools, and as a result has a HUGE library of code to build on.
Even STM has a free gnu C compiler and tools.
That said, I have used CCS Pic C compiler. I liked it, but it has some bugs, but mine is several versions old, and I don’t feel like paying to upgrade.
Stuff like MikroBasic tend to use proprietary runtime libs which tend to make codesets non-portable, so choose wisely.
I have no previous knowledge about Arduino or STM, so it’s difficult to change the microcontroller, especially I have no more time to fulfill my project.
I was thinking whether there is better programing language or not because I often feel like this language is slow. moreover, I cannot use the full options availabe at PIC in some functions such as UART library. otherwise, I will have to deploy mikrobasic because I can use it well
As I was reading through the thread it occurred to me that you haven’t indicated how you’re powering the module. Are these battery or wall powered? In either case you’ll want to make certain that you’ve got a fair amount of bulk capacitance near the power supply for the module–at least 10uF. If you don’t have any capacitance on the supply you’ll observe issues with range.
in the PIC side, xbee module is attached at a breakout produced by sparkfun. this breakout should be powered with 5V. therefore, I use 9.6V battery and Voltage Regulator L7805. on the labtop the Xbee module is connected to a breakout with usb connecter.
I tried to put a 10uF,20uF and 30uF capacitance on the power pins (GND,5V), but without any progress on the results where the serial communication is still interrupted if I get away from the other xbee , especially, if my motion is fast. should I use larger capacitance
JordanHusney:
As I was reading through the thread it occurred to me that you haven’t indicated how you’re powering the module. Are these battery or wall powered? In either case you’ll want to make certain that you’ve got a fair amount of bulk capacitance near the power supply for the module–at least 10uF. If you don’t have any capacitance on the supply you’ll observe issues with range.
I guess you could always check to make sure your voltage across your supply before and after regulator are not sagging because mass current demands. If they are sagging before the regulator, you will want a better supply, and if only after regulation, you will probably want a better regulator.
How are you doing addressing? Are you using the broadcast or unicast mode? Broadcast addressing (ATDL FFFF) is much more sensitive to noise, and should not be used when the radios can be easily paired by exchanging ATMY and ATDL addresses. (ATMY 1 and ATDL 2 for one radio; ATMY 2 and ATDL 1 for the other radio).
I’m using the default addressing. I did not change the addressing mode nor any one of addressing registers. however, when I read the addressing registers, I found MY=0. DH=0, DL=0. is this good???
This will work but you are better off doing pairing. Basically this means that all the radios in your system have the same address and broadcast to each other. On the plus side, any two radios will talk to each other right out of the box. On the downside, with more than two radios, you have no idea where your ‘ack’ messages are coming from.
Faludi:
This will work but you are better off doing pairing. Basically this means that all the radios in your system have the same address and broadcast to each other. On the plus side, any two radios will talk to each other right out of the box. On the downside, with more than two radios, you have no idea where your ‘ack’ messages are coming from.
Faludi:
This will work but you are better off doing pairing. Basically this means that all the radios in your system have the same address and broadcast to each other. On the plus side, any two radios will talk to each other right out of the box. On the downside, with more than two radios, you have no idea where your ‘ack’ messages are coming from.
I checked out the xbee datasheet, and I found that the default mode is unicast with short16 bit addressing but I'm not shure due MY,DL and DH are zeros ( I read them using x-ctu). also, I do not what you mean with the pairing and what the available alternative of pairing if it was the default method???
Joeisi:
Solved by hardware addressing to some extent.
what do you mean with hardware addressing in xbees. I used two xbee modules to communicate between MATLAB and PIC serially and vice versa. so, do you think that the addressing mode is the reason of my xbee's probem???
no problem my friend, do you mean I should change the address of both xbees manually via x-ctu?? this is my first time with xbee. I thought that I can operate them easily by changing the baud rate only and I succeeded but with the signal losing problem . but now, I think that I should change a lot of things e.g. the address of xbee module!!!
alkaser2100:
I’m using the default addressing. I did not change the addressing mode nor any one of addressing registers. however, when I read the addressing registers, I found MY=0. DH=0, DL=0. is this good???
Need to read up before taking the beast out of the hanger.