Have questions about FETS, transistors, measurement, power supplies, or anything else electrical?

User avatar
By Jakub Kubny
#91974 Hello,
In my ESP8266 project, I would like to have one universal USB interface for a battery charging and also for serial communication and firmware uploading.

The ESP8266 is powered by a Li Ion cell and I've got a following thought: When I connect the device to a (for example) mobile charger, it would be nice, if a cell starts charging. And also, when I connect the device to a computer using same USB interface, it should be possible to upload new firmware or debug the device using a serial monitor.

Is this setup possible and how to do that?

Thanks.
User avatar
By Inq720
#94155
Untitled.png
Jakub Kubny wrote:Hello,
In my ESP8266 project, I would like to have one universal USB interface for a battery charging and also for serial communication and firmware uploading.

The ESP8266 is powered by a Li Ion cell and I've got a following thought: When I connect the device to a (for example) mobile charger, it would be nice, if a cell starts charging. And also, when I connect the device to a computer using same USB interface, it should be possible to upload new firmware or debug the device using a serial monitor.

Is this setup possible and how to do that?

Thanks.


You have several options...

(1) With these type of boards you can charge your battery and power your ESP at the same time. This one is a WeMos shield. However, it has a separate USB input. I don't think these create a pass through for USB programming.
Untitled2.png


(2) Get a dedicated board that does both. It has only one input, so I would have to assume it both charges and programs.
Untitled.png


(3) Not being a hardware guy... I could not recommend how to build a circuit external to an ESP board that could do both, but I'd bet it is possible.

(4) Simply connect the USB cable for powering/charging only and use OTA for your programming needs.
User avatar
By Inq720
#94416
PaulRajeshMEzra wrote:The possibility of charging while functioning as a USB host is entirely dependent on implementation details of the tablet you are connecting to. Absent those details, this falls under the category of usage-of-consumer-products topics which do not qualify as Engineering questions fitting the mission of this site. External host solutions (aka Android "Accessory Mode") might be an option, but only very specific questions fully supported by engineering details would be on topic here.


Who died and made you a moderator. Jakub Kubny's post is entirely valid. He mentioned nothing about Tablet, Android, or Accessory Mode and you obviously don't know what you're talking about. Frankly, you sound like an experimental AI like https://ai-writer.com/ that has run amok and is spitting out invalid and frankly ignorant information.