Go Down

Topic: Need URGENT help! (Read 1 time) previous topic - next topic

EthanWise

Hello everyone,
My name is Ethan Wise and I am on a team of high schoolers doing the NASA SLI project. http://www.nasa.gov/offices/education/programs/descriptions/Student_Launch_Projects.html
We are using an Arduino UNO to controll 3 sensors that we will have running simultaneously during the flight of our rocket. We have came across a problem. We do not know how to have the data from our sensors stored while the Arduino is disconnected from the computer. The sensors are pressure/temperature breakout board, humidity breakout board, and a light sensor. We will need to recover this data to put in a spread sheet after we recover our rocket. I have attached a picture of what we have so far. Please help!!!

Osgeld

how much data we talking about here
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

EthanWise

The rocket will be in flight for a few minutes (under 5) and we want to collect data from all the sensors every second or possibly a few times per second. We have around 24KiB to work with

Robert Getzner

Hi Ethan,
sounds like a cool project :)
5min x 60sec are 300 records. one record per second shouldn´t be difficult with an SD card, down to 10 records per second (we are talking 512Byte Blocks!) should also be no problem with a good SD card. Below that you may hit SD card writing latencies, ie you could loose some measurements. How critical would this be for your project ?
I wonder about the mechanics, ie if the SD card and slot (e.g. in an SD card shield) would need some extra gluing or so. I assume the acceleration of the rocket will be big, if it stays in the air for 5 minutes).

Another option would be EEPROM, but I have no experience on that. There are however some posts on this topic in this forum. RAM you probably don´t want to use; just in case the UNO reboots during flight, this may be lost.

Best, RObert
http://robertgetzner.com/PersonalWordpress/category/computer/arduino/

Runaway Pancake

http://arduino.cc/en/Reference/EEPROM
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

EthanWise

Thanks Robert. We aren't aren't very familiar with Arduino code writing, so the biggest help we need is what to write in to make it store this data. Then we also need to know how to retrieve it.

AWOL

Quote
We aren't aren't very familiar with Arduino code writing,

It's C/C++ and there are lots of examples.
Have a look at the Playground
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

This can be handy:

http://playground.arduino.cc/Code/EEPROMWriteAnything

You don't need to take a 2 Mb photo of your screen, you can copy and paste the contents of it, as text. That will speed things up.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

EthanWise

I was posting this from my iPad while the code was on my computer screen, therefore I decided to take a picture rather than restarting my post on my computer. Thanks for the help though.

Grumpy_Mike

Just to be clear, you have 1K of EEPROM and 2K of SRAM, so storing 24K of data is not going to happen without extra hardware, like an SD card shield.

Only when you know what extra hardware you are going to have can we suggest how to code for it.

robtillaart

I would go for EEPROM - http://playground.arduino.cc/Main/LibraryForI2CEEPROM -

The most important thing is to write e.g. in the first EEPROM position what the last address used.
(note this should be done with a separate sketch)

If the Arduino reboots it just can reads where it was left
- OK there is always a small room for failure -

The essence of the code will be something like:
Code: [Select]


I2C_eeprom ee(0x50);

struct
{
  unsigned ling tim;
  float tem;
  float hum;
} measure;

int position = 64;  // start on the 2nd page of the EEPROM to minimize wear in data-pages
void setup()
{
  Serial.begin(115200);  // used for testing only
  Serial.println("Demo flight ");
}

void loop()
{
  if (time to sample)  // see blink without delay
  {
    measure.tim = millis();
    measure.tem = readTemperature();
    measure.hum = readHumidity();
 
    ee.readBlock(60, (uint8_t*)position, 2);
    ee.writeBlock(position, (uint8_t*) measure, sizeof(measure) );
    position += sizeof(measure);
    ee.writeBlock(0, (uint8_t*) position, 2);
}


a separate sketch can read the EEPROM and dump it to serial
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up