Renewable energy is an alternative type of energy that can be used continuously without fear of environmental pollution. One of the things that can be used to get new renewable energy is using solar panels where later the electrical energy produced will be stored in batteries. A part from the advantages of a battery that can store electrical energy, but if it is used excessively and causes the battery to experience a deep discharge condition, steps are needed to over come it.This study uses the Particle Swarm Optimization method as an auxiliary method. And in this research it has been found that the auto switch system can charge battery 1 and battery 2 when the voltage level is below 11.88V or the DoD is already at 55% and stops charging when the voltage level is above 12.86Vfor battery 1and batteries 2.