# Battery compartment design for small electronics enclosures

> Practical battery compartment design for small devices: cell tolerances, contacts, doors, swelling room and coin cell rules to settle early.

- Author: Milo Perović, Founder & lead engineer
- Published: 2026-11-20
- Topic: Design

Battery compartment design rarely gets the attention it deserves. It ends up as the last thing modelled before the enclosure goes to the toolmaker, squeezed into whatever volume the PCB and antenna left behind. Then prototypes arrive: cells rattle, doors pop open in drops and devices reset when someone taps the table.

This post is for founders, product managers and engineers building small battery-powered devices, whether that means user-replaceable AA or coin cells or a sealed lithium-ion pack. These are the decisions we try to settle early, because nearly all of them change the enclosure geometry.

## Replaceable or sealed: decide first

The biggest choice is whether the user ever touches the battery. It decides how many openings the enclosure has, how it seals, how it certifies and how it ships, so it belongs in the requirements rather than in late detail design.

- **User-replaceable primary cells** (AA, AAA, CR2032, CR123A) suit low-power devices with multi-year life targets and customers who will not charge anything. They need a door, contacts and polarity guidance, and they open a path for water and dust.

- **Sealed rechargeable cells** (Li-ion pouch or cylindrical) suit devices people already expect to charge. The enclosure can be fully closed, but you now own charging, thermal behaviour, swelling and transport rules for lithium cells.

- **Service-replaceable packs** sit in between: a pack behind screws, swapped by a technician rather than an end user. This works well for industrial products with field service.

If the device goes rechargeable, the charger design matters as much as the compartment; we covered that side in our post on [Li-ion charging circuit design for small devices](https://miloperovic.com/journal/li-ion-charging-circuit-design-for-small-devices/).

## Designing around real cell dimensions

Cells are not as precise as their nominal names suggest. IEC 60086 allows an AA cell to range from roughly 13.5 to 14.5 mm in diameter and roughly 49.2 to 50.5 mm in length, and real cells from different brands land all over that window.

Design the pocket for the maximum dimensions plus clearance, then let the contacts take up the difference. In practice that means:

- Pocket diameter around 0.3–0.5 mm above the largest permitted cell diameter, with draft applied in the direction that keeps the bottom of the pocket at full size.

- Spring travel sized so that the shortest cell still sits under meaningful contact force and the longest cell does not bottom the spring out.

- Ribs rather than a full cylindrical wall where you can, which reduces sink marks and makes the cell easier to remove.

Test fit with several brands of cell, including the cheapest supermarket alkalines and a couple of rechargeables.

## Contacts, springs and the vibration problem

Contacts are a common source of field complaints. A cell that lifts off its contact for a millisecond during a knock is enough to brown out a microcontroller, and the symptom looks like a random firmware reset rather than a mechanical fault.

### Choosing contact hardware

For cylindrical cells, the usual pairing is a conical coil spring on the negative end and a flat or dimpled plate on the positive end. Nickel-plated spring steel is the common, low-cost choice; gold flash is worth considering for devices that sit for years in humid environments, where contact resistance creeps up as the plating oxidises. Off-the-shelf PCB-mounted holders are often the safest option for small volumes, because the contact geometry and retention have already been proven.

For coin cells, a surface-mount holder with a retaining clip is generally more robust than a pair of leaf springs pressing on the cell through a door. Leaf springs that rely on the door for force lose contact when the door flexes.

### Guarding against brief disconnects

- Aim for a contact force that keeps the cell seated under the shock and vibration levels in your test plan, and verify it with a drop test while logging the supply rail on a scope.

- Add bulk capacitance close to the regulator input so that a sub-millisecond interruption does not reach the microcontroller. Size it from your peak current and the allowed voltage droop.

- Configure the brown-out detector deliberately and log reset reasons, so a contact problem shows up as a brown-out rather than an unexplained reboot.

## Battery doors that stay shut

The door is a small part with a large share of the risk. It has to survive repeated opening, hold under a drop, seal when needed and still be operable by someone with cold fingers.

Door typeStrengthsWatch out for

Snap-in sliding doorNo tools, cheap to mouldLatch fatigue, opens in drops, hard to seal

Screw-retained doorSecure, easy to gasketLost screws, needs a tool, thread wear in plastic

Captive screw doorSecure, nothing to loseSlightly higher part cost and assembly time

Quarter-turn capGood seal on cylindrical compartmentsNeeds space and a circular opening

For anything that must meet an ingress rating, a screw-retained or quarter-turn door with a compressed gasket is far more predictable than a snap door. The same compression and groove rules we described for [IP67 enclosure design](https://miloperovic.com/journal/ip67-enclosure-design-seals-vents-and-leak-testing/) apply here, with the extra complication that the seal is opened and closed by users many times over the product's life.

Two smaller details save a lot of grief. Mould the polarity markings into the bottom of the pocket where they stay visible with the cell removed, and add a fabric pull tab or a finger notch so cells can be removed without prising them out with a screwdriver.

## Coin cell safety rules affect battery compartment design

If your product uses button or coin cells and is sold in the United States, Reese's Law and the associated UL 4200A standard set requirements for how the compartment is secured. In broad terms, the compartment must either need a tool such as a screwdriver to open or require at least two independent and simultaneous movements by hand, and it must stay closed after abuse testing including drops.

This changes the door design, not just the label. A simple friction-fit coin cell door will not pass, so decide early on a captive screw or a genuinely two-action latch. Check the current requirements for every market you plan to sell into, as rules for coin cells are being tightened in several regions.

## Sealed lithium cells: room to swell and nothing sharp

Pouch cells swell gradually over their life, and more quickly when stored hot or at full charge. Cell manufacturers typically recommend leaving space for thickness growth, often in the region of 8–10% of the cell's thickness, though the exact figure is in the cell datasheet and is worth reading closely.

- Leave the swelling gap above the flat faces of the cell and do not let ribs, screw bosses or components press into it.

- Retain the cell with a compliant foam pad or a light adhesive rather than hard clamping.

- Keep sharp edges, burrs and component leads away from the pouch, and protect the tab area from bending during assembly.

- Keep the cell away from hot components such as regulators and radio power amplifiers.

Plan for transport too. Lithium cells and packs generally need UN 38.3 test documentation before they can be shipped, which is easier when you buy a cell or pack that already has it.

## What we would do before freezing the enclosure

- Write down the battery choice, target life and whether users replace it, and get agreement before the enclosure is detailed.

- Model the compartment around maximum cell dimensions from the standard or datasheet, not nominal ones.

- Prefer proven off-the-shelf holders and contacts for small volumes.

- Drop and vibrate early prototypes while logging the supply rail, and fix brief disconnects mechanically and electrically.

- Choose the door type based on sealing and safety rules, not just on cost.

- For coin cells, design to the tool or two-action requirement from the first CAD model.

- For pouch cells, reserve the swelling gap and confirm it in a hot storage test.

None of this is difficult on its own. The trouble comes from leaving it until the enclosure is nearly finished, when a few extra millimetres of spring travel or a gasket groove means reworking parts that were supposed to be done.
