Time Stamp? and Wifi Connection

Hi all,

I am looking for help on something that seems rather simple but difficult for me and my team to figure out.

Does anyone know how to get a time stamp to export every second while collecting data with the arduino?

Also, does anyone know how to connect the arduino to wifi?

Thanks all!

Does anyone know how to get a time stamp to export every second

The Arduino knows how long it has been running. It has no idea what time it is.

If you are sending data somewhere, surely the app that gets the data knows what time it gets the data.

Also, does anyone know how to connect the arduino to wifi?

Yes, but I can’t tell you. I don’t know what kind of WiFi device you want to connect the Arduino to. (Usually, people talk about connecting things to the Arduino, not connecting the Arduino to things.)

Does anyone know how to get a time stamp to export every second while collecting data with the arduino?

Use an RTC module. Works like a charm.

Does anyone know how to get a time stamp to export every second while collecting data with the arduino?

If you have your wifi connection working, you can get the time from an NTP server or from a Web Server. I don't think the clock in the Arduino is super accurate, so you may need to resync the time periodically.

As @PaulS said, it is simpler to let the server on the other end log the time it received it. If you are buffering the events on the Arduino and sending them through in a batch later on, you can send how many milliseconds ago the event occurred, so the server can still figure out the correct time. It won't be exact, as it doesn't count network latency but it might be close enough for your purposes.

Also be aware that the milliseconds on the Arduino wrap around to zero again after around 51 days.