BrimCam
A camera in the brim of a baseball cap that estimates the calories and macros in my dining-hall meals. It photographs the tray, a Telegram bot names each item and estimates the portion, and the numbers come from UMD Dining's published nutrition facts.
It started as camera glasses, but the battery was too big to hide in a frame, so I moved it to a cap and took on the software too. The hardware only has to take a good photo of the tray, and everything else, from naming the food to adding up the macros, happens on the Telegram side.
The cap, exploded in 3D
Exploded view, not to scale: the small parts are drawn larger as they come out. Placement follows the build; sizes are approximate.
- 01 / 04
The cap
Everything rides in a baseball cap: the battery, the controls, the camera and its antenna.
- 02 / 04
Apart
The 500 mAh LiPo is a protected cell, tucked under the crown where it cannot get crushed. The touch pad is on the side of the crown and the slide switch is on the band.
- 03 / 04
Under the brim
The XIAO ESP32S3 Sense sits under the front of the brim, camera angled down at the tray. The Wi-Fi antenna faces away from my head and the recording LED is under the brim tip. The mic stays off, because Maryland requires everyone on an audio recording to consent.
- 04 / 04
The shot
It photographs the tray. A Telegram bot names each item and estimates the portion, and the numbers come from UMD Dining's published nutrition facts.
- Crown. The battery hides underneath it.
- 500 mAh LiPo. A protected cell, tucked under the crown where it cannot get crushed.
- Touch pad. On the side of the crown.
- Slide switch. On the band.
- Brim. The camera board sits under its front edge.
- XIAO ESP32S3 Sense. Camera and Wi-Fi, angled down at the tray. The onboard mic stays off, because Maryland requires everyone on an audio recording to consent.
- Wi-Fi antenna. Along the brim, facing away from my head.
- Recording LED. Under the brim tip.
Select a step.
A Seeed XIAO ESP32S3 Sense sits at the front of the brim, angled down at the tray, with its Wi-Fi antenna facing away from my head. A 500 mAh protected LiPo is tucked under the crown where it cannot get crushed, with a slide switch, a touch pad and a recording LED. The onboard mic stays off, because Maryland requires everyone on an audio recording to consent. Photos go to Herald, a Telegram bot my friend Ben built (source on GitHub). My code runs as a Herald extension, so the results show up in a Telegram chat instead of a separate app. The Gemini API only has to name each item and estimate how much of it there is. It combines cues like scoop counts and how much of the plate the food covers. Calories and macros come from UMD Dining's published nutrition facts, so the model never has to guess the numbers.