The linked video below will take you through the process of designing, assembling, and testing the ChocoVault. Explore the inner workings of the device, from its motorized lock assembly to its custom PCB based on an ESP32-S3 microcontroller. Learn how the system synchronizes with activity data from the Apple Watch via Apple Health using the “Health Auto Export” app, ensuring your sweet rewards are unlocked when you hit your daily activity goal.

Mechanical Design

The heart of the ChocoVault is a 3D-printed motorized lock assembly. It consists of two spring loaded latches which are designed to engage with the two strikers, which are symmetrically arranged on the lid of the device.

To unlock the vault, these latches can be retracted by racks which are driven by a small, geared DC motor and a pinion gear.

For position feedback, magnets on the racks are detected by hall effect sensors, which are located on the control PCB. The PCB is directly attached to the lock assembly.

The mechanical design was created with robust and resource efficient additive manufacturing in mind. Some of my design constraints were:

ChocoVault Mechanical Design Overview
ChocoVault Mechanical Design Overview

Functional requirements (mechanical):

Closeup of Modular Lock Assembly
Closeup of Modular Lock Assembly

Electrical Design

The integrated electronics are built around an ESP32-S3 microcontroller, which simplifies running a web server, performing over-the-air firmware updates, and playing wave or MP3 files. The system is powered by a standard 5V DC supply, with an onboard voltage regulator providing the required 3.3V rail.

A dedicated motor driver IC streamlines motor control, while a mono class D audio amplifier with digital I2S input handles audio playback. Three small Hall effect sensors on the PCB detect the end-stop positions of the locking mechanism. Additionally, a ring of 12 addressable RGB LEDs serves as the status display. The web server on the ESP32 receives activity data from Apple Health as a JSON record, which is then used to display the current active energy status on the LED ring—mirroring the Apple Watch display—while also managing the locking mechanism.

Assembled Control PCBA prior to reflow process
Assembled Control PCBA prior to reflow process

Functional requirements (electrical):

Communication

As to my knowledge, there is no direct way for the Apple Watch to automatically transmit activity data to another device. A 3rd party app needs to be used on the iPhone to access the relevant Apple Health data and synchronize it with the ChocoVault. This app can be found in the App Store and is called “Health Auto Export”. It offers various options for exporting all sorts of Apple Health related data and send it to web services like generic REST APIs, Home Assistant, MQTT, Dropbox etc. For the ChocoVault, I provided a simple REST API which accepts the Apple Health data as a JSON record.

Apple Watch Sync Demo with 3rd party App "Health Auto Export"
Apple Watch Sync Demo with 3rd party App "Health Auto Export"

No Pain No Gain

The Vault has no externally accessible screws and components relevant for the security of the protected treats were reinforced to withstand unauthorized brute force opening attempts - the only way to get access is to go through tough physical exercise. 

It was painful, it was exhausting - but also extremely rewarding!

Historical victory moment captured - treats unlocked after endless exercise
Historical victory moment captured - treats unlocked after endless exercise

Stay tuned for further project updates and design files (still in cleanup mode...).