Hello! I'm hoping to log data from my car's OBD-II port for use in a machine learning (TensorFlow) experiment. However, I realize I don't have an real-time clock on my arduino-compatible device (nor would most):
I'm thinking I don't need 100% precise dates though, or even really dates, maybe a number of seconds from a starting point, roughly. This is especially the case as I only need to take readings one or a few times per day (mile count).
Can I do this without an RTC? My thought is maybe not. If the car is shut off and there's no power, time passage gets lost altogether. Otherwise I could probably keep track of a time interval in memory somehow.
Thoughts? Thanks in advance!
If you want a timestamp that is continuous across power cycles then an RTC would be the cheapest solution. Other choices are getting the date and time from an external source such as GPS or a time server over Internet.
If you have Amazon Prime you can get two RTC modules with one day shipping for $7.99:
Otherwise I could probably keep track of a time interval in memory somehow.
That's pretty much the definition of an RTC.
RTC = pennies
work-around = hours
since an RTC is so cheap, the desire to not use one, when it is needed, would require a lot of work.
an ESP8266 can reach out to your phone or the WiFi at the local store and get the time from the internet.
an ESP32, costs much more than an ESP8266 + RTC, but it has an RTC on-board
Thanks all for the great feedback! I'm saving my pennies for an RTC.