Need URGENT help!

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

how much data we talking about here

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

Hi Ethan,
sounds like a cool project :slight_smile:
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

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.

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

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.

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.

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.

I would go for EEPROM - Arduino Playground - 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:

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