Follow these guidelines when grounding an electric fence.
Use galvanized steel or copper rods; 3/4-inch galvanized water pipe works well. Drive them at least 8 feet into the ground.
NEVER use any area within a barn foundation; stay at least two feet outside all footings.
Use #12 copper electrical wire to connect the fence charger to the ground rod(s).
Do NOT use discarded telephone wire for connecting ground rods; it is much too light to deliver the proper current.
In very dry, frozen, or rocky soil, use more than one rod—preferably three or four, spaced at least three feet apart. Connect all the rods together electrically using #12 copper electrical wire. Be sure to clean the tops of the rods before making connections and use proper clamps to connect each wire to its rod.
If you are installing a multiple strand fence that has one or more grounded wires, use a three or four-foot ground rod every quarter or half mile along the fence. Connect the lowest grounded fence wire to this rod using #12 copper electrical wire