I needed some Zigbee repeaters and decided to get some Xbees. I ended up with a set of repeaters and the capability to add sensors to them for a reasonable price. Since finding the right case and drilling it was such a task, I thought it would be nice to share my findings. Pictures at the end.
First, the parts:
- XK3-Z8S-WZM. XBee3 Module Dev Kit, 2.4 Ghz ZB 3.0 by DIGI for $99 (I got mine at Mouser). This kit is a great bargain, as it includes three each of:
- XB3-24Z8US-J. Zigbee Modules (802.15.4) XBee3,2.4 Ghz ZB 3.0, U.FL Ant, SMT. $20.06 each.
- A24-HABUF-P5I. 2.4GHz Half-wave antenna. $5.50 each.
-
- XBee SMT Grove Development Board. $31.00 each.
This is the hidden gem here, as it has Grove connectors for I2C, digital, and analog inputs. Look at https://www.digikey.com/eewiki/display/Wireless/Home under the Digi section (XBee3 projects) and Seeed Studio Grove System Information for some of the things you can do with the board.
- XBee SMT Grove Development Board. $31.00 each.
- USB cable
- Zulkit Project Boxes ABS Plastic Electrical Project Case Power Junction Box Black 3.62 x 2.28 x 0.91 inch. $8.99 for five boxes. The assembled XBee3 fits so snugly in this box that you won't need screws.
- Scrounged some USB wall power adapters to power the Xbees.
- Total cost: $107.99 plus tax and shipping.
Next, the assembly:
I assembled the XBee3 module to the Development Board according to instructions. It's quite simple, and I found this SMT board was easier to insert than the old-fashioned through hole boards were. I moved the jumper on the three-pin header from the inner and middle pin ("loopback") to the outer and middle pin for normal operation.
I then drilled holes in the box for the USB cable and the antenna. Here's where I got into difficulties with the antenna. For the USB cable, I drilled a 3/8" hole in one of the short sides of the box, 25mm from the left outside edge, and 8.85mm from the top of the box (the lid was not on). Then I had to extend the hole left and right using a round file to accommodate the width of the USB connector (periodically test fit the Grove Board to check). I drilled a 7/16" hole in the opposing short side near one or the other edges—a 1/2" drill was too big, as the antenna wouldn't stay in. I assembled the antennas (putting the snap-in section on the bottom of the antenna). Then I tried to press-fit the antenna and it simply didn't go. My aged eyes had missed two things: 1) there are two little ridges running down part of the connector that probably is for anti-twist and meant to go into little slots extending from the hole, 2) the clips that provided for the snap-fit wouldn't flatten completely.
I took care of the ridges by filing them down with a small flat file: that only took a couple of seconds. I added room for the clips by using a small flat file to provide some extra space corresponding to the locations of the clips, periodically testing to see if I filed enough. Perhaps a 15/32" drill bit would have made it so I wouldn't have to file the hole and ridges. I've now found a diagram with dimensions for the antenna after I finished the project.
For programming the XBee3, I generally followed the advice in the first post in Everything Xbee, but I did simplify some things.
- XCTU Software
- Standard software: choose either this or the temperature-monitoring version
- Micropython Code (60-second reporting)
- Install XBee Device driver for Hubitat
- Version that also monitors chip temperature (added this after I had one shut off when it became too hot in the garage)
- Micropython Code
- Install XBee Device driver for Hubitat. Also available in Hubitat Package Manager (search for Xbee3). Note that the Micropython Code always has to be downloaded and installed separately, as it doesn't run on the Hubitat.
Use XCTU to program the XBee3 and then load the Micropython code. I used the following settings. The linked post had you set ID
to the Hubitat's PAN ID. I didn't do that because I know I'd forget later when I got a new hub, and be left wondering why I couldn't pair the XBee3 to the new hub. XBee3 settings (every other setting but the following are left at their default value):
ZS 2
CR 0
JN Enabled(1)
NI PutSomethingUniqueHere
NO 3
TO 6
NH 30
AR 6
EE Enabled(1)
EO 1
KY 5a6967426565416c6c69616e63653039
NK 00
PS Enabled(1)
AP API Mode Without Escapes(1)
AO 1
And you're done! Make sure you put a unique name for each XBee3 in the NI field.
If you look real carefully at the left side of the connector just below the ring, you'll see that ridge that was causing me so much grief.