I am doing research on human-induced vibrationand I am currently trying to design a sensor mat which has 2000 sensors to capture dynamic load of people when they are walking on that mat.

each sensor needs to be read with 200 Hz speed. As 3200 analog input is not possible! we decided to scan the sensors with high speed (like video cameras) to read the sensor outputs with lesser analog input channels.

here is the plan: 4 mat each contains 800 sensors. A matrix of sensors with 16 columns and 50 rows. we want to use Arduino mega 2560 to get the data and transfer it to a PC. I have written the below code to scan the sensors but Arduino seems very slow..

how the program works:At each time increment, one digital output (50 digital pin) releases the power to its corresponding row of sensors (16 sensors) each of which connected to an analog input. so we use 50 digital output and 16 analog input to scan sensors.

My question: Is there any way to increase the speed?we need to read 800 sensors * 200 Hz * each outtput is 4 digits * each digit 2 bytes = 10.24 Mbits/second

If Arduino is not capable of doing that, Do you have any suggestions which hardware I can use?

Much regards,Erfan

/* TEST 06

This program scans the matrix of sensors to get data.

Assumptions: - A matrix of sensors consist of 800 sensors arranged in the form of 16 columns (Analog inputs) and 50 rows (Digital outputs) - 50 Digital output to supply +5 volts power for each row of sensors - 16 Analog inouts to read the output of sensors - At each time increment, one digital output releases the power to its corresponding row of sensors (16 sensors) each of which connected to an analog input. So at each time increment each analog input read a number. - Sensor numbering: S(Row - digital output)(column - analog input) : S2006 means the sensor which is connected to digital pin 20 and analog pin 06. - "i" index represents rows and "j" index represents columns

Connect one end of FSR to power (+5V in this case), the other end to Analog 0. Then connect one end of a 10K resistor from Analog 0 to ground

All your loops are generally slow. So are Arduino's builtin DigitalWrite. You may want to consider direct port manipulation.I achieved 10 times faster read speeds using that.http://www.arduino.cc/en/Reference/PortManipulationhttp://www.arduino.cc/playground/Learning/PortManipulation

DDRA = B11111111; DDR= Data Direction, Port A, 1 = OutputYou'd have to do it for the 6-8 ports on the arduino (still much less than the 50 you are doing now)

Setting the pins highPORTA = B11111111; 1=High, 0=low

Also, I'm guessing that doing port manipulation on the analog read will also increase speed, however I'm not sure how it's done.