Sounds like noise to me.... Try a schmidt trigger between what you are counting and the pic.