In my project I'd like to charge a LiPo battery and upload to an Arduino Nano via the same USB port. After some researching I found the Adafruit PowerBoost 500 which lets you charge a LiPo and output 5.2V at the same time. It also has a USB output. It seems perfect so far, the only information I can't find anywhere is whether or not the data pins of the input USB port are also connected to the USB output and could therefor be used for power and data transmission to the arduino.
Normally, you would power your project from connector X1.
The module is set up to pass power through to something like a cell phone to charge its battery. Notice the resistive voltage dividers on D+/D-. Those are there to tell the cell phone that there is a charger attached.
If you needed to connect data to your project, you would normally power it from X1 to its power connector and connect data through its USB port, leaving the 5V wire disconnected.
It is actually quite simple. There is an Arduino Nano which controls a few WS2812B LEDs via two buttons. It should be portable and I don't want to use normal batteries since they run out eventually and the whole thing is encased which makes swapping batteries too tedious. That's why I want to use a LiPo battery that can be recharged. From the outside the device should be as simple as possible, a few buttons/switches/LEDs and ideally a single USB port to charge and reprogram the Arduino if necessary.
I would power it using the X1 connector from power boost to the 5V pin on the Nano. You would charge the LiPo via the USB in connector on the power boost.
If you needed to reprogram your Nano you could do that via the Nano USB connector. I would probably temporarily disconnect the 5V in from the power boost. Alternatively, you could pass data through from the power boost USB in connector to the Nano USB connector via a cable that had the 5V wire disconnected.
I’m off to the dentist so if you don’t understand that maybe someone else can explain it or suggest a different approach or I’ll address it when I return later today.
@damoishere
I was looking at the PCB of the booster and attaching wires to USB D+/D- is going to be a real chore since they didn’t bring them out to pads. You may want to consider making a USB cable with a clipped 5V to plug into the Nano for programming from your computer. You would still power the Nano form the LiPo/boost out.
Yes, I planned on cutting a USB cable for the input, stripping the outer insulation and solder the wires to the corresponding places.
The only question I have left is what to do with the ID pin. As far as I understand it only has something to do with OTG stuff and I can leave it unconnected, right? Or does the arduino need it for something?
A side note for consideration: instead of using a nano if you were to go for an ESP32 you could configure it to support OTA and thus would not need this USB connection in the first place.
You could also use an usb breakout as the interface of your device (let you position things in the box where you want) and route wires more easily from there inside the box. Then any regular data + power cable will do
Thanks for the tip. I'll definitely use the USB breakout board but I think the ESP32 would be overkill for my use case but maybe in some future project.