To simplify the outside design as much as possible (keeping it simple to use and less expensive) I would like to use just one small 2-pin connector both as output to drive an external led and as 5V input that would charge the internal battery via a tp4056 lion charger IC.
I have some basic knowledge of electronics but not enough to determine how to separate the in and output from interfering with each other. Would this be possible? If yes, could anybody give me some help/hints with this?
The answer Theamk gave made me thinking...
+Batt = 3.7V
When Arduino port is high (3.3V) Q1 and Q2 open (Led on) and Q3 closes preventing feedback from +bat to the VCC pin of the charger IC. (R4 is a pullup for Q3)
When Arduin port is low current Q1 and Q2 are closed (so no feedback from Vbat to VCC) and Q3 is open allowing current to flow from pin 1 of the connector to VCC of the charger IC.
Only thing is when the arduino port is high and the connector is used for charging nothing happens (5V from connector is higher than +bat so no flow through D1 and Q3 is closed) untill the arduino port goes low.
The diodes prevent: D1 prevents current from 5V charging to +bat D2 prevents the solar panel from backfeeding Q3 D3 prevents backfeed to the solar panel
Could anybody confirm if it indeed works like this? Thx!! (and if it should work which resistor values of R1, R2 and R4 and transitor types (SMD) I could/should use (LED is max 100 mA) )