One of the many inventions piled together by my roommate was an electric butt scratcher for his dog. You can build one for your dog, in case it has an itchy butt (most do, due to the scent glands back there).

It boiled down to a few simple parts:
A wooden dowel with some deep notches cut down its length
A frame that held the dowel a foot and half or so above the ground (changes per dog).
A motor attached to the frame and dowel which is activiated by a switch in the base of the frame.

Operation is simple: after about 1 lesson, the dog learned to back into the butt scratcher. He'd unknowingly step on the foot switch, which would turn on the motor and spin the dowel. Then he just leans into the dowel.

However, this could very well be the doggy equivelent of cocaine, coffee, or television. My roomie's dog used the machine so much he got a temporary bald spot on his butt, and eventually burnt out the scratcher's motor.

My roomie never repaired the thing and it exists no more, but a good addition might have been one of those 24 hour AC outlet timers and a light. You set the timer to be on 1/2 and hour a day. When the timer is on, both the light will come on and the scratcher will power up. Any smart dog, with some training will figure out that when the light is on, he can be scratched and if it's off not to bother. After a week or two your pooch might develop an uncanny sense of punctuality. Then you can do cool dog behavior research, and become the next Pavlov.