Look up a product called a demon controller by phil Johnson. He has very detailed wiring diagrams that should just about answer all of your questions.