I need an Arduino based lithium battery tester that uses N channel Mosfets to switch On charging from and external power source and discharging through a 2 Ohm resistor. I have no issues with either charging or discharging circuit schematic, however i can not combine them together. I'm attaching the schematic for discharging the battery into the 2 Ohm resistor, please help with adding the components for making it able to charge the battery from an external, let's say 4.2V power source, all controlled by Arduino.
I also need to have a state when i'm Not charging or discharging so i guess for that purpose i need to use Pin 11 on Arduino