Project Overview
"Coulomb-Sense" is a rigorous implementation of Electrochemical State-of-Charge (SoC) Monitoring and SAR ADC Forensics. Utilizing the specialized power-management circuitry of the SAMD21-based MKR Zero, this system enables precise measurement of the attached LiPo battery's potential without external resistive-divider overhead. By polling the internal ADC_BATTERY node, the system translates analog bit-values into high-fidelity voltage telemetry. The build emphasizes reference-voltage calibration forensics, discharge-curve heuristics, and low-power sampling diagnostics for long-duration field deployment.
Technical Deep-Dive
- Internal ADC Architecture & Voltage-Divider Forensics:
- The SAMD21 SAR ADC Diagnostics: The MKR Zero features a $10$-bit (default) or $12$-bit Successive Approximation Register (SAR) ADC. Forensics involve reading the
ADC_BATTERYpin, which is internally connected to a $2:1$ voltage divider. This hardware-logic ensures that a $4.2\text{V}$ peak LiPo voltage is scaled down to $2.1\text{V}$, well within the $3.3\text{V}$ reference envelope, providing absolute safety forensics for the silicon. - Vref Calibration Analytics: To achieve 1:1 voltage accuracy, the system must account for the precision of the $3.3\text{V}$ internal regulator. Forensics involve measuring the actual $V_{cc}$ with a multimeter and adjusting the conversion-factor $(1.2 \times \text{Ref} / \text{Res})$ in the software-logic to eliminate parasitic measurement drift.
- The SAMD21 SAR ADC Diagnostics: The MKR Zero features a $10$-bit (default) or $12$-bit Successive Approximation Register (SAR) ADC. Forensics involve reading the
- LiPo Discharge Heuristics & SoC Analytics:
- Voltage-to-Capacity Interpolation: Battery voltage is a non-linear proxy for remaining capacity. Forensics involve mapping the $3.2\text{V}$ (Empty) to $4.2\text{V}$ (Full) range. The diagnostics focus on the "Discharge Plateau", where the majority of useful energy resides between $3.7\text{V}$ and $3.9\text{V}$. This heuristic ensures that the user receives accurate "Time-to-Depletion" telemetry rather than a raw, linear percentage.
- Low-Power Sampling Orchestration: Constant ADC polling induces parasitic power-drain. Forensics involve utilizing an asynchronous sampling interval $(\text{e.g., every } 60\text{ seconds})$. The diagnostics utilize the SAMD21's
sleepmodes between polls to maximize the battery's operational-life harmonics.
Engineering & Implementation
- Signal-Integrity & Noise Forensics:
- Averaging & Windowing Diagnostics: Analog readings are susceptible to transient EMI noise from the buck-converter or WiFi/SD modules. Forensics involve implementing a $10\text{-sample}$ moving-average filter. This diagnostic heuristic smooths the visual-telemetry on the Serial Monitor, providing a rock-steady voltage-trace $(V \pm 0.01\text{V})$.
- Internal Pull-up Inhibition Analytics: The
ADC_BATTERYpin must remain in a high-impedance state. Forensics focus on ensuring the pin-configuration doesn't induce a leakage-path to ground, which could artificially deplete the battery during long-term storage diagnostics.
- Form-Factor & Integration Aesthetics:
- The MKR Zero's integrated JST-connector provides a zero-resistance mechanical link. Forensics focus on the structural integrity of the battery-interconnect, ensuring that vibration-induced contact resistance doesn't skew the Kelvin-sensing diagnostics of the ADC engine.
Conclusion
Coulomb-Sense represents the pinnacle of Embedded Power-Management Diagnostics. By mastering SAR ADC Forensics and LiPo-Discharge Heuristics, Arduino_Genuino has delivered a robust, professional-grade telemetry node that provides absolute energy clarity through sophisticated internal-node diagnostics.