The importance of real-time clocks in IoT applications

Article By : Gordon Lee

Engineers can use compact, low-power RTCs with integrated crystal resonator in limited board space.

Real-time clocks (RTCs) were never eye-catching components in systems. Indeed, many engineers don’t understand why an RTC is needed. They might think it’s a very simple device that just keeps track of the time; plus, most microcontrollers nowadays have a built-in RTC peripheral.

So, why would system engineers spend extra money and waste more PCB space for an RTC? Why haven’t standalone RTCs become obsolete? This article will highlight the importance of an RTC in different applications, and outline critical RTC specifications and related design challenges.

Back in the old days, before the Internet became pervasive, a highly-accurate RTC was essential for countless applications such as personal computers, digital watches, camcorders, and vehicles. An RTC keeps track of the time even when the main power supply is turned off. Without an RTC, the user would need to set the time and date every time the device is turned on.

Today’s electronic devices have access to the Internet or GPS. Once the device has connected, it can very easily acquire the accurate time. For those devices that have the luxury of constant Internet connection, a highly-accurate RTC may have really become unnecessary, but this benefit comes at the expense of high power consumption.

Why RTC now

Over the past decade, as all types of automation applications—for example, home, agricultural, and industrial—have taken off, billions of devices are now Internet-enabled. Everyday objects like security cameras, lights, entertainment systems, and appliances can now connect to the Internet; these devices are part of the Internet of things (IoT) bandwagon. However, while battery-powered IoT devices are driving a substantial amount of IoT market growth, devices that are constantly connected to a power source are likely to maintain a constant Internet connection as well.

So, is this the end of the RTC? Not really; more and more RTCs are actually used in many automation and IoT applications. Many remote IoT sensors, like weather stations, are mostly battery operated and take measurements or complete a set of tasks on preset schedules. These devices cannot afford to continuously enable the wireless transceiver because that will drain the battery very quickly.

Indeed, engineers put lots of thought into techniques to prolong the battery life. Most of the time, these battery-operated devices are running in a deep-sleep mode—even their microcontrollers—to minimize power consumption when there isn’t a task to perform. These applications benefit from an extremely low-power RTC to wake the system up from time to time to work on assigned tasks.

While microcontrollers usually have a built-in RTC, the timekeeping current is typically in the microamps. The standalone RTC, on the other hand, consumes just nanoamps of current while operating. One standalone device on the market, for example, consumes only 150 nA in timekeeping mode, and provides two alarm settings and two interrupt pins that can be used to wake up the system.

Do not belittle the difference between a few micro amps and 150 nA. When designing IoT applications for long battery life, every micro ampere of current counts. Besides IoT applications, many medical devices also require nano-power RTCs; wearable ECG devices, hearing aids, and medical baby tags are some examples.

Most battery-operated devices are very small by design for portability or easy installation. Since the standalone RTC is external to the microcontroller, an RTC with a smaller package is preferred. Better yet, engineers can select an RTC with an integrated resonator if the board space is limited. Currently, the smallest RTC with integrated resonator in the industry is available in a 2.1×2.3 mm, 8-pin WLP package.

Besides low power and small package size, some applications also require high timekeeping accuracy over a wide temperature range. For example, this is an important consideration for a sensor that is installed in the field, where the temperature can fluctuate a lot through the day. For these applications, a more preferable choice is an RTC with temperature-compensation capability, which will be discussed in part 2 of this article series.

RTC with external crystal resonator

A cost-efficient RTC usually requires an external resonator, and the most commonly used resonator for an RTC is a 32.768 kHz tuning fork quartz crystal. Why 32.768 kHz? First, 32768 is a power of 2. When this signal connects to a 15-stage flip-flop, the output is a precise 1 Hz signal. The RTC uses this 1 Hz signal to drive the timekeeping logic. But why 32.768 kHz instead of 131.072 kHz or 1.024 kHz? To answer this question, we need to understand the trade-off between frequency and power consumption. In general, current consumption increases as crystal frequency gets higher. Hence, for a low-power RTC, the crystal frequency cannot be too high, nor too low. The size of the crystal is inversely proportional to the frequency.

This means the lower frequency crystal is physically larger and takes up more board space. So, 32.768 kHz is selected as the best compromise between power and size. Additionally, a person’s audible range is from 20 Hz to 20 kHz. People can actually hear the crystal vibration if the frequency is lower than 20 kHz. And 32.768 kHz is the first power of 2 number that is beyond the audible range.

Quartz crystals are calibrated in the factory to oscillate at the targeted frequency by adding a small amount of gold to the tips of the tuning fork to finely adjust the vibration speed. The resulting clock accuracy is typically within ±20 ppm at room temperature with specified capacitor load. The unit ppm is an abbreviation for parts per million, and is the unit typically used for clock accuracy measurement.

A ±20 ppm-accurate RTC in this case can be off by up to 10.5 minutes per year, assuming the ambient temperature is a 25°C constant throughout the year. The calculation is simply:

equation to calculate how off a 20ppm-accurate RTC clock can be per year

If temperature fluctuates, the accumulated error may increase. If the buyer is willing to pay extra, the supplier can provide a higher-accuracy crystal through a screen process. However, no matter how accurate these crystals are at room temperature, the frequency can still be affected by the following three factors:

  • temperature fluctuation
  • frequency-pulling with load capacitors
  • aging

Temperature fluctuation

Tuning fork crystal frequency is a function of temperature and can be approximated by a second-order equation:

equation to approximate tuning fork crystal frequency


f0 is the nominal frequency (32.768 kHz)

T0 is the turnover temperature (25°C)

k is a parabolic coefficient for the tuning fork crystal (0.04 ppm/°C2 typical)

T is the ambient temperature

As shown in the frequency error versus temperature plot (Figure 1), frequency becomes slower as temperature deviates away from room temperature (25°C).

frequency error versus temperature plotFigure 1 This graph shows how frequency becomes slower after temperature deviates away from room temperature. Source: Maxim Integrated

To guarantee optimal accuracy performance, ambient temperature must be regulated at around 25°C. Many indoor battery-powered devices may use this RTC with an external crystal solution, and that provides the cost savings and low-power benefits.

Frequency pulling

A crystal’s frequency can be affected by its load capacitors. A Pierce oscillator is the most commonly used crystal oscillator circuit inside an RTC (Figure 2). It typically consists of a crystal, an inverter, and load capacitors.

diagram of an oscillator circuit incorporated inside the RTC

Figure 2 An oscillator circuit is incorporated inside the RTC. Source: Maxim Integrated

An equivalent circuit comprising the crystal and the load capacitors is presented in Figure 3.

two diagram of the equivalent circuitFigure 3 The equivalent circuit is based on crystal and load capacitors. Source: Maxim Integrated

In the circuit shown in Figure 3, the RCL series circuit resonates in parallel with C0 and CL. The oscillation frequency formula is as follows:

oscillation frequency equation


R1, C1, and L1 are motional parameters of the crystal

C0 is the capacitance between the terminals of the crystal

FL is the oscillation frequency with total effective capacitance

CT is the overall effective capacitance, C1 in series with (CL+C0)

overall effective capacitance equation

FS is the series resonance frequency of the crystal

series resonance frequency equation

As C0+CL is much greater than C1, the FL formula can be approximated by

equation to approximate oscillation frequency

The derivative of FL with respect to CL represents the frequency changes in Hz with respect to the changes of the load capacitance. Divide it by the series frequency to calculate the change ratio of the frequency per unit capacitance. This formula shows the frequency sensitivity with various loading capacitor value, CL:

frequency sensitivity equation

This formula is a good approximation only when CL is close to the specified load capacitance value. If the load capacitor deviates from the specified value too much, the oscillator may fail to operate completely because the crystal and capacitors cannot produce 180 degrees phase shift back into the input of the inverter.

To reduce the cost and board space occupancy, many RTCs have built-in load capacitors that are factory trimmed. They should match very well with the crystal’s specified load capacitance. The frequency error should be very small at room temperature if the layout is well designed. The PCB traces from the crystal to the pad of the RTC can contribute additional stray capacitance to the CL. In one RTC on the market, the load capacitors are trimmed to yield the optimal clock accuracy based on the evaluation kit PCB layout. In other words, the stray capacitance in the evaluation kit has been included as part of CL.


Aging refers to the change of the resonance frequency of a crystal over time. Aging is caused by the change of mass of the crystal over time because of the contamination inside the crystal package. Generally, a crystal’s frequency changes a few ppm per year, with most of the changes occurring in the first two years.

Exposing the crystal in a high-temperature environment can speed up the aging rate. Unfortunately, there’s very little engineers can do about the aging effect besides calibrating the crystal from time to time. Some RTCs provide an aging offset register for the user to manually adjust the clock frequency.

Part 2 of this series provides a detailed treatment of RTC’s temperature compensation capabilities.

This article was originally published on EDN.

Gordon Lee is principal member of the technical staff, Applications, Core Products Group at Maxim Integrated.

Related articles:

Leave a comment