Help wanted: battery switch replacement - Page 1
Forum section: electronics / projects

author: robca
author_rank: Frequent Contributor
timestamp: March 04, 2023, 06:29:50 pm
content: Hello,I'm working on a device with a built-in battery. In use, the device doesn't need a power button: when not in use, the IMU is programmed to wake up the device on motion, and the processor goes into a low power state, to be rebooted by the IMU motion interrupt. The device is charged using a wireless charger. The battery is protected in case of over-discharge.The problem is that when the device is manufactured the battery is only partially charged. And during transportation the device wakes up, burning power and resulting in a severely discharged battery sitting on a shelf for a long time, with battery damage. Currently there is a physical switch disconnecting the battery, to be removed before handing the device to the user. Not ideal.I want to replace the switch with an electronic switch. During shipping the switch is off, disconnecting the battery. When the device is put on a wireless charger, the device LDO receives power and boots the processor. During boot, the processor sets a GPIO high, enabling the device. During sleep, the GPIO stays high, keeping the battery connected. If needed, the device can get back to "disconnected" with a remote command setting the GPIO low.Below is the relevant part of the circuit (VCOIL is from the wireless power circuit)I was thinking of using something like a NX3V1T384 for the electronic switch, but it's obsolete. I could use a NX3L2T66GT, instead and waste one of the two switches inside. The rest of the circuit only uses a max of 10mA, so that switch should be more than capable of handling the power. And the Ron is low enough to not be a power waster. The battery gets charged without using the switch (and in any case it's a <10mA charge)Is there a better way to do what I want, possibly using a mosfet as a switch? Any potential problem with the circuit I plan to use?

author: CountChocula
author_rank: Unknown
timestamp: March 04, 2023, 07:19:41 pm
content: Have you considered using a logic-level p-channel MOSFET? If you pick something that has a very low Rds(on) at -VBAT, you can tie its gate high with, say, a 100kΩ resistor to VBAT, and then pull it down with your GPIO when you want to turn on the device. It should be pretty inexpensive and easy to implement, and you can easily find both SMD and THT components that fit the bill for ~pennies.

author: robca
author_rank: Frequent Contributor
timestamp: March 04, 2023, 08:16:56 pm
content: You mean, something like the below?That is betterthanks so much. I always think in terms of logic, never discrete components. From a quick search, something like the DMP1055USW would meet my needs (48mOhm at 4.5V), and a similar footprint to the obsolete NX3V1T384. Might even be able to find a SOT523 footprint

author: CountChocula
author_rank: Unknown
timestamp: March 04, 2023, 09:23:08 pm
content: Quote from: robca on March 04, 2023, 08:16:56 pmLooks like SOT-523 should be no problem…plenty of choiceat Digikey

author: robca
author_rank: Frequent Contributor
timestamp: March 05, 2023, 01:20:30 am
content: Actually, I just realized that this won't workWhen the battery is disconnected, this last circuit will feed the LiPo voltage into an unpowered GPIO pin. On the processor I'm using, that leads to the ESD diodes conducting and draining the battery.Is there a way to use "positive logic" with a mosfet? Pull down to GND when unpowered, switch off. GPIO to logic high to enable the switch? I know I can use additional components, but I get back to the option of using an electronic switch rather than a lot of extra componentsI tried using a n-channel mosfet in simulation, but it doesn't work (I'm sure I messed things up: I'm mostly a programmer, not an electronic engineer)

author: CountChocula
author_rank: Unknown
timestamp: March 05, 2023, 02:19:22 am
content: Quote from: robca on March 05, 2023, 01:20:30 amWell, as far as I can see, you would have this problem even with a bilateral switch like the NX3V1T384, since its enable pin is active low (the NX3L2T66GT, on the other hand, might work, because its enable pin is active high). The issue here isn't so much the current drain—with your 1MΩ resistor, even if the GPIO pin is shorted to ground, it would only draw less than 5µA—but rather that, if the GPIO is always grounded, the battery supply would always be activated, negating the presence of the MOSFET in the first place.You could simply use an additional n-channel MOSFET to invert the input at the gate of the p-channel MOSFET, thus making your circuit active high. I attached a rough schematic at the bottom; note that, if you can guarantee that your GPIO pin will always default to ground when your MCU is unpowered, R2 is not required.I hope this helps!

author: robca
author_rank: Frequent Contributor
timestamp: March 05, 2023, 02:26:00 am
content: You are right, I didn't realize that the NX3V1T384 is active low. Since that device is obsolete, it was not an option anyway, so i didn't read the datasheet. I used the NX3L2T66GT in another project, and that works well for an application like this, even if it's a dual switchThanks for the additional circuit. I was playing with the idea of adding another mosfet, but I didn't get it to work. Your circuit would work.I need to evaluate the cost/PCB real estate of both solutions, and see which one works best.Really appreciate your help, thanks!

author: CountChocula
author_rank: Unknown
timestamp: March 05, 2023, 02:28:23 am
content: You bet—good luck!

author: geggi1
author_rank: Frequent Contributor
timestamp: March 05, 2023, 07:46:28 am
content: Why dont you jut disconnect the battery physically?If it is a cell type battery in a socket, just put a tape on one of the poles.If it is plugged in to the device unplug.If soldered and the device is "prepared" at some kind of service senter you can put in a solder bean or use a dip switch.

author: robca
author_rank: Frequent Contributor
timestamp: March 05, 2023, 04:15:55 pm
content: Quote from: geggi1 on March 05, 2023, 07:46:28 amIt's a sealed device, waterproof, with a rechargeable battery. There's no servicing, and a switch presents too many problems to the design goals.