I have had raccoons coming in my yard for many years without any problems. Then about two years ago a raccoon discovered my dog door and came inside my house. Luckily I was home when it happened and scared the raccoon away. Since then, I have made sure to always lock up the dog door at dusk and that seemed to work. However, in the last several months I have been awakened in the middle of the night by a tap, tap, tapping at my back door, only to discover a raccoon trying to get in through the dog door.
I have done all of the preventive measures such as keep food, water, garbage and shelter unavailable to raccoons without success. Through some research I found some Raccoon Help and the solution is ammonia. Place a rag in a low, unbreakable container then pour ammonia on the rag, enough to cover the rag (the rag will help the ammonia from evaporating too fast). Next, put the container where you want to keep raccoons away, for me that was outside near the dog door. You can also use this method for keeping raccoons away from a lawn (you will need several ammonia stations for larger areas with multiple access points). Good luck!