Electronic – Controlling direction of current flow through pin depending on the type of device connected

battery-chargingbidirectionalconnectormosfetreverse-polarity

I have a small portable device – lets call it MASTER – which can be inserted into two different accessories – CHARGER and SLAVE. You can check very rough block diagrams in the attached picture.

diagram

MASTER has 40mAh LiPo battery inside with nominal voltage around 3.7V (but of course during usage it's something between 3 and 4.2V). This voltage is further regulated to 1.8V. That is the voltage that is used by MCU.

MASTER has 3 pins/pads that extend outside the MASTER’s enclosure. They don’t extend much but user can definitely touch them or short them otherwise.

CHARGER and SLAVE have spring fingers (something like this http://www.te.com/catalog/products/en?q=2199001) that form a contact when MASTER is put inside.

DATA pin is used for single wire SLAVE/CHARGER identification. The memory with ID is parasitically powered so it can be read even when battery is not connector to the SLAVE. MASTER can easily determine if the connected accessory is SLAVE or CHARGER.

Everything else on the SLAVE (except memory) must be powered from MASTER’s BAT and GND pins because SLAVE has no battery.

But also MASTER’s battery must be rechargeable through BAT and GND pins.

Which finally gets us to the problem – Is it possible to supply voltage to the SLAVE and also recharge MASTER’s battery using only single pin? And of course without possibility to short-circuit the MASTER’s battery and other components.

NOTE: Supplying voltage to SLAVE and recharging MASTER will NEVER occur at the same time, these are completely separated events.

Now some ideas I had but was unable to implement (probably because I'm too stupid :)):

  • You can use identification on SLAVE/CHARGER to “open” supplying/charging paths of circuit, but consider that charging the battery MUST be possible even when battery is completely drained and cut off.
  • Using some MOSFET/transistor magic to recognize type of accessory (SLAVE or CHARGER).
  • Cut off the BAT pin from battery when overcurrent is detected. But fast – resettable fuses are not fast enough. Also relay or SSR relay is not suitable because of its size.
  • Last idea was to use 4 pins instead of just 3. This should be the last resort. If you guys tell me it cannot be done with only 3 pins, I'll ask new question.

Thank you all in advance!

Best Answer

You are making this too difficult. All you need to do is a battery switch that will disconnect BAT line when no accessories are plugged in. This is trivial to do with a single MOSFET (it will have a protection diode, so make sure you connect it such that you cannot discharge the battery when MOSFET is off). A microcontroller should open the MOSFET when device is plugged in, and then it will be virtually indistinguishable from the wire.

Your only concern left is what happens when battery runs down. Well, in this case the MOSFET's protection diode will help -- it will allow some limiting battery charging even when MOSFET is off. It will not allow full charging due to voltage drop, but it does not matter -- the moment the battery has just a bit of power, MCU will start up and open the MOSFET.

Related Topic