The Sweet Taste of Success
Want a cookie? Not so fast! The Smart Cookie Jar stays locked until you go for a run to earn it.
If you’re finding that you get caught with your hand in the cookie jar much too often (who doesn’t this time of year?), then you might want to check out Milos Rasic’s latest project. Anybody that wants a cookie from Rasic’s Smart Cookie Jar is going to have to work for it! The only way to lift the lid and get a sweet treat is to go for a run first. Personally, I’m still trying to decide if that’s a good idea or cruel and unusual punishment.
The Smart Cookie Jar takes on a problem many of us know all too well during the colder months: plenty of snacks and fewer excuses to get outside. Rasic’s solution is as clever as it is ruthless. The jar looks perfectly ordinary on the outside, but inside the lid is a small locking mechanism that refuses to budge until its owner meets a predefined running goal.
This isn’t Rasic’s first attempt at combining fitness and confectionery denial. He originally built a similar device more than six years ago, back before he had access to a 3D printer. That early version relied on hand-cut plywood, improvised metal parts, and a much bulkier design. The new iteration is smaller, cleaner, and far more refined, thanks to modern microcontrollers and custom 3D-printed components.
The system is centered around a compact mechanical lock driven by a tiny SG90 servo motor. Instead of simple linear pistons, the redesigned lid uses small gears with swinging arms that extend outward to hold the lid firmly in place. All of the electronics are neatly packed into the lid itself, including an ESP32-S3 microcontroller for Wi-Fi connectivity, a rechargeable battery, and a charger module.
On the software side, the Smart Cookie Jar relies on the Strava fitness platform to decide whether you’ve earned your snack. The ESP32 runs a small web server and it periodically polls the Strava API to check the user’s most recent activity. Once the recorded distance meets or exceeds the target, the servo springs into action and unlocks the lid. To conserve battery life and avoid an annoying buzz, the code attaches the servo only when it needs to move.
Rasic has provided plenty of details if you’d like to build your own Smart Cookie Jar. But be warned: if you want what’s inside, you’d better lace up your running shoes first.