Motion-activated sprinklers are another effective deterrent. The sprinkler turns on when a dog enters your yard, scaring them away. Spread gravel or rocks in areas where dogs frequently poop.