MATLAB Answers

How can I connect Matlab to Accelerometers?

2 views (last 30 days)
I would like to use my Matlab to read the outputs of accelerometers. Are there products available that would allow me to use my usb port along with a function command like wavread?


Star Strider
Star Strider on 15 Sep 2012
Unless your accelerometers have already saved the data they collected as .wav files, wavread won't work.
I have only used usb ports with a pulse-oximeter, configuring the usb port as a serial port object in core MATLAB. (I do not have the Instrument Control Toolbox.)
On a Windows 7 system, I plugged the device into the usb port, and had Windows find and install the driver for it. After that (and finding the online documentation for the usb interface the pulse oximeter used so I could configure MATLAB properly to communicate with it), it worked well. (It provided 4 channels of data. It took some experimenting to discover the data format, and then programming to edit and reshape the matrix every time I wanted to use the pulse oximeter. I could not analyse and display its data it in real time.)
After you've done all this with your accelerometers, it should be relatively easy to get data from them.
In any event, I suggest you do both MEX and online searches to see what others have done with MATLAB and your accelerometers. There might already be robust and reliable MATLAB code for them.
David Koenig
David Koenig on 16 Sep 2012
Thanks Star Strider, I was hoping to decide on what accelerometer to purchase based on answers obtained here._
Star Strider
Star Strider on 16 Sep 2012
If I'd known that, I'd have suggested Acquire Data From an Accelerometer in the Data Acquisition Toolbox examples. ‘This example uses a ceramic shear accelerometer model 352C22 from PCB Piezotronics is used with 9.22 mV per Gravity.’ (The example and interface boards are listed as being current with respect to 2012b but likely also applies to more recent previous releases.)

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 Sep 2012
No, with usb connected instruments you connect via serial(), transfer chunks of data, and then need to interpret the data.
Are you using something like a Mindstorm device?


Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!