There are two ways of doing this. One is with an isolator and the other is with a relay. Both have been discussed at length on this board.
have a look here for a basic overview of the two setups. http://www.bcae1.com/battiso.htm
If you search the forum, you will find heaps more info