Pages: [1]   Go Down
Author Topic: Storing measurement data at high? speed  (Read 1351 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley. 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!
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
http://be02.rs-online.com/web/p/sram-memory-chips/7697345/

Since the guy in this thread has figured out how to modify an existing library to get it to work with the chip:
http://forum.arduino.cc/index.php?topic=149561.0

Another resource:
http://ucexperiment.wordpress.com/2013/02/26/more-memory-arduino-and-23lc1024/

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...)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Here's my site from our fencing club: http://schermclubparcival.be/
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* new_floor_lines_small.jpg (332.38 KB, 979x734 - viewed 23 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-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 smiley
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* new_stripes2013.jpg (338.65 KB, 1077x808 - viewed 26 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 1
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: