I got my XBee's working!
Kevin SkyMoCo
Posts: 23
I really like the new Parallax USB XBee adapters. Having LED's for more than just the power is very helpful and it makes my office look like the holidays. In just a couple weeks of playing around I've gotten one XBee connected to a stamp out in the shop with a temperature/humidity sensor talking to another one here in the house graphing the data on my computer. My next steps to to make an wind speed sensor and have it send that data to me as well.
I'm am absolute novice at all this. I had a couple stamps sitting around for the last 6 years and only after I happened across an article on the XBee's did I get interested.
I did find out that if you leave your stamp outside overnight and it rains it might not work anymore in the morning. I guess one of the next steps better be a weatherproof enclosure.
I'm am absolute novice at all this. I had a couple stamps sitting around for the last 6 years and only after I happened across an article on the XBee's did I get interested.
I did find out that if you leave your stamp outside overnight and it rains it might not work anymore in the morning. I guess one of the next steps better be a weatherproof enclosure.
Comments
Congratulations on the XBees - interesting to see that's what got you to pull out the Stamp. I bought a "What's a Microcontroller?" kit with the Homework Board from Radio Shack years ago, played with it three or four times and then put it away for a couple of years, and then really dived in when I discovered GPS modules and RF modules at about the same time.
How did you handle the 3.3v / 5v difference on the signal lines between the XBee and the Basic Stamp?
It doesn't look like the Parallax XBee Adapter Board handles the voltage difference. Could you describe your wiring or provide a schematic?
Thanks!
So, the local XBee is using the Parallax USB adapter board attached to a USB port of a little linux box. I am using the java API "xbee-api" to read the data and put it into a derby database along with a time stamp and other details like the signal strenth of each packet. On my windows machine I wrote a java program to grab the data from the database and graph it. The remote XBee is plugged into the adapter board noted above on a board of education with the Sensirion SHT11 sensor. Right now it's in a metal outbuilding about 200 yards away from the house and the signal strenth is really good. Over the next few days I want to implement the sleep mode on both the XBee and the stamp and do my samples every 5 minutes or something like that. Right now I sample a couple times a second which is overkill for sure.
I'm using the API mode on the XBee's. I just send the raw data from the Sensirion in a packet encoded into the ascii version of the number. So to send 4256, I send "4", "2", "5" and "6". This is 0x34 0x32 0x35 0x36 in hex so it is easy to dump the raw data and see what is going back and forth and I don't have to do any fancy escaping of the data. I'm just feeling my way along but it's working...
If your interested in all or any of my code I can post it or send it to you.
·· Thanks for the prompt reply. I've been investigating XBees and adapter boards like those
from Selmaware http://www.selmaware.com/appbee/index.htm·and/or
using·a logic level converter from Sparkfun http://www.sparkfun.com/commerce/product_info.php?products_id=8745
Are you using the 1mw XBees or the 63mw? There is a big difference in power consumption but I am leaning toward the 63mw versions...
- Ron
I needed to be able to plug XBees directly into a DB9S DEBUG connector on the Stamp, so I made my own adapter (attached) using a CD4049 as the level shifter. (The CD4049 has 5V tolerant inputs and provides signal inversion.)
Consider your application before you decide to go with the Pro. . Do you really need the extra range and power? The longest range comes with the 900MHz XB09 series. There is a page on antenna's and gain at www.digi.com/technology/rf-tips/2007/08.jsp and there is also Digi app note 10a on antennas and range.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I'm curious about that LT1521 you're using to power the XBee. The datasheet says it provides 300mA. An XBee Pro requires 215mA during transmit (again, per the datasheet). Do you worry about having enough "margin", as it were?
Similarly, you have Vin as 3.3-15 VDC. Does the .5V dropout mean that you really need at least 3.8VDC for Vin? And do you have to worry about heat dissipation when you get up to the higher voltages? I've been nervous about putting 9V into a TO-220 3.3V output regulator. Am I being too concerned?
Picking regulators has been a considerable issue for me.
The CD4049 is powered by the 3.3V supply, but can connect to 5V through the DB9?
===========
Kevin -
You were able to use the LadyAda XBee board with an XBee Pro? I've got one of those boards, but the extra tab down the bottom of the XBee Pro goes right where that capacitor and transistor at the bottom of the board stick up, so I wasn't able to mount it (regular XBees fit fine, like in the product photo). Did you do something special, or maybe they've changed the design of the board?
Thanks for insight and the schematic. I noticed that the AppBee adapters use a tristate 74LVC244A level shifter that handles 5v and 3.3v at the same time.
Your circuit is applying 3.3v to the CD4049 IC correct? I guess a basic stamp would recognize a 3.3v serial signal - doesn't need to be 5v?
74LVC244A
"Inputs can be driven from either 3.3V or 5V devices. In 3-State operation, outputs can handle 5V. These features allow the use of these devices as translators in a mixed 3.3V/5V environment."
The level shifter from sparkfun uses a BSS138 transistor and a voltage divider circuit. I already have one these but would have to order either of the other ICs.
I've browsed the www.digi.com site and sparkfun's offerings. It's amazing that one transceiver can range 40 miles (for a mere $185)!
I am going to experiment with my sparkfun level shifter, a BS2 and my oscilloscope to see what voltages I get and then decide whether to try the other circuits and which XBee models to order.
Do you know if the wire antennas give a better range than the chip antennas?
Thanks again
http://www.digi.com/support/kbase/kbaseresultdetl.jsp?id=2153
(click on the .pdf at the bottom)
Their conclusion is that when used indoors, the chip vs. whip makes no difference to range at all, but when used outdoors, it makes a BIG difference (in favor of the wire whip antenna). The wire antenna roughly doubles the outdoor range of a regular XBee, and does even better than that for the range of the XBee Pro (again, according to Digi).
·
Thanks for link - I was searching for XBee antenna comparison info this morning and had no luck.
I just ordered two XBee Pros, the USB adapter board and 2 of the other adapter boards. Looks like a bit of a learning curve...
Fun city!
Here are index pages for Digi's white papers and application notes. Kind of scattered.
http://www.digi.com/learningcenter/literature/whitepapers.jsp
http://www.digi.com/technology/wireless/whitepapers.jsp
Here is a direct link to a white paper on maximizing range
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
The LT1521-3 has just enough oomph to run an XBee pro, and the SOT223 package soldered to a good pcb area can handle the power dropped from a 5 volt supply down to 3.0 volts. The hard current limit is typically 400 mA. A main reason I use the LT1521 is for its low quiescent current, 12µA when the XBee is asleep. I'm fanatic about counting microamps for long term deployments!
Earlier XBee data sheets warned that the quiescent current at 3.3V was substantially greater than at 3.0 volts, but they dropped that warning from the most recent data sheet--Need to verify. For a standard XBee, with its peak current of 50 mA, the allowable supply range to the regulator is wider. XBees run on Vdd from 2.8 to 3.4 volts.
Another regulator I've used with these is the LT1129-3.3, also in the SOT223 package, rated at 700mA peak and 50 µA quiescent current.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 2/8/2010 9:03:27 PM GMT
· I'm not sure what the implications are for quiescent current values.· I ordered these· 3.3v voltage regulators from Parallax.
I assume they will work fine with the XBee but I wonder if they should be fed from the main source or piggybacked onto the regulated 5V VDD from a basic stamp board?
http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/LM2937.pdf
The LM2937-2.5 and LM2937-3.3 are positive voltage regulators capable of supplying up to 500 mA of load current.
Both regulators are ideal for converting a common 5V logic supply, or higher input supply voltage, to the lower 2.5V and
3.3V supplies to power VLSI ASIC’s and microcontrollers. Special circuitry has been incorporated to minimize the quiescent
current to typically only 10 mA with a full 500 mA load current when the input to output voltage differential is greater than 5V.
Thanks for your help!
Best Regards,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Check out the new Savage Circuits TV!
·
Tracy - on the rocketry project all of my XBees are 2.4GHz Series one XBee Pros with the wire antenna. As I mentioned elsewhere, I'm getting perfectly good data from one mounted inside a cardboard tube doing 450 MPH 3000 feet over my head.
In the not-too-distant future I intend to try transmitting from the ground to an XBee in that situation (well, after it has slowed down considerably). It'll be interesting to see if it works in that direction as well.
Ron - this should flatten out the learning curve quite a bit:
http://selmaware.com/appbee/AppBee_Doc.PDF
(Martin Hebel's excellent introduction to the XBee)
It's funny that you sent the AppBee doc link to me since I ordered 2 of the SIP boards earlier this afternoon.
My only issue is that the SIP boards have connecting pins for a PropPlug and the MOD board uses the USB2SER adapter (I have two USB2SERs - no PropPlug)
I will use the USB XBee Adapter for setting up the XBee and them move them to the AppBee board.
I wish I had known Parallax was coming out with a level shifting adapter - I would have waited!!
- Ron
I bought some CD4050 (non-inverting) CMOS buffers per your recommendation·for level shifting between the Basic Stamp and the XBee.
I hooked one up to a BS2 and my oscilloscope and used serout commands to check out the voltages.
It works great and should make it simple to use with the XBee digital and analog I/O pins.
Thanks for the suggestion!
- Ron
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I am actually using the AppBee adapter boards for the RS232 signals but wanted to be able to utilize the analog/digital pins which the AppBee doesn't condition.
I am using the ATDB command to·display the received signal strength on an LCD but haven't really tested the actual range yet. I doubt that·they will actually work a mile apart but we'll see...
Thanks for putting me out of business Parallax.... So does this mean I don't have to spend my nights soldering anymore? Guess it's time for a clearance sale - Yay!
-Martin
SelmaWare Solutions
OK, it's been almost three weeks and my money is burning a hole in my pocket? Will they be ready soon?
In another location, I have the same setup, but in an almond orchard. Here, the branches from the trees are just under the 30' height where the Xbee Pros are mounted on the poles. This means the Fresnel curve is not appreciated fully. But, there is line of site from the "base" station to 2 different "remote" stations, each about 0.8 mile away in opposite directions from the base. One of the 2 sites has great packet delivery/reception characteristics, while the other can't communicate with the base at all. It just goes to show that there's a lot of trial and error to finding what works and what doesn't.
I load up my XBdata0-3 values and a XBRecType variable and send it with this subroutine. The Frame numbers go from 97-122.
XBeeTxData:
'XBAPI = 1 ' This is a transmit packet
DEBUG "Data Packet to Xmit: ", DEC XBPacket, CR
XBFrame = XBFrame + 1
IF XBFrame > 122 THEN
XBFrame=97
ENDIF
' Keep our values above values we might have to escape, and encode them in
' something meaningful along the way
XBData3 = 48 + ( XBPacket DIG 3)
XBData2 = 48 + ( XBPacket DIG 2)
XBData1 = 48 + ( XBPacket DIG 1)
XBData0 = 48 + ( XBPacket DIG 0)
' Calculate the checksum, this will overflow a byte, but, hey, that's what I want
XBCheckSum = XBAPITx + XBFrame + XBDestLow + XBDestHigh + XBRecType+ XBData3 + XBData2 + XBData1 + XBData0
XBCheckSum = 255 - XBCheckSum
DEBUG "Packet Type(", IHEX2 XBAPITx, ")", CR
DEBUG "Frame Counter: ", DEC XBFrame, CR
DEBUG "Packet Destination: (", IHEX2 XBDestLow, "), (", IHEX2 XBDestHigh, ")",CR
DEBUG "Options: ", IHEX2 XBOptions, CR
DEBUG "Record Type: (", XBRecType, ")",CR
DEBUG "Data: (", XBData3, "), (", XBData2, "), (", XBData1,"), (", XBData0,")",CR
DEBUG "Checksum: ", DEC XBCheckSum, CR
DEBUG "Dump: ", IHEX 126, IHEX 0,IHEX 13, IHEX XBAPITx,IHEX XBFrame,IHEX XBDestLow,IHEX XBDestHigh,IHEX XBRecType,IHEX XBData3,IHEX XBData2,IHEX XBData1,IHEX XBData0,IHEX XBCheckSum,CR
SEROUT XBTxPin, XBBaud, [noparse][[/noparse]126,0,10,XBAPITx,XBFrame,XBDestLow,XBDestHigh,XBOptions,XBRecType,XBData3,XBData2,XBData1,XBData0,XBCheckSum]
'SEROUT XBTxPin, XBBaud, [noparse][[/noparse]126,0,10,1,125,51,170,170,0,1,1,2,3,4,140]
' TX Good Status packet should look like: 126,0,3,137,XBFrame,0,34
SERIN XBRxPin, XBBaud,3000,main2, [noparse][[/noparse]WAIT(126),SKIP 2,WAIT(137),XBData0,XBResult, SKIP 1]
DEBUG "Packet:", DEC XBData0, ", Tx Result: ", IHEX XBResult,CR
RETURN