VSZAPOWERDocumentation by model
Back to Battery Academy
Battery Academy

MCU LIR2032 Charger State Machine: Transitions and Faults

Published on: Author: VSZAPOWER Editorial Team 5 min read
Educational illustration: MCU charger qualification, precharge, CC, CV, completion and fault states.

AI-generated concept illustration

A charging state is a contract

For an OEM building rechargeable IoT nodes, a green LED should represent a verified completion condition. Firmware must distinguish an empty holder, an interrupted supply, a current-limited charger and a genuinely completed charge. A state machine makes those distinctions reviewable: each state defines permitted outputs, required measurements and conditions for leaving it.

This article proposes a supervisory design pattern, not production firmware or a claim about an existing VSZAPOWER charger. Its cover is an educational control-flow illustration.

Archived buyers value straightforward charging, yet some report confusion about a blue indicator. VSZAPOWER's clip-charger demonstration uses red/blue indicators; its legacy slot-charger demonstration uses red/green. The new manual also assigns blue to an empty holder. For an OEM, this means the selected version's instructions must distinguish holder status from charge completion. Neither buyer praise nor an LED color verifies delivered capacity.

Start with a cell-specific profile

EEMB's LIR2032 reference is a 3.7 V, 45 mAh lithium-ion cell. Its standard test at 25°C specifies 0.2C constant current to 4.20 V, followed by constant voltage until current falls below 0.05C. Thus I_CC = 0.2 × 45 mAh / 1 h = 9 mA, and I_TERM = 2.25 mA. These settings belong to that specified cell; the LIR2032 size designation alone does not establish another supplier's requirements. EEMB datasheet, sections 2 and 5.1.

Store the approved profile version alongside voltage, current, temperature and timing limits. Obtain explicit supplier guidance for deeply discharged cells; the cited charge procedure does not define a universal precharge recovery window.

Separate supervision from regulation

Microchip's MCP1632 demonstration system combines an analog PWM controller with PIC firmware. Its main loop handles regulation while the battery state machine runs once per second. The distinction matters: a supervisory cadence must not accidentally become the power converter's control rate. That board's default 1,000 mA output and lack of implemented thermal shutdown make it an architectural reference, not a ready-made LIR2032 charger. Microchip guide, sections 1.1 and 2.2–2.4.

Compare the following proposed states during design review. Numeric limits must come from the approved cell and charger configuration.

StatePermitted charging outputRequired transition evidence
QUALIFYDisabledCorrect cell profile, valid input and plausible sensors
PRECHARGESupplier-approved limited currentApproved recovery threshold reached before timeout
CCRegulated current, voltage boundedValid transition into voltage regulation
CVRegulated voltage, current boundedQualified taper below termination current
DONEDisabledRequalification before an approved recharge cycle
FAULTDisabledCause recorded; deliberate, validated recovery

⚠ WARNING: Reaching 4.20 V starts the reference CV phase; it does not mean instant full charge. Never continuously trickle-charge lithium-ion cells after completion. ML2032 requires its own supplier-approved charging profile. Standard CR primary cells must not be charged.

Make completion harder to fake

Low measured current alone is ambiguous. A weak input supply, thermal limiting or a disconnected cell can resemble a taper. As a concrete hardware example, TI's BQ25170 requires both a voltage condition and low current, inhibits termination during thermal regulation, and switches its regulator off after completion. Its thresholds and fixed timers are device-specific, not settings to copy into this coin-cell profile. TI BQ25170 datasheet, sections 7.3.2.1–7.3.2.4.

For the proposed supervisor, require fresh, plausible measurements and confirmed CV operation before qualifying completion. Reset qualification when conditions cease to hold. If the IoT node operates while charging, distinguish cell current from system current; see our CC/CV and load-sharing discussion.

Calculate elapsed time explicitly

Suppose the design requires an illustrative 2.0 s stable observation window with samples every 100 ms. Twenty samples span only (20 − 1) × 0.100 s = 1.9 s from first to last. Twenty-one span 2.0 s, assuming no scheduling jitter. Compare monotonic timestamps and enforce a maximum sample age instead of assuming loop counts equal elapsed time. This window is a calculation example, not a recommended safety delay.

Specify separately whether charging timeouts count wall time or enabled charging time. Resetting a deadline after every input glitch can otherwise keep a defective cell in repeated charging attempts.

Design the reset path before the success path

Microchip explains that a windowed watchdog resets the MCU when servicing occurs outside its permitted time window. Microchip WWDT overview.

Our design recommendation is to service it only after required supervisory work completes. Define hardware enable levels that keep charging off during reset, then re-enter QUALIFY. Independent hardware limits must remain effective when firmware stalls. Test brownouts, open temperature sensors, stale ADC readings, removal during CV and repeated restarts; record actual output behavior, not just the displayed state.

Price avoidable interventions, with explicit assumptions

Consider a hypothetical one-year fleet of 1,000 compatible rechargeable IoT nodes, each charged 12 times: 12,000 attempts. Assume diagnostic improvements reduce unnecessary bench interventions from 2.0% to 0.5%, each taking six minutes at $20/hour. These are planning inputs, not measured results; never weaken protection to reduce a fault count.

Avoided labor = 12,000 × (0.020 − 0.005) × (6/60 h) × $20/h = $360.

Assuming $300 incremental engineering and validation cost, the intervention subtotal falls from $480 to $120 + $300 = $420. ROI = ($360 − $300) / $300 = 20%. This incremental comparison excludes unchanged cells, chargers and electricity; a complete procurement TCO must add those costs and validated service life.

For an OEM review, send your cell datasheet, load profile, charge-frequency target and required fault log to VSZAPOWER's project enquiry team. Agree on acceptance tests before selecting a charger configuration.

Explore VSZAPOWER battery and charger solutions

Compatibility depends on the charger configuration and battery charging requirements. Confirm the supported battery model before use.

Inquire Wholesale Quote (Contact for Wholesale Quote)
WhatsApp B2B Wholesale Support