Ants, in any form, are an unpleasant sight. Carpenter ants are doubly troubling because they make their nests in the foundations of homes. Despite their name, carpenter ants do not eat wood, but they can weaken it as they tunnel through it. A way to prevent ants from invading your home is to surround it with plants that repel them.
Both peppermint (Mentha --- piperita) and Spearmint (Mentha spicata) are good at repelling ants as well as moths, flies, mice, fleas and aphids. Mint is also said to improve the flavor of plants in the cabbage family--which includes broccoli, Brussels sprouts, kale, cauliflower---when planted next to it. Mint prefers full sun and soil that is rich and well-draining. Peppermint is hardy in USDA Zones 3a to 7b, while spearmint is hardy in Zones 4a to 11. Mint grows to a height of about 12 to 18 inches high and can be invasive if not controlled.
Tansy (Tanacetum vulgare) repels a variety of pests, including ants, mosquitoes, Japanese beetles, striped cucumber beetles, flies, Colorado potato beetles, moths, mice, flea beetles, cabbage worms and squash bugs. Tansy is a perennial that is hardy to USDA Zone 4. It thrives in full sun but can survive in partial shade. It can be invasive if not controlled and, when full grown, looks like a 3- to 4-foot tall fern. Tansy can be toxic but makes a good companion plant when grown near cucumbers, squash, roses, grapes, raspberries or blackberries.
Rue (Ruta graveolens) is a small---about 2- to 3-feet high---evergreen shrub that is good for repelling ants, cats, fleas and Japanese beetles. Plant it around your garden and home to keep ants from entering. It has long leaves and produces small yellow flowers during the summer. It thrives in poor, sandy soils and is hardy in USDA Zones 4 through 9. Because some people are allergic to it, caution should be taken when handling rue. It is a good companion plant for roses, raspberries and fruit trees but should not be planted next to basil or cucumbers.
There are two types of pennyroyal: European pennyroyal (Mentha pulegium and American pennyroyal (Hedeoma pulegioides). Both are believed to be good for repelling ants, fleas, aphids, ticks and cabbage maggots. European pennyroyal is a perennial herb that prefers partial sun and a heavy, moist soil. It is considered an invasive species in some areas. American pennyroyal is an annual plant that prefers full sun to light shade and a rocky or loamy soil. Both species grow about 12 inches high and produce purplish flowers in the summer.
Lavender (Lavandula species) is known to repel ants, flies, silverfish and fleas as well as attracting people with its sweet smell. It grows about 12 to 18 inches high and produces clusters of small purple flowers. It prefers an area with full sun but will tolerate some shade with a light, well-draining soil. It is hardy in USDA Zones 5a to 9b.