Because they don't like the smell, you can use coffee grounds to deter cats from using your garden as a litter box. By regularly sprinkling used grounds (either wet or dry) in and around your garden, cats eventually will decide to find a new bathroom spot.
Humane deterrents are the best approach.... Smells that repel cats: To keep cats out of yards or gardens, plant the herb rue or sprinkle dried rue. Citrus or lemon scents (orange peels, lemon peels), garlic, ammonia, vinegar, coffee grinds, pipe tobacco, mustard, citronella, or eucalyptus all deter cats as well.
As a general rule, cats are sensitive when it comes to smells, but there are a few scents they hate that might just surprise you. They can't stand citrus and as much as you might love the smell of fresh herbs, cats hate rosemary and thyme. Banana and mustard are a big no-no too, as well as lavender and eucalyptus.
You can try orange and lemon peels (cats dislike citrus scents), the herb rue which can also be planted live, cayenne pepper, coffee grounds, pipe tobacco and various oils, including lavender, lemon grass, citronella, peppermint, eucalyptus and mustard.
Use scent to keep the cats away
Cats dislike the smell of rue, lavender and pennyroyal, Coleus canina and lemon thyme. Plant a few of these throughout the garden. (Interplanting can attract pollinators and other beneficial insects too.) Cats steer clear of strong citrus scents.
Vinegar as a cat repellent
Spraying Outdoors – Straight or diluted vinegar can be sprayed around the edges of a garden, and on plants, fences, posts and garden décor to keep cats away. Concentrate the spray on areas that the cats frequent or that you particularly want to protect.
Lavender, geranium, and eucalyptus
Some gardeners use lavender plants to deter deer, but you can also try this as a deterrent for felines. Likewise, geranium and eucalyptus plants give off an odor that cats dislike.
Orange and lemon peels (cats dislike citrus smells), cayenne pepper, coffee grounds, pipe tobacco, lavender oil, lemon grass oil, citronella oil, peppermint oil, eucalyptus oil, & mustard oil.
Cats, being fairly territorial, are unlikely to feel comfortable doing their business in a place that smells like another, much larger, feline already frequents it. Put down extra strength hot chilli powder. It annoys cats' paws and whiskers without causing them serious harm. They'll stay well away.
Squeeze 2 drops of lemon essential oil, 2 drops of wild orange essential oil, and 2 drops of lavender essential oil to the bottle. Cats are more sensitive to scents than humans, so essential oils with strong odors, such as citrus and lavender, can help repel them.
Texture: Sticky paper, aluminum foil, heavy plastic or a plastic carpet runner (knubby side up) can be placed in areas you want to be off limits. Cats hate walking on these surfaces.
Cats have tremendously sensitive noses, lots more powerful than a human's. Because of this, pungent or “interesting” smells will often catch their interest and turn them on. I caught my cat Tut sniffing around my coffee cup for almost a minute one time, so I expect fresh coffee grounds should really grab his interest.
Coffee. You might savor the scent of your morning cup of joe, but your cat will instinctively turn up their nose at the smell of coffee. Whether it's grounds, beans, or freshly brewed coffee, the smell is one cats hate. Cats react negatively to caffeine, so coffee is toxic for them to ingest.
What other animals can be deterred by coffee grounds? “the smell of the coffee repels snails, slugs and ants. You may also have success using coffee grounds to repel mammals, including cats, rabbits and deer.”
Unfamiliar Objects, Fruit or People
But it is a good example of cats being afraid of unfamiliar things (people, objects, fruits, etc.). Cats like to feel safe and secure in their home — if something new enters their space, that's probably going to cause some stress.
“Tabasco, chilli powder, curry powder, chilli flakes, cayenne pepper anything that's got a hint of spice can be put on the soil of your plants to keep them [animals] away. “It's really simple, just take your plant and put a few drops of tabasco or sprinkle some chilli powder onto the soil.
Mix 1 cup baking soda with 1 gallon of water. Water yellow spots on your lawn every three days. The animal will no longer recognize the marked area. Sprinkle coffee grounds -- used or fresh, it doesn't matter what kind -- on any spots you want to protect from encroaching animals.
Moth balls are designed to repel moths, not cats. However, some people believe that moth balls can also repel cats because of the strong scent. There is no scientific evidence to support the use of moth balls as a cat repellent, and in fact, moth balls can be toxic to cats.
For a mulching option, you can use sharp-edged pine cones, holly cuttings, eggshells, or stone mulch. Cats prefer to dig and poop in loose dirt and will be put off by these rough materials. For other areas, you might use a plastic carpet runner with the nub side up to discourage cats from perching or lounging.