Reading and writing data to a SD card at the same time.

Hi,
I am working on a data logging project, which logs sensor data to an SD card and sends the data to a channel on thingspeak.com. The problem I have is that I need to have accurate readings hence I am sampling and storing the data to a csv file (8 readings in one row) on the SD card at a fast rate.

The website I am posting to only allows updates every 15 seconds and I am wondering if there is a way I can read data from the SD card every 15 seconds(one raw at a time) and post it online while I am still sampling and storing data on the card

any help will be appreciated

The website I am posting to only allows updates every 15 seconds and I am wondering if there is a way I can read data from the SD card every 15 seconds(one raw at a time) and post it online while I am still sampling and storing data on the card

What kind of data are you posting? Why not bite the bullet, get your own domain and hosting company, and post all the damned data you want to a web site YOU pay for?

I am posting current and voltage readings and would like to calculate their harmonics.and yes I did create my own domain with Afrihost.l and currently trying to figure out how I can setup everything I need and analyse the data from my own domain. But as of now I am wondering if what I asked for is possible and if anyone knows how and can help me out or give any suggestions on how I can do it while I still figure out setting up my domain for data logging and analyse the data using matlab .

Muundu:
Hi,
I am working on a data logging project, which logs sensor data to an SD card and sends the data to a channel on thingspeak.com. The problem I have is that I need to have accurate readings hence I am sampling and storing the data to a csv file (8 readings in one row) on the SD card at a fast rate.

The website I am posting to only allows updates every 15 seconds and I am wondering if there is a way I can read data from the SD card every 15 seconds(one raw at a time) and post it online while I am still sampling and storing data on the card

any help will be appreciated

Good day, am new to this. Am looking for help on how to send or store sensor readings to memory card module on arduino uno.

Can I get a head way or help from you pls

I think you would be better putting this up as a new topic, but you will see examples of what you can do included with the SD library.

The code below is a bare bones test which should be self explanatory. It is assumed that the chip select is on pin D4, which is usual practice. You only need to run it for a few seconds to prove the point.

The file is open only when you want to write to it. Note that the actual command to print to file is essentially the same as printing to the serial monitor.

#include <SPI.h>
#include <SD.h>

const int chipSelect = 4;

void setup()
{
  Serial.begin(9600);
  Serial.print("Initializing SD card...");
  pinMode(10, OUTPUT);            // Mega uses pin 53

  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
  }
  Serial.println("card initialized.");
}

void loop()
{
  File dataFile = SD.open("datalog.txt", FILE_WRITE);
    dataFile.println("Hello");
  dataFile.close();

  Serial.println("Hello");
  delay(1000);
}

But as of now I am wondering if what I asked for is possible

Yes, it's possible. But, is it reasonable. Writing data to the card at a rate of say 10 a second, and posting one reading every 15 seconds will never, ever clear the backlog.