A Battery Lookup Is a Type-Checking Problem: Building Safer SR626SW Replacement Rules

calendar_today • schedule5 min read

An electronics data-modeling exercise with Python, real battery specifications, and a few surprisingly important edge cases.

A watch battery marked SR626SW seems like an easy item to replace. Search the code, buy the first matching result, and move on. But when a catalog also lists 377, D377, SR66, LR626, AG4, and dozens of similar-looking cells, a simple string-match lookup can return unsafe or simply incorrect recommendations.

This is a useful small example of a problem developers encounter everywhere: identifiers are not specifications. A product name is not a complete description of what that product can do.

Let's use the SR626SW watch battery to design a more reliable compatibility checker. The goal is not to build a certified battery-selection tool, but to show how basic data modeling and validation rules can prevent misleading “equivalent” recommendations.

Start with physical and electrical requirements

The SR626SW / 377 family is a non-rechargeable silver oxide button cell used in many low-drain quartz watch movements. A representative Energizer 377/376 datasheet gives:

Property SR626SW / 377 family
Nominal voltage 1.55 V
Chemistry Silver oxide (Zn/Ag₂O)
Diameter Approximately 6.8 mm
Height Approximately 2.6 mm
IEC reference SR66
Typical rated capacity 27 mAh under the cited test conditions
Rechargeable No

The capacity figure is test-specific. Energizer measures its published 27 mAh to a 1.2 V cutoff under a 45 kΩ continuous load at 21°C; it is not a promise that every watch will receive exactly 27 mAh.

Source: Energizer 377/376 product datasheet.

A good catalog should store the measurement and its context, not just the headline number.

Why a name-only lookup fails

Suppose an application exposes a function:

def is_equivalent(a: str, b: str) -> bool:
    return a.lower() in b.lower() or b.lower() in a.lower()

That obviously fails: a partial code match tells us nothing about chemistry, fit, or voltage. But a manually maintained list of names can still fail if it treats every cross-reference as an unconditional substitute.

A more useful interpretation is:

  • Alias: another trade or standardized designation for the same battery specification.
  • Conditional alternative: similar enough to examine, but with a difference that matters to the device.
  • Incompatible cell: does not meet a mandatory requirement, even if its name looks familiar.

For example, 377 is a widely used trade designation for the SR626SW class. AG4/LR626, by contrast, generally describes an alkaline cell of similar dimensions. Its nominal voltage is typically 1.5 V, but its discharge behavior is different. That makes it a possible application-dependent alternative, not an exact chemistry match.

If you need a human-readable list of the common markings before writing your own mapping table, the SR626SW equivalent reference is a useful starting point. Treat any cross-reference as something to verify against manufacturer documentation.

Model the battery as structured data

Instead of letting a designation stand in for a specification, define explicit fields:

from dataclasses import dataclass
from typing import Literal

Chemistry = Literal["silver_oxide", "alkaline"]

@dataclass(frozen=True)
class Cell:
    name: str
    chemistry: Chemistry
    voltage_v: float
    diameter_mm: float
    height_mm: float

sr626sw = Cell("SR626SW", "silver_oxide", 1.55, 6.8, 2.6)
alkaline_ag4 = Cell("AG4", "alkaline", 1.50, 6.8, 2.6)
sr621sw = Cell("SR621SW", "silver_oxide", 1.55, 6.8, 2.15)
sr920sw = Cell("SR920SW", "silver_oxide", 1.55, 9.5, 2.05)

These are representative nominal dimensions, not exact manufacturing tolerance bands. In production, store authoritative minimum/maximum dimensions and their source documents.

Already, the data explains why one query may contain three different answers:

  • AG4: similar physical envelope, different chemistry.
  • SR621SW: same nominal voltage and diameter, but thinner.
  • SR920SW: same nominal voltage, substantially wider and a different height.

The two silver oxide comparisons are especially instructive. The SR621SW vs SR626SW size comparison shows why matching diameter does not establish a secure fit. Meanwhile, a lookup that recommends SR920SW based only on voltage would ignore a major diameter difference.

Return a verdict with reasons, not just a boolean

Binary True/False compatibility often hides uncertainty. A better function should say why a cell was rejected or flagged for review.

from dataclasses import dataclass

@dataclass(frozen=True)
class Assessment:
    status: str
    reasons: tuple[str, ...]


def assess(candidate: Cell, required: Cell) -> Assessment:
    reasons = []

    # Simplified teaching thresholds, NOT manufacturer tolerances.
    if abs(candidate.diameter_mm - required.diameter_mm) > 0.10:
        reasons.append("diameter differs from required nominal size")
    if abs(candidate.height_mm - required.height_mm) > 0.10:
        reasons.append("height differs from required nominal size")

    if reasons:
        return Assessment("reject", tuple(reasons))

    if candidate.chemistry != required.chemistry:
        reasons.append("different chemistry; confirm device approval")
    if abs(candidate.voltage_v - required.voltage_v) > 0.01:
        reasons.append("nominal voltage differs; confirm device limits")

    if reasons:
        return Assessment("review", tuple(reasons))

    return Assessment(
        "nominal_match",
        ("nominal characteristics match; verify datasheet and movement requirements",),
    )


for option in (sr626sw, alkaline_ag4, sr621sw, sr920sw):
    result = assess(option, sr626sw)
    print(option.name, result.status, "; ".join(result.reasons))

Expected statuses for this simplified example:

Candidate Status Why
SR626SW nominal_match Same modeled specs
AG4 review Chemistry and nominal voltage differ
SR621SW reject Height differs
SR920SW reject Diameter and height differ

This is not a device safety certification. In particular, the 0.10 mm threshold is a deliberately simple placeholder that should never be substituted for real compartment tolerances. A production system also needs mechanical contact geometry, discharge profiles, load behavior, temperature limits, and device-specific approval.

A voltage match does not make two cells interchangeable

Consider SR920SW and SR626SW. Both are nominally 1.55 V silver oxide cells, but they have different physical envelopes. A catalog that compares only voltage and chemistry will suggest a replacement that cannot fit a correctly sized holder.

If you are documenting battery interchangeability, consult the SR920SW vs SR626SW dimensions and differences before recording a cross-reference.

The engineering lesson extends beyond batteries. A memory chip with the correct supply voltage may still have the wrong pinout; a connector with the correct contact count may have a different footprint. Compatibility is a conjunction of requirements, not a resemblance score.

Improve the model for real catalogs

A real implementation should go beyond the tutorial's five fields:

  1. Source provenance: manufacturer, datasheet URL, publication revision, and test conditions.
  2. Tolerances: minimum and maximum dimensions rather than nominal values alone.
  3. Application requirements: watch movement or device model, contact construction, and permitted chemistries.
  4. Uncertainty states: verified, conditional, unknown, and rejected are more honest than one generic “equivalent” badge.
  5. Auditability: show which criteria produced a verdict and when the data was checked.

An especially useful UI feature is a short explanation next to every suggested alternative: “Same chemistry and nominal size,” “Different thickness,” or “Alkaline chemistry—review required.” The explanation matters at least as much as the recommendation.

Final takeaway

The SR626SW example is small, but it demonstrates a robust design principle: never let a product identifier substitute for validated properties.

For a watch owner, the safest path is to use the cell type specified by the movement manufacturer. For developers building parts databases, the better approach is to represent identity, dimensions, chemistry, voltage, and evidence separately—and make uncertainty visible.

That turns a simplistic equivalent-parts list into a much more trustworthy decision aid.

Want more #battery deep dives?

Join 6,173+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

1 Comment

0 votes

More Posts

Why Your Watch Stops After a Battery Replacement: The 377 vs 364 Problem

sophiayuen2108 - Nov 6

FluidCloud's CEO on Why NSX Firewall Rules, Not Disk Copies, Stall VMware Exits

Tom Smithverified - Nov 17

Tuesday Coding Tip 02 - Template with type-specific API

Jakub Neruda - Mar 10

Three Design-to-Code Rules Most Developers Ignore (That Will Make You a Better Engineer)

Joemetry - Sep 26

Why Are There Only 13 DNS Root Servers For The Whole World? Is that a problem

richarddjarbeng - May 7
chevron_left
215 Points • 8 Badges
4Posts
0Comments
https://kecalculator.com/

Related Jobs

View all jobs →

Commenters (This Week)

13 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!