I recently bought TI’s Chronos eZ430 – 433 MHz development kit. Basically, it is a watch with a bunch of sensors and a controller that can be programmed wirelessly over the 433 MHz ISM band.

Yes – I know it is bulky and has a huge ‘Texas Instruments’ logo on it. But, as long as you don’t mind it – or better – are proud of it…you are good to go! You also get an RF access point, a USB debugger and a screwdriver (just in case you want to dismantle your watch and have a look inside).
I was wondering what I can do with it – it has a temperature sensor, a pressure sensor and an accelerometer. I decided to get some accelerometer data out. I would like to share my MATLAB code for the same.
As for the driver installation for the access point, it is a trivial affair and the process can be found online. Please note – this MATLAB script simply takes the accelerometer data out and plots it. Run this script from the command window of MATLAB. It has display messages which will guide you. The main purpose of this code was to be able to take the data out from Chronos using the following process:
Open COM port -> Start Access point -> Start reading accelerometer data -> Wait for, say, 1000 samples to be received -> Stop reading accelerometer data -> Stop Access point -> Close COM port.
clear all
close all
clc
global startAP stopAP getaccAP mydata
startAP = [255 07 03]; % FF 07 03
stopAP = [255 09 03]; % FF 09 03
getaccAP = [255 08 07 00 00 00 00]; % FF 08 07 00 00 00 00
mydata = 'uint8';
s = serial('COM48'); % your COM port might be different - plug it in here
s.BaudRate = 115200; % the AP communicates with this baud - don't change!
fopen(s);
if strcmp(s.Status,'open') == 1
 disp1 = 'Starting Access Point.......';
 disp(disp1);
 pause(1);
 fwrite(s,startAP,mydata)
 fread(s,3,mydata);
 disp1 = 'You should start the accelerometer transmission from the watch now....';
 disp(disp1);
 pause(1);
 disp1 = '...............';
 disp(disp1);
 pause(1);
 disp1 = '.......';
 disp(disp1);
 pause(1);
 disp1 = '...';
 disp(disp1);
 pause(1);
 disp1 = 'Logging starts now!';
 disp(disp1);
 pause(1);
 k = 1;
 for i = 1:999
 fwrite(s,getaccAP,mydata);

 for f = 1:2000
     for g = 1:1000
     end
 end

 temp = fread(s,7,mydata);
 if temp(4) == 1
 data(:,k) = temp;
 k = k + 1;
 end

 for fg = 1:2000
     for g = 1:1000
     end
 end
 end

 fwrite(s,stopAP,mydata)
 fread(s,3,mydata);

 for i=1:1000
     for j= 1:2000
     end
 end

 fclose(s);
 forplot = 1:size(data,2);
end

% The data variable is a 7 by 1000 array - in every column the last three entries are accelerations in X, Y and Z directions

Happy hacking with your Chronos!

Advertisements