Wednesday, September 21, 2011

Realtime visualization for Xbee+Accelerometer data

Here is the long awaited follow-up to the Xbee experiments that my little brother outsourced to me.

Before I get to the description of the software itself, if you want to try this out, be sure to follow the guidelines in the previous post on the same topic. You are then ready to proceed.

And here is what you get with this software :
  • Realtime visualization of all three axis
  • Can be adapted to many different accelerometers by tuning some global variables
  • Recording of samples to file, with timestamps and X, Y and Z values
  • Automatically generated plots for each axis and a combined 3-axis plot
  • Exported files named according to experiment date and time (for easier sorting)
  • All the above, in pure opensource python goodness
  • English and French localization
  • Theoretically works from within a LiveCD

Now let me briefly describe what the software does. As you can see in the screenshot on the side, the user interface is quite easy to understand. The three rectangle-shaped black boxes are showing whatever comes from the Xbee chip hooked up to the USB port, in realtime.

There are also three clickable buttons. The leftmost button labelled 'start' triggers the beginning of the recording. You will usually push this just before your experiment. The middle button named 'stop' obviously halts the recording. It also takes care of dumping all the samples into a CSV and generating the four plots : a combined plot with all 3 axis and three separate plots, one per axis. Of course the last button closes the USB port and quits the program. Beware that it does not check if you have a running experiment and will hence lose some data unless you push the stop button first.

Enough talking now, here is the python archive, all you have to do is extract the contents somewhere and run the software by launching the xviz.py script file.

I also uploaded this to the github social coding site, feel free to fork this, submit patches or whatever !

https://github.com/jean-/xviz

1 comment:

niz said...

hello.i already compile the xviz.py using python shell but it show
Traceback (most recent call last):
File "C:\Users\farid\Downloads\Compressed\xviz\xviz\xviz.py", line 3, in
import wx
ImportError: No module named wx