I hope this is the right category to ask this question.
I am planning an attiny project for outdoor use. My plan is to include a 3.7V li-ion battery and a max1551 or max1555 charger ic together with an attiny85 on a a long and narrow pcb and seal it off with shrink tube so that it can withstand at least light rain and foggy weather(real waterproofness is not really a requirement)
The problem is that I would like to be able to reprogram the attiny even after the project is sealed and this requires the chip to be powered by the +5V supply from the programming arduino. The problem is that I would somehow have to disconnect the 3.7V battery from the circuit.
The easiest solution that I can think of would be to add a diode that prevents the current to flow from the +5V to the 3.7 battery. For some reason I doubt this will work.
Another option would be to use a pnp transistor to switch off the 3.7V signal, but I am not sure how to wire this up. I think that for a pnp transistor to allow current from emitter to collector it is not sufficient that the base is kept at 0V, it actually needs to be pulled to ground which means that in normal operation there will be a waste of precious battery power. Besides, it strikes me as strange that the base and the collector of the transistor would effectively be tied together... See the picture attached:
I have seem FET and MOSFET transistors and I suspect that these may be the solution but I don't understand yet how exactly they are different or how this could work.