Battery Timer Circuit Help - Page 1
Forum section: electronics / beginners

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 09:45:03 am
content: Hello there,I have a circuit that consumes too much current when it is in sleep mode. This circuit has a battery input for a 3.7V LiPo battery which is what I have been using, the voltage on that battery input cannot be any larger than 3.7V, but I need a much larger capacity battery to suit my application. Fortunately, the circuit has another power input for voltages between 5 - 7 V which is great because I can get much larger batteries in this voltage range. However, this voltage must be regulated and because the circuit consumes too much sleep current for my application, I would like to design a separate circuit which can switch on and off the main circuit completely, rather than putting it to sleep.I have been thinking that I could use a 3.7V battery ( I have a few around), to power an RTC (I'm not a big expert on them), when it wakes up after 5 minutes say, it will apply a signal to the gate of a p-channel MOSFET which will switch the larger capacity, higher voltage battery on, then to a regulator before it connects to my circuit power input. I have included a diagram below of what I was thinking and would really like some help to get this circuit, or a suitable circuit working for my application, low power consumption is the goal. Any help and / or feedback would be most appreciated, thank you.

author: ledtester
author_rank: Super Contributor
timestamp: January 12, 2023, 10:16:26 am
content: What exactly is your circuit?There are low-power timer chips which are designed to periodically turn on power to another sub-system, for example the TPL5110:https://www.ti.com/lit/ds/symlink/tpl5110.pdfYou can find more related devices athttps://www.ti.com/clocks-timing/real-time-clocks-timers/overview.htmlThe TPL5110 is designed to consume only nano-amps. If you are ok with consuming microamps I'm sure one could be made out of standard CMOS logic ICs.Another approach is to use a small MCU (like an ATtiny85) as the power control device. They can be programmed to consume power in the low microamp range. Here is an example project:https://www.instructables.com/3-Minute-Game-Timer/(See the comment section at the end about disabling brown-out detection to get ultra-low power consumption.)

author: Ian.M
author_rank: Super Contributor
timestamp: January 12, 2023, 10:30:34 am
content: You can get as much battery capacity at 3.7V as you want by paralleling LiPO cells. There are however a few cautions - they *MUST* be exactly the same type and at the same state of charge at the moment of first connection, and *SHOULD* have the same usage history. Once connected they should be treated as a single unit and charged in parallel. Also, if your circuit has a charging function, and you cant increase the charging current to suit, it may be impractically slow charging a many times higher battery capacity.

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 11:08:03 am
content: Thank you very much for your reply ledtester. That information is very helpful, I really like the sound of the TPL5110, I wonder if the is a through-hole equivalent or if I could solder that to a prototype strip board.Yes that looks like a really good component, thank you for the information. Only thing is that device and others I’ve just found, only take a voltage of 5.5 V max but I have just looked for batteries with high capacities and the larger capacity batteries are 6V. Could I have a lower voltage battery connecting to the TPL5510, like my 3,7V and connect a higher battery to be switched in ?

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 11:08:57 am
content: Thanks very much for that information Ian, very helpful indeed

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 11:25:13 am
content: Ah, on further inspection of the datasheet, it says the maximum voltage is 6 Volts. Thats good then because I have found a 6V LiPo with a 12Ah Capacity. I will just draw a schematic and see what you think. I will also need a low power voltage regulator for my 6V battery, what do you think of this one ?

author: Ian.M
author_rank: Super Contributor
timestamp: January 12, 2023, 11:46:14 am
content: A fully charged '6V' LiPO is 8.2V. I expect your circuit will 'elect a pope' (aka: 'let the magic smoke out')

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 12:02:50 pm
content: What about this schematic I've attempted and attached? . I have two 3.7V LiPo batteries in parallel, individually they are 3600mAh so should give 7200mAh. Connect this to the TPL5110 switching on that voltage to a regulator (link above). Is that MOSFET a P-Channel. I am a bit confused because that part of the diagram is taken from the application notes herehttps://www.ti.com/lit/ds/symlink/tpl5110.pdfusually if its a p-channel a low signal on the gate will switch the source voltage over to the drain. But does not look to be the case.

author: Ian.M
author_rank: Super Contributor
timestamp: January 12, 2023, 12:10:07 pm
content: My advice is forget about electronics and take up finger-painting, as I've seen clearer schematics drawn in biro on the back of a napkin after several pitchers of beer!Hint: Just about all paint apps have an erase tool and a straight line tool . . .Also, don't use punctuation immediately after a URL, as the forum's auto link generator doen't like it!

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 01:02:49 pm
content: Thanks Ian, finger painting sounds a lot simpler.

author: Ian.M
author_rank: Super Contributor
timestamp: January 12, 2023, 01:11:09 pm
content: The problem is: If you draw blobby lines with a brush tool, don't erase unwanted lines, and don't identify components, (e.g. that blue rectangle), its very hard to make sense of your circuit.Incidentally, that's *NOT* how you connect a P-MOSFET as its body diode will conduct all the time.

author: Peabody
author_rank: Super Contributor
timestamp: January 12, 2023, 03:37:11 pm
content: Can you provide more information about your circuit - what parts are involved, and if possible a schematic?Also, please note that the output of the TPL5110 is active low, which would be fine for a P-channel mosfet, but the EN input of the NCP161 is active high, so the polarity is wrong.And note that the maximum voltage of both the TPL5110 and the NCP161 is 5.5V. What batteries in the 5-7V range are you considering?Perhaps there might be a way to get your circuit to consume less power when sleeping.

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 04:16:54 pm
content: Hi Peabody, thanks for your reply.I have an Arduino WAN 1310, connected to 7 different sensors. I tried putting it into sleep mode and was getting mA of sleep current. I spent a lot of time going through each sensor one at a time and examining the current consumption during sleep and the amount was not acceptable. I configured the pins and software as the manufacturers suggest but something is still on that shouldn’t be. I am waiting on information back from Arduino and the sensor suppliers. In the meantime the best solution is just to shut off power altogether. The datasheets for the timer and the regulator say the max values a 6V.Ah, I see what you mean about the active high input on the regulator. I wonder if I could invert the gate signal somehow from the MOSFET so that it is active low for the timer but high for the regulator. I have gone off the 6V , 12Ah battery as this was a lead acid batter from Farnellhttps://uk.farnell.com/yuasa/np12-6/battery-lead-acid-12ah-6v/dp/174774, I think I will parallel two 3.7V batteries each 3600mAh.

author: Ian.M
author_rank: Super Contributor
timestamp: January 12, 2023, 04:44:55 pm
content: A fully charged and rested 3 cell ('6V') Lead Acid battery can be expected to have a terminal voltage of about 6.4V, so is unsuitable for powering anything with a 6V abs. max. limit. Also they are an old technology that's deeply user unfriendly - leave one fully discharged for 24H and it will loose a significant proportion of its capacity, leave it a week and you have killed it - at best *IF* you can get it to take and hold a charge again it will have less than half its previous capacity. Additionally their self-discharge is typically around 4%/month, so always fully charge them before storage, and they have a shorter life than nearly any other battery technology.

author: Peabody
author_rank: Super Contributor
timestamp: January 12, 2023, 06:55:16 pm
content: I've never used the WAN 1310, but it appears it has a built-in battery charger for a 1S lithium cell. So is that what you're doing now - plugging the battery into the 1310? If so, how are you measuring the sleep current?Well, without knowing more about your circuit, it's hard to suggest how you might reduce the sleep current. If you are powering a sensor from a GPIO pin, you can just bring that pin low to shut off power to that sensor.Are you able to test the sleep current if the sensors are not present? That might tell you whether it's the sensors or the Arduino that's drawing current.

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 07:21:32 pm
content: Thanks very much for your reply 😃.I have two I2C sensors, and so they use the SDA and SCL pins of the arduino. They are powered from a p-channel MOSFET, whose gate connected to pin A4, the source is connected to the Arduino Vcc and the ground is connected to the Arduino GND. When A4 is low, it turns on the MOSFET and supplies power to the I2C sensors. When A4 is high, it removes power to the sensors. I am getting about 400 uA of sleep current, which is too much for my application.The Arduino is powered from a 3.7V LiPo battery.With a simple sketch, turning on and off the on-board LED and putting the Arduino to sleep, I get 69uA. That is only if I use Serial1 (to print some statements) whilst having the Tx and Rx pins and Ground, connected to a USB to serial cable (I read the print statements through this cable into PUTTY).If I run the same simple sketch using Serial1, but, if I disconnect the tx from the Arduino, I get a much bigger sleep cuurrent of 400uA.If I connect my I2C temperature sensor to the Arduino, run a sketch to measure the temperature and then go to sleep, I get 53uA of sleep current BUT only when I use Serial1 AND the tx and rx pins are connected to my PC through the USB to Serial Cable.If I run the same scetch for the temperature sensor, again using Serial1 but disconnecting the tx wire, the sleep current jumps to 190uA.I have tried externally pulling up and down the tx line but this does not do anything. In practice I cannot change the hardware as I have the circuit boards already made. There seems to be some issue with the tx line drawing too much current when nothing is connected to it.When I add and additional I2C sensor, so the Temp sensor and a Light Sensor, the sleep current goes to 1mA, adding more I get 5mA which is far too much. Something is not being turned off within the Arduino that needs to be turned off. I need a way to shut down the I2C and the TX and RX pins,

author: ledtester
author_rank: Super Contributor
timestamp: January 12, 2023, 09:25:15 pm
content: Seems like you want to cut power to your sensors when the MCU goes to sleep.This thread has a discussion of the problem:https://forum.arduino.cc/t/solved-how-to-keep-i2c-lines-from-powering-up-other-devices/617389One solution mentioned is to use an I2C bus isolator.For a simpler approachI wonder if this idea would work:The switch would likely be implemented with a P-MOSFET and the resistors represent the I2C pull-ups. The idea is to prevent the sensor from getting power through the SCL and SDA lines when Vcc is disconnected.

author: Dicko
author_rank: Contributor
timestamp: January 12, 2023, 09:47:56 pm
content: Hi ledtester, thank you very much for your idea. It’s a good one. However, I really like your original idea of cutting power to the board altogether with the help of the TPL5111. I am trying to figure out if I actually need a voltage regulator at all. I am trying to find it on the schematics for the Arduino, I am looking to see if there is a voltage regulator already connected to the battery terminal, but having trouble seeing ithttps://docs.arduino.cc/static/16c3cc56c1a31a199cb5c41b128a0b48/schematics.pdfIf it does have one, I was thinking, could I parallel up two 3.7V batteries (for which the battery input is rated for anyway) use that to power both the TPL5111 and my circuit. I could have the parallel connected batteries supplying the source of a MOSFET, the gate will come from the TPL5111 and when activated the MOSFET will switch the battery voltage to the drain and I will use the drain as the positive input to the battery terminal and the negative of the parallel connection as the negative to the Arduino and hopefully this will be regulated on-board the Arduino. My questions are, would this work? And, would I be loosing a lot of current if I powered the transistor from the same battery as the TPL5111. I’ve attached a quick sketch.

author: Peabody
author_rank: Super Contributor
timestamp: January 12, 2023, 10:58:34 pm
content: I agree that ledtester has the right idea. But note that the TPL5110 has an active low output, which you would use for the P-channel mosfet, but the TPL5111 is active high, which is designed to be used with an ENable pin that's active high.I expect that some of the sleep current problem relates to the I2C lines and their pullup resistors, but at this point I think the easiest solution is just to switch the whole circuit on and off. However, sleep current aside, if you have several modules using I2C, and if each one of them has its own pullup resistors, the combined parallel resistance can be too low, and lots of current can flow when SDA and SCL are active. The same problem might affect the other serial lines.Here's a good video on the TPL5110:Note that your Arduino will have to signal the TPL5110 when it has done its work and is ready to have the power shut off.If you need precise timing, or varied timing (such as turning it off at night), you can do the same thing with a DS3231 real time clock module, which could run from its own coin cell. But you would need yet another I2C connection for it so you could set the next awake time. The TPL5110 is easier if it works for you.Edit: Your 1310 does have a 3.3V regulator on board. it's at the top of the second page of the schematic.Also, how do you recharge the battery now? Is that done through the Arduino?

author: mariush
author_rank: Super Contributor
timestamp: January 12, 2023, 11:21:17 pm
content: You may want to consider a different approachThere are ICs which have 2 power inputs and a single output ... with automatic switch between sources. For example, input 1 is DC in, input 2 is battery... when chip receives power on dc in, it switches automatically from input 2 to input 1I wrote a post for someone about such chips in December :https://www.eevblog.com/forum/projects/lm1117-or-circuit/msg4572976/#msg4572976You could have something like :DC In (let's say 5v-12v) ---> power switch ic -----------------------------------------------------------------------------------------------------> dc/dc converter to 3.3v or 3.6v --->/(connection from DC In ) ----> (optional step-down regulator) ---> charger IC ---> battery (3.7v... 4.2v ) ---> power switch IC -optional step-down regulator is if you want to accept more than 5v on DC In and you use a cheap linear charger IC with max input voltage something like 5.5v-6v, then you'd want to protect the charger IC.this setup however would also allow you to use 2 lithium batteries in series and a 2S charger IC if you want to use DC In with at least 9v input (because you'll have 4.2v x 2 + ~ 0.5v or so required to charge)There are also charger ICs with power pass through feature, so you can charge the battery while also powering product from DC In, but usually they're expensive.With the above design, the power switch ic automatically disconnects the battery from arduino, so the charger IC won't get "confused" by pumping energy into the battery and not seeing any change because the product sucks that energy right away.

author: Dicko
author_rank: Contributor
timestamp: January 13, 2023, 07:23:30 pm
content: What a great reply, very informative. I love the video! I think the 5110 is the way to go!

author: Dicko
author_rank: Contributor
timestamp: January 13, 2023, 07:25:58 pm
content: Thank you very much for thanking the time to provide this very informative suggestion. I will definitely consider it for future projects, I think the 5110 is the way to go here.