Or it could be the wiring is intermittent, have you used a solderless bread board? They often cause problems over time.