Powering my Arduino Project

I have an idea of how to power my project with both a 5Vin (from a 5VDC wall plug) and a battery as well. The idea is that the battery is a permanent rechargeable battery. When plugged in the battery will charge and the device will work off the 5Vin. When not plugged in, the battery will power the device. I think essentially, I want an UPS module...I think?

I don't know what chip to use. I have found that the TP4056 is a possibility but that it isn't great because you shouldn't charge the battery and power the device at the same time. Is there an alternative to the TP4056 which can handle acting as an UPS?

something like this would get you going possibly if you were to use 3.7V LiIon/LiPoly battery.

There is a built-in load-sharing battery charger circuit so you can keep project running even while recharging the battery.

You can use that with a pololu-power-switches for example and the Arduino when done can even switch itself off if that's needed.

The basic circuit to produce a 5V supply would include a charger, a load sharing circuit, and a boost converter:

Load current is always supplied by USB when it's connected, and by the battery when it's not. So the charger never supplies load current.

A low-cost module that includes these functions, and even the 18650 battery holder, would be one of these:

https://www.aliexpress.us/item/3256805528052225.html

It comes in 5V, 9V or 12V output, with or without the battery holder. The one I have has a microUSB input port. The output does not have a USB connector, so you would need to solder wires to it. The module is good for about 1 amp of output current, and the charge current is set to 1A, so your wall wart would need to be able to supply at least 2A.

I had to make two changes to mine to get it to work. The first was to install a switch (which you need anyway) just ahead of the boost converter. Or, they provide pads you can solder-blob across if you don't want a switch.

The second mod was to install a capacitor across the input. It doesn't charge properly without it. I tried a 0.22uF film capacitor, which seemed to work, but I think what it nominally wants is a 100uF electrolytic capacitor like the other such caps on the board.

They mistakenly sent me the 9V version, so I also had to change out one of the resistors, but you shouldn't have to do that. But check the output voltage before you connect anything to its output.

Here's its schematic:

There is also a two-cell version (parallel), but it doesn't provide for a switch.

Edit: It looks like the one I linked to actually has a USB-C input socket.

1 Like

I believe you can also get a power bank that will do what you want. I have a china one about 5 years old still going strong. I have no clue as to who made it, there is no identification on it.

The problem with power banks is that they shut down when load current drops below a certain level, and it's not a tiny level - it can be 50mA or more. Making sure that doesn't happen can be a real hit to battery life. The "UPS" designs don't have that problem.

I got around that problem in an emergency job, got the controller via a MOSFET and load resistor to pulse the power bank output with 50ms, 75mA pulses every couple of minutes.

Worked for the job which was for 6 hours continuously at a time and the power bank was big enough to carry the project.

Tom.... :smiley: :+1: :coffee: :australia:

1 Like

Nice !

How did you figure out the minimum load and timeout? Guesswork or was it documented somewhere?

Guess work, just a UNO and MOSFET and load and did some trials.
Thing is not all banks will work with the same load pulse.
I did 100mA first and worked out the time period, then trimmed the current.

At the time it was worth the effort until the customer got power to the location.

Tom.... :smiley: :+1: :coffee: :australia:

1 Like

way to go when there is no datasheet :slight_smile:

If a power bank shuts down because of low load current, how does it start up again? What does it measure to know it should start up?

You don't let it get to shutdown, you pulse the supply before shutdown to reset the banks "timer" and keep it ON.
That is why you need to EXPERIMENT to get it right.

Tom.... :smiley: :+1: :coffee: :australia:

Some power banks are started by a button.

I guess mine is either damaged or a different design. It does not shut down. You could try one of those Flashing LEDs and see if it will keep it alive. 1 resistor 1 LED simple circuit.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.