I would like to make something that detects a dog coming into my room with a laser and when the laser is interrupted it activates a stepper motor to scare it away so it doesn't poop. Then the motor could be stopped with a button. How would one do this?
Have you considered dog diapers?
I would guess you already attempted training.
How would a stepper motor scare a dog?
Sorry, I cannot resist;
Why would a dog have a laser ?
"You know, I have one simple request. And that is to have dogs with frickin' laser beams attached to their heads!"
That ranks as one of the worst ideas in history! Scorch marks on your slippers, scorch marks on the cat...
if i attach a rod to the stepper motor and put a drum or something that makes a sound when it's hit by something under the motor, then the sound will scare my dog away
Or have the Arduino trigger a lion roar from an MP3 player. Other loud, dog-scaring sounds could include someone shouting "get out", fireworks, gunshots, etc.
You could also close the room door, or put up one of those fences that parents usually put near stairs when they have a small child.
Anyway, why do you want to prevent the dog from pooping specifically in this room? Does it not matter if it poops in other rooms?
Take the dog for a walk and let it poop outside.