I want to charge a battery my power supply is 6V , I Need to add a battery to my circuit and need to charge it for a long time. should i add a switch in series or in parallel to the diode? this is my schematic :
To charge a battery the charging voltage MUST be at least as high as the maximum voltage that you wish the battery to be charged to.
In this case, if the "7.4 V" battery consists of 2 x LiIon or LiPo cells then the minimum voltage for normal charging is 2 x 4.2V = 8.4V as a LiIon or LiPo cell is usually charged to a maximum of 4.2V/cell.
Connecting a 6V supply to a 2 cell LiIon battery will discharge the battery to 3V/cell which is about fully discharged. Adding a diode as shown will discharge the battery to ABOUT 6.6V and not charge it at all. Reversing the diode polarity will not charge the battery as the available voltage is then 6V-Vdiode = 6V-0.6V =5.4V = 2.7V/cell.
This is at the very bottom end of the cells' discharge range.
IF you wish to charge a 2 cell LiIon or LiPo battery you must have at least 8V, and usually more like 9V available AND MUST have a proper charge control circuit.