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
Challenges & Future Improvements
- I wanted to make the clock as small and compact as possible. However, this meant that the tolerances on the gears were very small, and being off from the pitch circle by even 0.5 mm would cause the teeth not to mesh properly. If I were to do it again, I would make the gears just a little bit bigger.
- I underestimated how big a role friction would play in allowing the ratchet mechanism to work, which led me to have to redesign it multiple times.
- I accidentally superglued my gears together. Don't do that.