API-Driven Flip Clock
GOALS: Create a clock that utilises an API and operates with just one servo motor
SKILLS: CAD Design, debugging electromechanical systems, ESP32, API Integration
This was a project was done in one week for my Intro to Robotics class. The prompt was to create a clock that uses a servo motor and integrated information obtained by an API. My flip clock tells you what hour it is in two different time zones - EST and PST. It does this by using an API to retrieve the time zone info, then moving the servo accordingly.
How It Works
Ratchet Mechanism
A major design constraint in this project was only being allowed to use one servo motor that had 180 degrees of motion. In order to execute the flip clock design, I needed a full 360 degrees of motion. To get around this, I designed a ratchet mechanism so that every time the servo reached the limit to its range of motion, it could return to 0 degrees without disrupting the clock position.
Gear Theory

I really wanted to make my mechanism as compact as possible, so I needed a way to transmit power from servo motor to the tile spool. It was important that the gear ratio was 1:1 because I designed the ratchet mechanism to have 10 "clicks," with each click representing the turn of one number. Here is the math I used:
API Integration & Code
I used TimeAPI in order to tell what time it is in different time zones. I used MicroPython on an ESP32 to connect to WiFi, send an API request, and then interpret the returned JSON data. The time data that I got from the API was then mapped to a servo angle, and if that angle was above 180 degrees, I had the servo return to 0 degrees before going to the remaining angular amount.
see my code!CAD
Everything That Went Wrong and How I Fixed It
- 3D PRINTING TINY LITTLE GEARS SUCKS the tolerances are so small and when I printed out the shafts for the ticket spool to sit on, I made the 3D printing tolerance too big so there was too much wiggle room and even that 0.5 mm of freedom made it so that the gears would just not mesh with each other. But it was a pretty simple fix of just reprinting with a smaller tolerance .
- The ratchet mechanism had too much friction for such a little setup. with the teal version of the inner ratchet, the contact between the sides of the outer gear & the sides of the ratchet, along with the bottom of the gear & bottom of the ratchet, was too much resistance for them to move independantly. I ended up raising the ratchet 1 mm so that the bottoms dont touch, and removing the fillet on the ratchet so that there was more room for the ratchet to flex.
- I accidentally superglued my gears together. Don't do that.
