SparkFun gator:RTC Hookup Guide
The gator:RTC consists of 4 pads for power and data.
|GND||N/A||Ground: Reference voltage and ground loop.|
|3.3V||In||Power: Provides 3.3V to board.|
|SDA||Bi-directional||Data: Data and commands are transmitted between the RV-3028 and microcontroller.|
|SCL||In||Clock: The microcontroller provides the timing needed to communicate on the data line.|
The specified operating voltage for the RV-3028 is between 1.2 - 5V. For use with the gator:bit (v2) and micro:bit, you should provide 3.3V through the 3V3 and GND pads to keep the logic levels consistent.
The board also includes a 1mAh lithium-metal rechargeable, coin type backup battery. This allows the RTC module to keep track of time even when power to the board is cut (for low power applications). Although, current consumption varies by how the RTC is operating and the temperature, users should expect a fully charged backup battery to last for several months with the RTC operating conservatively.
Here are some of the characteristics of the battery from the datasheet:
|Nominal Capacity||1.0mAh (3.1V - 2.0V)|
The RV-3028 is an extremely low power real-time clock (RTC), consuming only 40 - 60nA on average at 3V, which interfaces over an I2C bus. A real-time clock is used to keep track of the current time, which is a useful, but often forgotten tool. For the most part, users will only need to know I2C addresses of this board to prevent address conflicts with other devices or sensors.
|Operating Voltage||1.2V to 5V|
|Supply Current (@3V)||
40nA to 60nA (avg.) (~330nA peak)
5µA to 40µA (active I2C-bus)
95nA to 150nA (backup battery operation)
|Operating Temperature||-40°C to 85°C|
|Xtal (Internal Oscillator) Frequency||32.768 kHz (± 5ppm @ 25°)|
|Timing Accuracy||Factory calibrated: ± 1ppm @ 25°C (no temp. compensation)|
|Calender Range||Automatic leap year correction: 2000 to 2099|
|Counter||Seconds, minutes, hours, date, month, year and weekday|
7-bit Peripheral Address: X1010010b, where X is the R/W bit
0x52 - Write Address
0xD2 - Read Address
What is Time?
Time is the continuous progression of events which succeed one another from the past and into the future. By most human standards, time is measured in a base unit of time, called a second. Most recently, the second (SI unit of time) was re-defined to a more specific standard:
It is defined by taking the fixed numerical value of the cesium frequency ΔνCs, the unperturbed ground-state hyperfine transition frequency of the cesium-133 atom, to be 9,192,631,770 when expressed in the unit Hz, which is equal to s-1.
Below, are additional resources regarding the topic of time:
- History of the Definition of a Second
- History of Timekeeping Devices
- How does one arrive at the exact number of cycles of radiation a cesium-133 atom makes in order to define one second?
- These Physicists Watched a Clock Tick for 14 Years Straight: It was to test Einstein's theory of general relativity.
What is an RTC?
RTC stands for real-time clock, which is used to keep track of time. With the convenience of modern electronics such as computers, smartphones, GPS navigation, and IoT/smart devices, the importance of an RTC can be easily overlooked. An RTC is different from an oscillator or hardware clock that only generates a clock signal; the primary difference being that an RTC can keep track of the time. In the case of the gator:log, the RV-3028 is is able to keep track of time by the month, day (including weekday), year (leap-year accurate from 2000 to 2099), hours (12-hour format), minutes, and seconds. This is useful for a variety of applications including, but not limited to data logging, timers, and other long duration projects like time-lapse photography.
The key benefits of using an RTC in your project is that they are:
- Low Power: The RV-3028 only consumes about 40 - 60nA when only tracking time.
- No Power: With the backup battery, the RV-3028 is able to keep track of time. The clock stored on a micro:bit would resume from the last point of reference or reset depending on the methods used.
- Accuracy: The RV-3028 is factory calibrated to ± 1ppm. This equates to a deviation of less than 32 seconds over the course of the year. (*Your average wrist watch is accurate to about ± 50ppm, which is a variance of 27 minutes per year.)
The drawbacks of an RTC that should be considered before using it in your project are:
- Resolution: The resolution of the RV-3028 is limited to 1 second intervals.
- Latency: Although the RTC operates on a "higher" speed I2C bus, cycles are still spent accessing timing data from the module. In addition to the limited resolution, this limits the functionality of an RTC for high speed applications, like a data acquisition systems.
The RTC is most useful for long duration projects. Here is a list of some examples:
- Recording climate data to track changes by season or year. Linked below, are some additional resources on the topic of climate change tracking:
- Time-laspe photography may not need an RTC, but for those interested in capturing exact moments of the day, and RTC would be a great tool to use. Especially, as a redundancy if your timer uses a web-based clock. This is a great article, where the photographer actually uses an Arduino to trigger his photos.
- In a more extreme case, for preppers, who are expecting to live in an underground shelter for extended periods of time and may not have access to GPS signals for accurate time keeping. After 10 years, your wristwatch may be off by up to 5 hours. That may not be much, but it would be the difference between popping your head out at dawn (e.g. 6AM) or in the middle of the night/day (e.g. 1AM/11AM).
Time Stamp Button
In addition to tracking time, the gator:RTC also includes a time stamp button to mark events. When pressed, the RV-3028 stores a time stamp of the button press. Therefore, it queried consistently, this button can be used to mark significant events in a data log. For example, marking the end point of a pH titration in a data set.
I2C is a communication protocol used to transfer data between controller and peripheral devices. It is a 2-wire connection consisting of SDA (data) and SCL (clock). The protocol is pretty well defined so it can be shared with multiple devices. This is beneficial for daisy chaining multiple devices together on a single bus. The primary thing users will need to watch out for is address conflicts (you can't have devices with the same address).