I may be starting a project where I will need to talk to at least 8 sensors, have them synced, and accessed at a fairly high rate.
First the sensors, what I am looking at is a 9-dof board, like this from Sparkfun (https://www.sparkfun.com/products/10724). At this time, I do not know if an accelerometers will detect what I need to, but I am thinking it plus the gyro will allow for some sort of analysis to reduce false positives / negatives. The magnetometer is going to be used in certain locations, hence why I do not just use a 6-dof board.
Second, per my understanding, SPI connection will allow for speed and time syncing of the sensors. If I understand it correctly, with SPI, there are two pins that all the sensors will share (related to the clock), then two wires from the sensors plug into digital pins. My question, is say, using a Mega or Due, are all digital pins allowed for data from sensors in SPI?
Third, I cannot say how fast 'high rate' is. I want to be at least an order of magnitude faster than what we will be measuring (can't say what it is yet, but figure it is over in 0.05 seconds). What I need to do is query each sensor, probably do some math with the response, compare response to a threshold to determine whether they were triggered or not, then, which order they were triggered in. I may be able to post-process the data, which may be the best way to do this. My concern is that the program being sequential, if I am reading sensor 1, sensor 8 could trip, and I would never know. This is where the questions really start flowing:
How fast could I read all 8 sensors with a Due? If 50 ms is as fast as the activity happens, could I read all 8 sensors in 5 ms or less?
Is there a way to parallel scan the sensors? I have been reading about some real-time software packages that are supposed to allow this for the Arduino, but I am not sure that would get what is needed. I have a fair bit of experience with Labview, and while it is annoying sometime, everything is parallel, or seems that way. With Labview, I could probably do this, but I do not want to be coupled to that if I do not have to be.
A backup plan of sorts is to put a small Arduino or simply the processor with each sensor and have it scan the sensor, determine if it has breached the threshold, then send a digital signal to a master. The master then would make the determination of what happened first. I am not sure this reduces the load, and the only way I could see this help is to use interrupts, but I am not sure that would work, as it seems there are only a handful of interrupts available.
The good thing is that I am not looking for the values to be a specific value. We need to test in the near future as to what the threshold should be to tell something truly did or did not happen (which I realize contradicts the previous sentence).
I am thinking that post-processing the data may be my best bet. In this scenario, I will need to read the sensor, store it in memory, then access it later to determine what happened when. I am also thinking this would reduce the cycle time when scanning the sensors. What I can't find is at what frequency / time can I get the data. I have read SPI can go to 400kHz, but it is not clear if this is no matter the number of sensors, or is like USB, and many other data acquisition systems, where one is 400k, two is 200k, 3 is 133k, etc.
Thank you for any help or suggestions you can give.