← projects

LifeLens

An IoT system that watches how you actually spend your time across home, body, and car, then coaches you with a language model that never leaves the house.

System design · INF 148, Internet of Things · UC Irvine · March 2026 · individual project

The problem

Most people have no objective way to compare how they spend their time with how they think they spend it. More than a third of American adults regularly sleep less than 7 hours, poor sleep degrades focus, and lost focus feeds more distraction. It's a loop that's hard to see from the inside.

LifeLens passively measures three environments: the home (a Blink camera), the body (Apple Watch health data), and the car (dashcam, OBD-II, and GPS). Everything lands on a Raspberry Pi 5, where a local LLM looks for patterns and tells you when to sleep, flags wasted time, and suggests what to do next. No data leaves the local network.

ProductSleepProductivityDrivingAI coachPrivacy
Apple Healthyesnononogood
Oura Ringyespartialnobasiccloud
RescueTimenoyesnonocloud
Whoop 4.0yesnonobasiccloud
LifeLensyesyesyesfull LLM100% local

No existing product covers all three domains with a local model.

How it works

Four layers, each talking over a standard protocol (MQTT, I2C, I2S, USB, UART) so any piece can be swapped out.

The sensors

Blink camera: where you are

Every 60 seconds the Pi grabs a thumbnail through the blinkpy API and runs it through YOLOv8-nano, fine-tuned on ~500 labeled images to tell four states apart: at desk, in bed, on phone, absent. The frame is discarded right after; only the label, confidence, and timestamp are kept.

confidence ≥ 0.75 · 3.4 MB model · IR works in the dark

Apple Watch: how you slept

HealthKit is sandboxed to iOS, so a small Swift companion app queries it every 5 minutes with HKAnchoredObjectQuery, pulling only new samples, and publishes them to the Pi's MQTT broker. That covers sleep stages, heart rate, steps, and active calories.

topic lifelens/health/# · REM, Core, Deep

Car: how long you drove

An ELM327 OBD-II adapter reports speed, RPM, and engine load over Bluetooth. A NEO-6M GPS module logs trip coordinates and duration, and a 70mai A810 dashcam handles video.

NMEA 0183 at 9600 baud · USB serial

Mic and room sensor: are you focused

An INMP441 I2S microphone runs voice activity detection to tell a phone call from focused work. Audio is never recorded, only a speaking/not-speaking flag. A BME280 tracks temperature, humidity, and pressure.

VAD threshold 0.02 RMS · 16 kHz

One night, 11:47 PM

A simulated snapshot from the design: what each sensor reports, what the hub turns it into, and what the model says.

blink person_in_bed 0.91 → activity "in bed"
watch sleep stage 3, 58 bpm → core sleep, onset 23:32
mic RMS 0.0014 < 0.02 → silent, no conversation
bme280 21.4°C, 48.2% RH → comfortable for sleep
obd-ii vehicle off → 34 min driven today, 2 trips
gps last fix 18:22 → home (geofenced)
“You're in bed about 30 minutes later than your 11 PM target. The good news: your heart rate is already dropping and your room temperature is ideal for sleep. Tomorrow, try setting a wind-down alarm at 10:30 PM. Tonight you were on your phone until 11:18, which pushed back your sleep onset.” example output from Llama 3.1 8B, given the user's goal of 7+ hours and lights out by 11

The hub

A 3D-printed enclosure, 120 × 85 × 45 mm, with a 128×64 OLED, four status LEDs, the mic behind an acoustic port, and Mode/Select/Reset buttons. The Pi 5 sits on brass standoffs under an aluminum heat sink and 30 mm fan.

Front, side, and top views of the LifeLens hub enclosure, showing the OLED, status LEDs, mic, buttons, side ports, and Pi 5 layout.
Front, side, and top views of the enclosure. Full wiring diagram ↗
BusPinsDevices
I2CGPIO 2, 3SSD1306 OLED (0x3C), BME280 (0x76), 4.7 kΩ pull-ups
I2SGPIO 18, 19, 21INMP441 mic, left channel mono
UARTGPIO 14, 15ESP32-S3 BLE bridge at 115200 baud
USB 3.0ports 1, 2NVMe SSD, dashcam; GPS on its own USB serial

The dashboard

A Next.js progressive web app served on the local network, installable on phone and desktop. It leads with a daily score and lets you ask the model questions about your own data, like “how much time did I waste this week?”

30%sleep quality
30%focus time
20%activity
20%driving efficiency
LifeLens mobile dashboard with score and metric cards, and desktop dashboard with weekly sleep chart, focus timeline, and AI assistant.
Mobile and desktop dashboard mockups.

Privacy by design

The rule that shaped everything else: raw video and audio are never stored. Camera frames are classified in real time and thrown away; mic audio becomes a yes/no flag and is discarded. Nothing is sent outside the local network.

DataKept asRetention
Cameraactivity labels only30 days
Audiospeaking flags only7 days
Sleep and heart ratetime series1 year
Vehicletrip summaries1 year
Room climatetemperature and humidity1 year
LLM chatencrypted SQLiteuntil deleted

Nothing in this table is ever shared.

Bill of materials

Raspberry Pi 5 (8 GB) · Blink Mini 2 · Apple Watch · ESP32-S3-DevKitC-1 · INMP441 MEMS mic · BME280 · SSD1306 OLED · NEO-6M GPS · ELM327 OBD-II · 70mai A810 dashcam · 500 GB NVMe in a USB enclosure · 27 W USB-C supply