Stream Time Stamp to Excel "=now()"

Disclaimer - I am not a coder...

I'm helping my kid with a science fair project and we're working on streaming data to excel and assigning a time stamp for each reading. We managed to download a sound intensity sketch that we found to use as our backbone. With a couple of edits, we generally have this working as intended, filtering out only data points above a certain threshold.

The part we're struggling with is assigning a timestamp to each datapoint. I thought I was clever and I used Serial.println(",=now()") to assign a function to each data point for Excel to calculate the date and time... Turns out I'm not so clever after all... The text comes into Excel as a string - '=now() and it doesn't interpret it as a function. It just shows the function as text.

Does anyone know how to get around this or maybe just a proper way of assigning a time stamp to a data point? I'm a bit out of my element here.

Thanks!

A popular approach is to send the Arduino time stamp in milliseconds since startup, using
Serial.println(millis());

If you want to send the time of day (and date), use instead the Unix timestamp returned by the Arduino Time library function now(). That does require setting the clock correctly at Arduino startup.

You might take a look at the Excel macro PLX-DAQ, which supports timestamps. PLX-DAQ version 2 - now with 64 bit support! (and further new features)

Welcome to the forum

You have not told us whether your sketch has functionality to actually get the time so it is difficult to give advice

Please post your sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

Which Arduino board are you using ?

When using PLX, timestamping is done by the PC clock, and the advice is:
no need to actually get the time.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.