An Arduino sketch for a DIY motion sensor for linear movement detection.