Xbee s1 communication trouble with accelerometer

Hi

I am trying to get an xbee s1 connected to an explorer regulated board wired to an adxl 335 accelerometer to send data to another xbee s1 on an explorer usb connected to m pc.

I am pretty confident i have the correct baud rate (9600 for both) and have configured each xbee correctly, i think there is a connection between the xbees because the little light on the explorer usb flashes away, however in the xctu terminal window i am getting something that looks like this …Vx3…o’ etc.

Safe to say this is not what i was hoping for, how can i go about getting actual numbers to appear on my terminal window.

Any help would be greatly appreciated, i am definately a rookie at all his!

My guess is that you are having the ADXL335 outputs going to the ADC inputs of the remote XBee. Then sampling and sending the data to the ‘base’ XBee.

Download and read the XBee OEM document (#90000982) on how the XBee outputs the data from remote units. This is covered in the “ADC and Digital I/O Line Support” section. The data is not really ‘human’ readable since is bundled together (packed DIO and ADC values) so you will not get a number for each ADXL335 axis with writing some code to receive and ‘unpack’ the XBee output. The Python language is good for this.

I recommend start with X-CTU’s terminal and enable the ‘hex’ view. Hex (binary) is easier to unpack.

ok thanks for the help; when looking at the hex view, the values do not change when shaking the accelrometer, i found the code below to unpack the data using the arduino language, does this work do you think? it gives me numbers for x y and z but they dont change either? does this mean the xbees are not sending data correctly?

void setup()

{

Serial.begin(9600); // opens serial port, sets data rate to 9600 bps

}

/**************************************************************************************

Function : loop()

Description : Loops consecutively, allowing your program to change and respond.

Use it to actively control the Arduino board.

***************************************************************************************/

void loop()

{

x = analogRead(0); // read the 0th analog input pin

y = analogRead(1); // read the first analog input pin

z = analogRead(2); // read the second analog input pin

Serial.print("X = "); // print x adc value

Serial.println(x);

Serial.print("Y = "); // print y adc value

Serial.println(y);

Serial.print("Z = "); // print z adc value

Serial.println(z);

delay(100);

}

again thank you so much for the help, me and my project partner really do need it!

Does the ADXL335 output Voltages change when rotating the accelerometer and using a Voltmeter (DVM)? Try the Z-axis with the ADXL335 flat on a table (Z-axis is vertical).

This accelerometer has a full scale of ±3g so the Earths gravity will deflect the output to 1/6 of its full scale. By turn the accelerometer over that vertical axis will change output by 1/3 FS.

If power with 3.3V, the output is 330mV/g with a 1.65V output = 0g. So on the Z-axis you should measure either 1.32V or 1.98V. If you get the proper Voltage then do the same experiment using the XBee’s ADC.

Shaking the accelerometer may not give you a clear change due to filtering in the ADXL335 chip and the ADC sampling rate. Rotating the accelerometer on each axis is a better test and you then have Gravity as a constant to check that you get the correct values.