simple battery protection for 3xAAA vs USB - Page 1
Forum section: electronics / projects

author: djacobow
author_rank: Super Contributor
timestamp: May 22, 2019, 04:47:27 pm
content: I've got a simple device that needs to be ultra-cheap. Think holiday decoration. It normally runs from 3xAAA batteries and runs fine on 4.5V. I'd like to add USB power to it, but want to make sure the batteries don't see the USB voltage and start to "charge" (It is not my intention to make a rechargeable device and these would be normal alkalines in most cases.)I've came up with the circuit attached, but I see nowit won't work properlybecause the body diode of the transistor will conduct current from USB power back to the battery. The effect is small when the batteries are new, but is big when the battery is partly discharged.I probably would not use the transistor shown. Most likely would use a DMP1045, which is already in the BOM.Anyway, trying to keep things cheap. I could ask people to remove the batteries when using a USB supply, but I am 100% sure that will result in hot, leaky batteries and unhappy users.

author: schmitt trigger
author_rank: Super Contributor
timestamp: May 22, 2019, 05:40:28 pm
content: I've succesfully used an identical circuit since 1999, but I used an IRF7205 in a SOIC package.But the drain-source must be reversed, otherwise the intrinsic body diode may conduct under certain situations.Haven't checked your Mosfet specs. Just make sure that it is fully enhanced at VGS= -4.5v

author: NiHaoMike
author_rank: Super Contributor
timestamp: May 22, 2019, 05:47:27 pm
content: As stated, flip the MOSFET around. You can also use a regular diode rather than a Schottky, in order to cut cost and/or use the voltage drop to your advantage.

author: djacobow
author_rank: Super Contributor
timestamp: May 22, 2019, 06:12:00 pm
content: That was it, folks! Transistor was reversed.Yeah, the transistor I will use is pretty hard on at -4.5V.

author: mariush
author_rank: Super Contributor
timestamp: May 22, 2019, 06:41:34 pm
content: Wouldn't two diodes work?For example PMEG2005CT (two diodes with common cathode per chip) , 20 cents each if you buy 100:https://www.digikey.com/product-detail/en/nexperia-usa-inc/PMEG2005CT215/1727-5188-1-ND/2531787

author: djacobow
author_rank: Super Contributor
timestamp: May 22, 2019, 06:46:44 pm
content: Quote from: mariush on May 22, 2019, 06:41:34 pmActually, one diode would work, as I have no concern about the batteries pushing current into the USB PSU. However, I want to maximize battery life, so don't want to take the voltage drop across the diode.

author: djacobow
author_rank: Super Contributor
timestamp: May 31, 2019, 09:26:52 pm
content: In case anybody googles this thread in the future, I thought I would just say that, depending on the nature of the diode in the circuit, the resistor values will not work well.What happened in my circuit was that reverse leakage through the schottky diode going into a 1 MOhm resistance was more than enough to raise the voltage at the gate of the transistor and turn it mostly off. This led to all sorts of weird behavior.If I replace that pulldown with a 10k, problem goes away, as the gate hangs near zero and the transistor stays hard on. The extra current through the resistor wastes a bit of power, but this only happens when the external power is applied, not from battery (well, except for that reverse leakage through the diode.)I love mistakes that I can fix without changing the board.

author: NiHaoMike
author_rank: Super Contributor
timestamp: June 01, 2019, 01:11:10 am
content: Just replace the Schottky diode with a regular one, in order to reduce leakage current. That can be of particular help if the device tends to be stored for long times.

author: djacobow
author_rank: Super Contributor
timestamp: June 01, 2019, 03:01:22 am
content: I might do that. It is slightly advantageous for me to change the behavior of my project when it is on battery vs USB power, and I thought i was being clever by measuring the voltage: 4.5V or less means battery, vs 5 minus the diode drop for USB. I don't need any other parts or a gpio pin. If I use a regular diode, the dead band between those basically goes away.Still, I hate it when batteries run down when a device is not in use, so I'll give this some thought.