Oscillators, as we've discussed, are devices that move in a repeating pattern, such as a clock's pendulum or even a tuning fork. Modern devices like computers require much faster oscillators to set their clock speeds, generally in the millions or even billions or hertz (MHz and GHz). And computers include microcontroller dev boards such as those made by Arduino.
Arduino Clock Speeds
Based on their setup, you can find dev boards with various speed settings. Here are a few examples:
- Arduino Uno: 16 MHz
- 'Classic' Arduino Nano: 16 MHz (with differing speeds for the new generation)
- MKR Wi-Fi 1010: 48 MHz
- Mega 2560: 16 MHz
- Due: 84 MHz
For most simple applications—like flipping a "switch" based on a sensor input—any of these speeds will suffice. In some cases, you may actually prefer a lower clock speed to save power.
Arduino Uno Crystal Oscillator Configurations
Arduino boards use a variety of oscillator configurations. The Uno board features a very pronounced crystal oscillator next to the USB-B port. As shown in the image above, the "T16.000" marking indicates that the device oscillates at 16 MHz. Interestingly, this oscillator regulates the device's ATmega16 microcontroller—which performs USB-to-serial conversion when interfacing with a computer—not the ATmega328P microcontroller. The latter microcontroller handles the logic when you're using your board.ATmega328P Oscillator Example
A ceramic resonator generates the ATmega328P's clock signal, though this oscillator features less precision than its crystal-based cousin. This tiny component resides directly under the letters "ITAL" in the Uno image above, and resonates at 16 MHz with a rated accuracy of ±.5%.
In our experience, these specs are sufficient for normal use, especially if your device or application won't suffer from a delay of one second every two minutes. However, the ATmega328P may not be ideal for precision timing applications or if you need to operate in longer periods.
Let's break this down further: a day has 86,400 seconds in it, so a .5 percent deviation would be 432 seconds, or 7.2 minutes. The crystal oscillator onboard has a roughly .003 percent deviation, which would be about 2.6 seconds per day (though you can't use this signal for program timing). If you need more accuracy than that, you'll need to explore a different solution.
Arduino with Built-in RTC Module
The ATmega328P's resonator does not boast precision accuracy, but this won't affect most normal situations. To its credit, the ATmega328P's design saves money in production because the load capacitors that keep it vibrating are built into the device. If your application requires timing accuracy over weeks or months, you'll want to implement a secondary timing device called a real-time clock module (RTC). Some boards come with this functionality built-in―like the MKR Wi-Fi 1010 we mentioned earlier―so consider your requirements before you choose a board.
If you've got your mind set on a board that doesn't include an RTC, adding one is relatively inexpensive. Adding an RTC also lets you choose a module that suits your needs without paying for functionality that isn't necessary. These boards come with a battery backup in case you lose power temporarily. You can also use a GPS module to keep track of time or use a network setup if you're connected to Wi-Fi.