SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By Fraserjim
#198119
I am trying to measure the force of the impact of an object dropped on a force sensitive resistor https://www.sparkfun.com/products/9376

I used an ardunio uno and the code provided on this site. https://learn.sparkfun.com/tutorials/fo ... ino-sketch

I modified the sketch to sample (loop) once every 2 milliseconds and to store the maximum force measured. When I cranked it down to once every 1 millisecond, the maximum results became flaky.

We accurately measured the height of release of the object to attempt to be consistent.

Results are all over the place.

So, is a 2millisecond sampling rate to slow to accurately capture an instantaneous impact?

Any suggestions on how to make this work?

Thank you.

Fraser Jim
User avatar
By phalanx
#198122
Without access to the system, no one can say whether or not a 500Hz sampling rate is adequate. To know for certain, you should look at the output of your resistor using an oscilloscope to capture an impact so you can measure the actual duration of the event and set your sampling rate accordingly.

-Bill
By Fraserjim
#198123
Thanks Bill

Great idea.

Any idea how fast the Arduino can be set to?

Can you set the delay below 1 or are their other ways?

FJ
User avatar
By DanV
#198124
The Arduino reference for analogread() function says
"It takes about 100 microseconds (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second"

Instead of delay() function use delaymicroseconds() function.

of course, using serialprintln() can slow the entire thing down, so you may want to only print the captured max when not sampling the force sensor.
By lyndon
#198128
1) Remove all delays from your code
2) Put a photo sensor just above the impact point
3) Sample the photo sensor
4) When it triggers, start sampling the analog input at full speed and save data
5) Replay the data and see how it looks.

If it still looks "all over the place" then you need to stop using analogRead() which is very slow and instead use the raw A/D registers that will let you read at 10s of kHz.
By jremington
#198138
FSRs are a poor choice to measure anything, as they are uncalibrated and highly nonlinear. Add to that the long time it takes the Arduino to measure a voltage and you can't expect much.

High-g accelerometers were designed to do what you want. They were originally designed for impact measurement, in order to deploy air bags in vehicle crashes.