Saving sensor readings on arduino

Hi everyone

I am new to arduino world and programming it, so my question may be so straight forward, but I would appreciate your help. I am using an arduino pro mini for a project which contains a couple of motors and a sensor (to be more specific, an IMU sensor). The sensor sends out it's reading through I2C and I was able to read the 6 angles while my arduino is connected to computer through the serial port. But I cannot connect the whole system to computer every time and I need to save the sensor data on the arduino and retrieve it later by connecting it to PC. My idea is that since the sensor is reading the data continuously, I want to sample that data every 1 second and save the sampled data on arduino. Can anybody help?

Get an SD card and shield; plenty of examples out there for this.

Alternatively, you could save it to be EEPROM, but this would be very limited in the amount you can save.

You have only 512 bytes of EEPROM available so an SD card is probably your best bet unless your requirements are very limited.

Actually I cannot use SD card, my whole system needs to be as small as possible and light weight and I already have more that what it should be on my hands. I know by saving data on EEPROM, I will end up with limited data saved that's why I want to sample the data and don't save all of it. Do you guys have a sample code that I could take a look at to see how I should write the code?

Even assuming 6 bytes per reading of all the sensors, you could only store 85 readings. Is the unit going to run more than 85 seconds?

I think that would suffice. I can sample every 2 seconds instead of one. I am gonna use the sensor data as a feed back to my controller later. so really I don't need to see the data. but I wanna save them and retrieve them on my PC later to kinda see what is going on inside just for my reference. The system has 3 degrees of freedom and it will move in a plane in a 2D space. It would be great if you can help me figure out how to sample data, how to save it on microcontroller and how to retrieve and show it on my PC later on.

BTW the sensor is a 9 DOF gyro, compass and accelerometer.

Can you read what you want to read from the sensor? If you can't, then worrying about how to store it is premature

Actually I can. and when I move the board, I can see the angles changing clearly.

I mean if I connect the arduino to the PC through usb, I can monitor the changes in angles through serial monitor feature realtime. But in my application I cannot connect the system to usb. that's why I wanna store the data and when the task is finished, connect the system to usb and read the data.

Start here then