Pulse counting - a sanity check

Check out this thread as well. The earlier scope traces are about switch contact bounce, not relevant in your case, but the later traces show what a nearby motor can do to the signal.