In this project you make use of a component called a tilt switch. Inside a tilt switch is a little metal ball that rolls around in a tiny chamber, allowing the device to detect the ball’s position. Using that component, it was pretty easy to make a mini hourglass. First, you check whether the Arduino is turned upside down by reading the pin connected to the tilt switch. Then, you slowly turn on LEDs to represent the timer counting down.

I seriously cut corners on this project by only roughly tracking time. My counter simply worked by incrementing a variable in a loop. I think if you wanted to do a better job of tracking time, you’d use one of the timer peripherals to increment a value in some register that you could read from. I don’t think you could use the method I used if you wanted to track something at an actually accurate frequency—but oh well, I still think I got the gist of what this project was trying to teach me.