Randomly Incrementing Signal...

Hi, I have an electric vehicle hooked up to a motor and an optical encoder. I have it so a counter goes up everything the signal from the encoder "goes up", strangely, it randomly increments (slowly) even when the wheel is not moving and the encoder's LED's indicate no movement. What could be the problem?

If you post code and schematics it will be a lot easier to give a qualified guess to the nature of the problem.

If the motor is going then the problem is supply decoupling:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html