Fast analog polling

I am looking to use a force sensitive resistor to track a quick impact. Basically, I want to see what happens during the impact event so as to be able to generate a graph of force over time.

I’ve tried using an Arduino Uno for this, with a very simple set up - the FSR and a resistor to create a voltage divider circuit, and a short sketch to poll the data and feed it out via serial. Here’s the code:

int timeBase;

void setup() {
  Serial.begin(57600);
  timeBase = micros();
}

void loop() {
  int sensorValue = analogRead(A0);
  if (sensorValue < 1005) //prevent sending data when no pressure is applied
  {
    Serial.print(micros()-timeBase);
    Serial.print(",");
    Serial.println(sensorValue, DEC);
  }

The problem is, the Arduino isn’t polling fast enough. During a typical strike, I’m only getting one or two data points. So I need to be able to poll faster.

So, the questions are:

  1. Is there a way to increase the polling speed on the Arduino?
  2. Is there some (reasonably cheap) external component that can do it faster and feed the data back to the arduino?
  3. Would upgrading to a Due board with its higher clock speed help?
  4. Is this something beyond the ability of an Arduino and requires a significantly faster device (Raspberry Pi or whatever)?

Thanks.

Hi jgalak

the Arduino isn't polling fast enough.

How fast is it polling? How fast do you need to poll?

This may be of interest: http://forum.arduino.cc/index.php?topic=228549.0

Regards

Ray

Don't do serial writes while polling. save the data in an array and spit it out after the event.

I agree 100% with @KeithRB.

You should also be aware that the Arduino ADC is relatively slow. The maximum sample rate with full 10 bit accuracy resolution is about 15,000 samples per second and the max, at lower resolution is about 76,000 sps. The normal Arduino analogRead() is at full resolution, but I don't think it is capable of 15ksps. You will need to study the Atmega328 datasheet.

...R

The ATmega328 documentation is overly conservative. Several people have shown that you can free-run the ADC in the ATmega328 at much higher than the recommended clock speeds, with sample times on the order of 20 microseconds at 1 MHz. However, accuracy is said to suffer. You would need to determine if the accuracy meets your needs, to so try it yourself. Here is an introduction: http://www.microsmart.co.za/technical/2014/03/01/advanced-arduino-adc/

According to the following tests, it appears that you get about 8 bit accuracy at 1 MHz, but the clock rate can go as high as 4 MHz. http://www.openmusiclabs.com/learning/digital/atmega-adc/