EveryCircuit
Contact
Reviews
Home
PeterDollar
modified 6 hours ago

Switched Battery Voltage Sensing

0
0
34
00:20:28
Switched Battery Voltage Monitor (Zero-Leakage High-Side Switch). The purpose of this circuit is to allow a low-power, battery-operated microcontroller node (such as an Arduino Pro Mini) to accurately measure the voltage of a 1S LiPo battery via an analog-to-digital converter (ADC) pin while maintaining absolute zero idle current consumption during deep sleep modes. The Problem: A standard resistor voltage divider connected permanently to a battery continuously bleeds current to ground. While a 10k Ohm resistor divider provides ADC measurement accuracy, it allows continuous drain to an unacceptable level (~210 uA), draining a remote node's battery in months. Furthermore, simply using an N-channel MOSFET at the bottom of the divider to break the ground connection creates a path where the analog pin is exposed to the full, un-divided battery voltage (up to 4.2V). Because this voltage exceeds the microcontroller's 3.3V power supply (Vcc), current leaks backwards through the microcontroller's internal ESD protection diodes, distorting measurements and causing a phantom power drain during sleep. The Solution: This circuit solves the leakage problem by implementing a two-stage, low-power High-Side Switch that completely disconnects the battery from the resistor network during sleep. A P-channel MOSFET (VP2106) is placed at the absolute top of the circuit, directly controlling the flow of power from the battery into the 10k divider network. When turned off, the entire divider and the microcontroller's ADC pin drop to a perfectly safe 0V. Because the battery voltage (up to 4.2V) is higher than the microcontroller's GPIO voltage (3.3V), a single P-channel MOSFET cannot be turned off directly by an Arduino pin. To bridge this voltage gap, an N-channel MOSFET (2N7000) acts as a level shifter. During sleep (GPIO = LOW), the N-channel MOSFET is turned off. A 100k Ohm pull-up resistor pulls the P-channel gate up to the full battery voltage (Vgs = 0V), snapping the P-channel closed. Idle current drops to 0 uA. During measurement (GPIO = HIGH), the N-channel MOSFET turns on, pulling the P-channel's gate hard to ground (Vgs = -4.2V). This opens the P-channel wide, instantly delivering battery voltage to the 10k/10k divider network. A 100k Ohm gate pull-down resistor ensures the N-channel MOSFET stays safely locked off during microcontroller boot-up or during resets when GPIO pins briefly float. A 100 nF capacitor sitting at the drain of the P-channel serves as a decoupling buffer to strip away environmental and high-frequency noise from the power rail before the voltage reaches the low-impedance 10k resistors. Results: Sleep Mode Current Draw: 0 uA. (Battery connection is physically isolated). Awake Mode Current Draw: ~210uA (Active for less than 1 millisecond per sample window). Measurement Accuracy: Maximum stability. The 10k Ohm source impedance perfectly matches the internal sampling constraints of the ATmega328P ADC, eliminating data fluctuations without requiring heavy software processing delays.
published 16 hours ago

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy