Powering from Li-Ion and USB?

Hello, I have a project that could be powered from USB and, if USB is not available, from a Li-Ion accumulator (maybe connected via powerbank module to ensure stable Vcc, proper accu recharge and accu OC and UV protection).
In Uno, there is a switch that disconnects USB power if Vin is sufficiently high. Unfortunately, this is not my use case:

  • accumulator should be the "primary" source, and be disconnected when USB comes in (the Vin switch follows the opposite scenario - USB is primary and will be disconnected if Vin is present)
  • it is unacceptable to boost accumulator voltage up to +7 V from 3.7 V just to burn half of the power in an LDO to supply 5 volts to the MCU
  • last but not least, my project uses Nano, not UNO. And, since it is supposed to be a kit, there is always end user's option that they would plug in some other clone of Nano, e.g. the Chinese "Nano" with LGT8F328 and micro USB connector (BTW, did anybody else start manufacturing Nano with other than the obsolete USB mini?)

What would you suggest? Is there a way, in Nano, to detect USB power input before it has reached 5V pin, and instead use a switch to supply 5 volts from the accumulator directly to this pin and coexist with the USB bridge safely?

Thank you,
Jindra

The Nano has a Schottky diode between the USB power input and the "5V" pin. So if you use a boost converter to produce 5V output from the battery, you can connect that to the 5V pin, and it would always power the Nano because of the diode, and there should be no conflict with USB. When the battery eventually discharges, USB will take over if it is connected. The LDO would never be involved in either case.

I don't know about Nano versions. The ones I have are clones, and have mini USB connectors. I got mine from Banggood, and have had no problems with them.

1 Like

Nano has a reverse polarity protection Schottky diode between VUSB and 5V bus, therefore, 5V bus is only about 4.7V. No problem plugging in USB cable when running on 5V through the 5V pin, I do it all the time, just remember, Nano will restart when you plug in USB, but that can be bypassed if needed.

1 Like

Take a look at Adafruit's Feather Arduino-compatible modules. Some are already set up for LiPo battery backup and have an on-board USB-powered charger for it.

For example Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0 : ID 2772 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits