Tolerances and Real-World Values
Software tends to be exact — a variable is either 42 or it is not. Hardware has tolerances: a component's actual value is always an approximation of its labelled value. This page explains what that means and when it matters.
Component Tolerances
Resistors
Resistors are manufactured to a specified tolerance band:
| Tolerance | Meaning | Example (10 kΩ nominal) |
|---|---|---|
| ±1% | Precision | 9.9 kΩ to 10.1 kΩ |
| ±5% | Standard (most common in hobby kits) | 9.5 kΩ to 10.5 kΩ |
| ±10% | Loose | 9.0 kΩ to 11.0 kΩ |
The tolerance band is typically the last coloured band on a through-hole resistor (gold for 5%, silver for 10%, brown for 1%).
For this project, 5% tolerance resistors are fine everywhere. You do not need 1% precision resistors for pull-ups, current limiting, or voltage dividers.
Capacitors
Ceramic capacitors (the small, flat ones) have much wider tolerances than resistors, and their actual capacitance varies with applied voltage and temperature:
- A "100 nF" ceramic capacitor might measure anywhere from 80 nF to 180 nF at room temperature and low voltage
- Under full rated voltage, the capacitance can drop by 50% or more for certain dielectric types (X5R, Y5V are the worst offenders)
This sounds alarming, but circuits are designed to work across this range. A decoupling capacitor that is 80 nF instead of 100 nF still absorbs high-frequency voltage spikes effectively. The exact value is not critical.
Crystals
The DS3231's TCXO is accurate to about ±2 ppm (parts per million), which translates to roughly ±1 minute per year. A bare crystal without temperature compensation might drift ±20 ppm or more (~10 minutes per year), which is why the DS3231 uses a TCXO.
When Tolerances Matter — and When They Don't
The key insight is that most circuits are designed with wide operating ranges. The datasheet specifies a minimum and maximum for each parameter, and any value within that range works correctly.
Pull-up resistors for buttons
A pull-up resistor for a button just needs to be "high enough to not waste significant current" and "low enough to pull the signal up reliably". This is an enormous range:
- Minimum: ~1 kΩ (below this, pressing the button wastes over 3 mA per button — not catastrophic, but wasteful if running on battery)
- Maximum: ~100 kΩ (above this, electrical noise may cause false readings)
- Conventional value: 10 kΩ
If you only have 4.7 kΩ or 22 kΩ resistors, both work perfectly. The ESP32's internal pull-ups are ~45 kΩ, and they work fine for buttons in this project.
I2C pull-ups
I2C pull-ups have a narrower acceptable range because rise time matters:
- Minimum: ~1 kΩ (below this, the bus draws too much current and some devices cannot pull the line LOW)
- Maximum: ~10 kΩ at 100 kHz standard mode, ~4.7 kΩ at 400 kHz fast mode (above this, the signal rises too slowly)
- Conventional value: 4.7 kΩ
If you have 3.3 kΩ or 6.8 kΩ, either works at 100 kHz. At 400 kHz, stay at or below 4.7 kΩ.
Decoupling capacitors
A decoupling capacitor just needs to be "roughly 100 nF":
- 47 nF works
- 100 nF is standard
- 220 nF works
- 1 µF also works (slightly overkill but not harmful)
Using exactly 100 nF is not important. Using approximately 100 nF is.
LED current-limiting resistors
This is one area where tolerance can matter at the edges. If you calculate 150 Ω and only have 220 Ω, the LED is dimmer but fine. If you only have 47 Ω, the LED draws too much current and may burn out. The safe direction is always to go higher (dimmer but alive).
As a rule of thumb: if the actual resistance is within 2× of the calculated value and on the high side, you are safe. Going below half the calculated value risks damaging the LED.
Voltage Tolerance
Supply rails
The ESP32-S3 datasheet specifies an operating voltage range of 3.0 V to 3.6 V on its power supply pins. The onboard LDO targets 3.3 V, but it might actually output 3.28 V or 3.32 V. This is normal and expected — the chip is designed to work across the entire range.
Voltage sag under load
When a component draws a sudden burst of current (e.g. the ESP32 starting a WiFi transmission), the supply voltage dips briefly. This is called voltage sag or droop. If the sag pulls the voltage below the chip's minimum operating voltage, it resets.
A decoupling capacitor smooths out brief sags. A sufficiently powerful USB supply prevents deep sags. Both together provide reliable operation.
Battery voltage
The DS3231's backup battery has a nominal voltage of 3.6 V but operates from about 4.2 V (fully charged) down to 2.7 V (nearly empty). The DS3231 is designed to operate across this entire range.
Temperature Effects
Most component values drift with temperature:
- Resistors change by 50–200 ppm/°C (negligible for this project)
- Ceramic capacitors can lose 20–80% of their capacitance at temperature extremes (but decoupling still works, since the exact capacitance is not critical)
- Crystals drift with temperature (which is why the DS3231 uses a temperature-compensated oscillator)
For an alarm clock sitting on a nightstand at room temperature, none of this is relevant. It becomes important when designing hardware for outdoor, automotive, or industrial environments.
The Practical Takeaway
-
Use standard values from the datasheet or this guide. They are chosen to work across the normal tolerance range of typical components.
-
Substituting a nearby standard value is almost always fine. If the guide says 10 kΩ and you have 8.2 kΩ or 12 kΩ, use it. The circuit will not notice.
-
When in doubt, check the datasheet. Look for the "min" and "max" columns in the electrical characteristics table. If your component's value falls within that range, it works.
-
The safe direction for current-limiting resistors is higher (less current, dimmer but alive). The safe direction for pull-ups is also higher (weaker pull-up, slower but still functional).
-
Do not buy precision (1%) components for this project. Standard 5% resistors and generic ceramic capacitors are all you need.