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:http://www.pjrc.com/teensy/td_libs_Encoder.html
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!