How To Make XBee ZNet 2.5 Wireless Accelerometer


I managed to put together a wireless accelerometer the other night using my two new XBees, an Arduino XBee shield, an XBee Explorer USB, an ADXL330, and some Python. I struggled a bit with some of it, so here's what I learned:

First, a parts list.
  1. XBee 2mW Series 2.5 Chip Antenna
  2. Arduino XBee (with XBee Series 2.5 module)
  3. XBee Explorer USB
  4. ADXL330

I'm not sure exactly what the specs are on the XBee that comes with the Arduino shield. But, it is definitely a series 2.5.

The first thing to do is to configure and upgrade the firmware on your XBees. To do that, you'll need X-CTU (for the firmware upgrade at least, but it's also nice for configuration) which, unfortunately, is only available for Windows. But, it works fine from VMware. First up, the XBee we'll hook up to the computer to read incoming data from the accelerometer:
  • Plug one of the XBees into the Explorer (it's also possible to do this from the Arduino shield by shifting the two XBee/USB jumpers to USB and removing the MCU) and plug it into your USB port.
  • Crank up X-CTU, select the appropriate USB communications port (com port), click "Modem Configuration" and then "Read." This will determine what XBee is connected and what firmware is on the device.
  • Select "Always update firmware."
  • Click "Download new versions..."
  • Select the latest version of ZNet 2.5 Router/End Device API. The API version is necessary in order to read the incoming data on the computer. Only API firmware will write incoming sensor data to the device's UART so it can be read over USB/serial.
  • Click "Write." You may get an error after the writing is complete. That's normal. It's because you've changed the way the XBee communicates over it's UART. Go back to the "PC Settings" tab, select "Enable API" and then click "Read" on the "Modem Configuration" tab again.
  • Under "Networking," change NI (Node Identifer) to something like "ARDUINO". I named mine Arduino because I used the Arduino and XBee shield to provide a USB connection to the computer.
  • Click "Write" and hook it up to your computer. This is the XBee that your accelerometer will be sending data to. We'll hack up some Python to read that data later.
Circuit Diagram:


Next up is the XBee we'll hook to the accelerometer:
  • Follow the same steps as before until you reach the firmware selection.
  • Select the latest version of ZNet 2.5 Router/End Device AT.
  • Under "Networking," change NI (Node Identifer) to something like "ACCELEROMETER".
  • Under "I/O Settings," change D0-D2 to 2-ADC. These pins will be used to read from the accelerometer.
  • Again under "I/O Settings," change IR (sample rate) to 1F4 (hex for 500 milliseconds).
  • Click "Write."
  • Go to the "Termainal" tab. To enter command mode on the XBee, send it "+++" (do not press enter). It will respond with "OK". Next type "ATDNARDUINO" (or whatever you called your other XBee). That will set the destination node to your other XBee. It should respond with "OK". Next, send it "ATWR". That will write the settings to memory so that they aren't lost when the XBee is powered off.

      +++OK
      ATDNARDUINO
      OK
      ATWR
      OK
  • Finally, hook up your XBee and ADXL330. You can power both with 3.3V (3V works too). Unfortunately, the XBee 2.5 series ADCs only accept voltages in the range of 0-1.2V. To get better results, you'll need to add voltage dividers on the X, Y, and Z axes. I don't have those in the schematic. If you use 3V, it works well enough to detect motion. For finer mesurements, you'll need the dividers.


How To Make XBee ZNet 2.5 Wireless Accelerometer (Source Code)
0 Comments
Disqus
Fb Comments
Comments :

0 comments:

Post a Comment