Storing measurement data at high? speed

Hello all,

Almost every topic I open here starts with 'I'm no to this and I have a question' and I'm afread this one is no less :). I'm not new to programming, I'm not really new to electronics but I am new to programming at such a low level. I have never thought about RAM or write speed issues so before I start with my project implementation, I'd like to ask a question on how I can best do this.

I have a displacement draw-wire sensor sending pulses to my Arduino which I'm going to read with interrupts using the encoder library:

FYI: The displacement measured is the uplift of the contact wire in railway from a pantograph passage.

I have calculated that the sensor will send me pulses at a maximum speed of 25 kHz. I need to log the displacement at least every 5ms if that's possible (if not then we can increase to 10 ms). I have a RTC available and an Arduino Mega with GSM and SD wireless shield. The idea is to start logging the moment the displacement changes with a certain speed (lets say at 2kHz pulses) for a period of about 25s. So every 5ms I would like to store the displacement value, an int containing 4 digits xxx,x mm (I'll leave out the comma and add it afterwards) in the range of [-200,0 +200,0] somewhere temporally.

The idea is to send the measurement afterwards to a database by GPRS (together with some temperature measurements).

So my question is: where can I store the temporary data fast enough and with sufficient capacity to capture all the displacements during 25s with a 5ms interval? (I hope your not going to laugh and say something like: you have sufficient time to stream it live by GPRS :-)).

Thanks in advance!

5000 samples? Add an external SPI interface SRAM chip. Or go with a bigger uC that has more RAM, like a 1284P with 16K SRAM.

Many thanks for the suggestion CrossRoads. I've done some research and that sounds like a perfect solution. No need for writing to the SD card that way.

Maybe a follow-up question. I suppose this chip would work?

Since the guy in this thread has figured out how to modify an existing library to get it to work with the chip:

Another resource:

I've been running to the hardware store each day lately. And what I thought was a simple project proves to be quite challenging too... But in the end, if you understand all the abbreviations then electronics are not that hard.. (I just ordered 2 IC's for another 'solution' of the format MSOP that I'll happily try to solder this evening...)

I believe that would work nicely.
Don't forget a 10K pullup on the CS pin to prevent any data corruption should the Arduino be reset after you've collected data and before you've had a chance to send it out.

I believe that would work nicely.
Don't forget a 10K pullup on the CS pin to prevent any data corruption should the Arduino be reset after you've collected data and before you've had a chance to send it out.

thanks for the tip!

Just checked your website, it's nice to know that I have been helped by a fellow fencer :slight_smile:

Here's my site from our fencing club:

Small world! Looks like a nice place.
We moved from one building into a slightly bigger building in December, but hadn’t redone the strip lines yet.
Wednesday night I spent 3 hours with one of my adult students putting tape on the floor, and about 5 hours yesterday trimming the overlapping tape lines, pressing all the tape edges down firmly, wiping all the to-be-painted areas with a tack cloth, and then painting for several hours. I was dead after that!
Going back tonight to check that everything dried nice, & take up all the tape - 11 rolls, 45 yards per roll, and we used almost but may 10 yards of it.
The floor has 2 coats of polyurethane on it, the wider tape is actually outdoor painters tape, it was the only thing we found that stuck well to the polyurethane. The stripes are Rustoleum paint, it is oil based like the polyurethane and sticks well and holds up well also.

That looks like one hell of a job for 1 person... I don't know about much fencing clubs in Belgium that have their own room. We have to rent it from the city (at Parcival where I get lessons) or from the university (where I teach fencing to students). In both cases we have to let others do the job. Not that I'm going to complain about that :wink:

But every once in a while we organise some tournament in a different room and we need to tape the pistes or put the metal carpets. Then we 'kindly' (read: we buy beers afterwards) ask our students to help. Even though, it stil is a 17-22 job :slight_smile:

Myself and one adult student put all the tape in place Wednesday night.
Thursday, I then pressed all the tape edges down and trimmed out the tape where I wanted the paint to be continuous.
and my son & then painted it all.
My son & I and then we went back Friday and pulled all the tape up.
I think they look sharp. Not sure if we’ll do anything about the old yellow stripes.

Looks like a clean job. From our experience in the sporting hall, if the other lines have a different colour then it won't bother peoples that much!

They're also twice as wide, so they standout pretty good.