Before installing an electric fence, check your county regulations to make sure you can use the fence in your area. Always purchase and install warning signs so that visitors to your garden will know about the fence and avoid it. You can purchase an electric fence kit from your local fence company. The fence is designed only to startle the animals, not harm them.
After each post is in the hole (Image 1), check the height and make sure it's level (Image 2). Then pour quick-setting cement into the hole around the posts (Image 3).
Once all the posts are installed, start assembling the wires that carry current through the fence. The first step is to nail insulators to each pole and secure it at the height you need (Image 1). Check the manufacturer's recommendations for your application. You can install two or three wires around the garden (Image 2). The lower wire will run just a few inches above the pickets; the top wires will help keep the deer out in case they try to stick their noses over the top of the fence. Run the poly tape through the insulators, going from one pole to the next to encircle the garden. You have to run separate wires if you have two levels of fence. Just be sure you start and end the wire where you plan to attach the power source (Image 3).
Once the poly wire is in place, connect the system to the power source (Image 1) and ground it with two metal rods (Image 2). You can use a solar-powered charger if you don't have electricity running to the garden. Attach the solar panel to the top of a fencepost, making sure it's facing the southeast to get the most sunlight.
Connect all the wires according to the directions in the kit and let the system charge (Image 1). Drive the two grounding rods into the ground and hook them to the solar panel. After the system charges, use the voltage meter to make sure all areas of the fence are getting power. Do not touch the fence with your hands unless the power is off. Post warning signs around the garden (Image 2).
Turn off the fence to add a deer deterrent called Deer Away. It's an egg-based product, and deer don't like the way it smells. Spray cloth strips with the Deer Away and tie them to the fence at 10' intervals. The smell will last for several months before you need to reapply. The combination of the electric fence and the deer repellant sets up a double-negative system. If the deer ignore the smell and approach the fence, they'll be startled when they touch it. Double-negative strategies work well against determined pests.
You can also install a motion-triggered water sprinkler. To install the sprayer, push the post into the ground; then point the sensor away from the garden. This way approaching deer will be squirted (and with any luck it won't spray you when you work in the garden). Attach a garden hose and turn on the water. The sprinkler senses movement near the garden and shoots a strong stream of water around the area to chase pests away.
If pests are a real problem in your area, you can also try motion-activated strobe lights; just make sure you tell the neighbors first. A rubber snake and a fake owl should keep out the birds and maybe even some mice. You have to resort to creative and varied ways to keep all types of pests away from the garden.