quantity of sensors and comunications protocoles

Hi

I would like to as if I can conect:

a) 4 analog triaxial accelerometers (it means 12 analog channels) or
b) 4 digital triaxial accelerometers with I2C protocol or
c) 4 digital triaxial accelerometers with SPI protocol

to the arduino due. (if not 4, how many is the maximum?)

Is the arduino due fast enough for getting information from case a) with should be sampled at 20 KHz for FFT analysis on matlab?

thanks

Maximum of 12 analog inputs.
Maximum of 54 digital pins.

An analog sensor is more expensive, but the code is easier.
But once you start using digital interface, you don't want to go back to analog.
Why do you want to read accelerometers at 20kHz ? Do you know accelerometers that can handle that ?
What about frequency linearity ? Are there accelerometers that handle all motion frequencies the same ?

Most sensors are I2C. But the Arduino I2C is only 100kHz. The SPI is faster.
20kHz = 50 us. I think that the Arduino Due could be able to handle that, perhaps it can also do the FFT.
If you would use the Raspberry Pi, it can also do the FFT.

How will you get the data to matlab ? Via serial ? At what baudrate ?
Suppose 115200 baudrate. 12 * 2byte = 24 byte. That is 2ms per 24 byte. That is not fast enough.

Are you sure you only want to use accelerometers ? For stability you might want to add gyro sensors.

Please tell us what your project is. Perhaps there are other and better ways to get your results.

Erdin

Hi again, thanks for answering.

Let me introduce myself, I´m chilean acoustic engineer and I´m studing for my master degree in the Santa Catarina Federal University in Brazil, i shoud create a device that give you the velocity spectrum from a machine, and others thing from that. Well, my project belongs to predictive maintenance, or Conditioned Based Monitoring, basicly it can tell you what its wrong in a rotating machine such like a pump or fun, analysing its vibration spectrum from acceleration or velocity, thats why we use accelerometers, tipically piezo electric, in my project we want to test the results using mems accelerometers, they are extremely cheaper in comparison with piezo ones.
Failures spectrum are tipically up to 10 KHz, but for that frequency we should need to work with 20KHz for avoiding aliasing (as probably you know).
There are mems accelerometer that work up to 32 KHz just like ADXL001 from Analog Device.
For the most complete of situations it should been use 4 triaxial accelerometers (or 12 uniaxial), two for the driver or motor and two for the driven machine, that will let me get the phase between different point of meassure and its axis. Unfortunatly, for the information I have right now, it could only be possible with analog ones, since digital protocols can´t handle long distance for signal transmition just like 1 or 2 meters away (information from analog device engineers).
I haven´t yet analyse how will be the comunication with matlab, i just know from some tutorial that its possible...I wanted to ask that later, but you were faster than me!!.
One last thing, by this moment my project is starting, and we haven´t decide if we´ll use digital or analog, clearly digital would reduce my work. Let me ask again just for been sure please, when you say "Maximum of 54 digital pins" you mean that I can conect 54 digital accelerometers, each one triaxial (or in the extrem I could have information from 162 axis)? and, on each digital pins could be conected I2C or SPI devices?

Thanks again for answering.

Thank you for explaining.
For such measurements I would think of analog sensors and a dedicated recording and analysis device.
I must say I was pleasantly surprised that the datasheet of the ADXL001 is showing a frequency response on the first page.

I2C and SPI are like a 'bus'. I2C uses only two dedicated wires for all sensors, and SPI uses a 2 or 3 plus one for each sensor.
I2C is too slow and combining the same sensors (with same bus addresses) is a problem. The wires can be a few meters.
SPI could work, but a fast SPI can normally be over wires of 1 or 2 meters. So the information you got is right.

Since the ADCL001 is analog, you could use a shielded cable and use the analog signal.
The Arduino Due operates at 3.3V (also the ADXL001) and has 12-bit analog inputs.
You should be able to get accurate recordings and perhaps the Due can do some FFT (but I'm not sure if it is fast enough for FFT on 4 channels).
I don't know how to get that amount of data to matlab.

So perhaps you can't use the Arduino Due, and you might need a multi-channel analog input card for your PC.

Since I'm a fan of Arduino, I have an idea: Use a central unit with 4 wireless modules. Each module is a Arduino Due with a single sensor that calculates the FFT and transmits it to the central unit. That way you have your FFT data, but combining the samples (at the exact same time) from different sensors is no longer possible.

Wow, it seems that my project is going analog...

just another question, by now i´m thinking in doing the FFT in matlab, not in arduino, arduino is going to be use as an ACD, and sending the signals to the pc, for that matter I need 12 analog channels(4 accel but each one triaxial), sampling with a sampling rate of 20 KHz, do you think its possible?, or at least do you think I should try a lower frequency band and fewers channels, because that is my ideal, but there´s a lot of thing that could be done with for example 2 accels...

I should prototipe with low cost equipment..is one of the objetives of my work.
thanks again

With a serial connection (the 'virtual' serial port of the Arduino via the usb) at 115200 baud, even a single channel can't be sent.
However, the native SerialUSB port of the Arduino Due seems to be a lot faster.
See this topic, Arduino Forum
That could be fast enough for all 4 sensors, but it seems that you have to sent a number of samples at the same time. If I interpreted it right, it will work if you sent 100 collected samples of all 4 sensors at a time. The Due has 96 KBytes of SRAM, so that is no problem.

I don't have a Due myself, but this seems to be the only way that it could work. You could buy a Arduino Due and run a test on it.

I don't know how to make the serial data available for matlab on the PC. Sorry, I have no experience with that.

Hi

I'm going to be working on some frequency analysis on the Due over the next few months specifically for predicting machinery failures before they occur. This is practically identical to what you're proposing with the following differences:

  1. I will be doing the FFT 'real time' (as fast as I can get the data and process it) on the Due

  2. I'm was only planning on using piezo sensors for this, I only want to catch the start of failure and shut down the equipment. I didn't realize I could sample an accelerometer that fast

The FFT (and a whole lot of useful math libraries) libraries are already included in the Arduino 1.5.2 IDE, the setup is avaliable here Arduino Forum

I will share anything I develop/find in terms of the data capture, I don't think the FFT side will be any use to you. This looks like a very interesting project.

Regards

Andrew