Inspiration

"Life continues… it doesn't wait for you." It's a harsh truth, and far too many people have been crushed by it. Weighed down by their responsibilities, the relationships they're trying to hold together, and the sheer struggle of getting through the day, more and more people are quietly breaking down. Rates of anxiety, depression, and suicide have climbed to alarming highs in recent years — and I wanted to build something that pushes back. Our app, Anchor, does exactly what its name says: it anchors you into your own life. Through advanced algorithms and custom hardware, Anchor helps you understand what you're truly feeling.

What it does

Anchor pairs the Cerebras API with a four-tier analytical engine — roughly 1,800 lines of hand-written statistics and signal processing — to deliver guidance that's detailed, personal, and genuine. Rather than just forwarding a prompt to an LLM, Anchor first models you as a time series: it tracks mood, sleep, journaling, and behavioral signals day over day, then feeds those quantified insights into the AI so the response is grounded in your real patterns. The more you use Anchor, the sharper that model becomes.

The engine watches for the small, subconscious signals most apps ignore — a slow drift in tone, a shift in daily rhythm, a widening gap between how you say you feel and how your data trends. It can catch a downward trend before it becomes a bad week.

Anchor also connects to our custom Arduino Bedside Monitor over Bluetooth Low Energy (BLE). Most sleep apps simply ask, "How was your night?" I wanted to go further. Our hardware streams light, movement, sound, humidity, and temperature, so Anchor knows how your night actually went — not just how you remember it — and folds that objective environmental data straight into its sleep analysis.

How I built it

I wrote the app in JavaScript (VS Code) and the firmware in the Arduino IDE, moving the firmware into VS Code once it was stable and adding JSON files for easy sensor/threshold configuration. From there I installed dependencies and set up my .env and .gitignore to keep the API keys out of version control.

The four-tier analytical engine is the heart of the project. Rather than relying on the API alone, each tier pulls a different layer of meaning from the user's history: the first estimates a person's "true" underlying mood from noisy daily reports, the second maps how factors like sleep and mood influence each other over time, the third forecasts where things are heading, and the fourth catches tiny early shifts in behavior before they'd ever be noticed. Together they draw on techniques like Kalman filtering, Vector Autoregression, Hidden Markov Models, and change-point detection. The output of all four tiers is distilled into a short summary that gets injected into the Cerebras prompt — so the AI's warm, human-sounding reply is backed by hard math.

The hardware side runs on an Arduino Mega, reading a DHT11 (temperature/humidity), an HC-SR501 PIR motion sensor (with a debounce/confirm window so brief blips don't count), a sound sensor (sampled over a 50 ms window), and a photoresistor (mapped to a 0–100 light scale). It packs everything into a compact JSON message once per second and streams it over an HM-10 BLE module, while also displaying live readings on a 16×2 LCD. On the app side, I built a BLE stack against the HM-10's GATT service (FFE0 / characteristic FFE1) with a Nordic UART fallback, including reassembly of the fragmented ~20-byte hex packets BLE delivers and a resilient parser that extracts each JSON object from the stream.

To ship as a real iOS app rather than a plain web page, I wrapped it with Capacitor so it runs natively in Xcode, and used native Capacitor plugins for BLE, Geolocation, and premium text-to-speech. Finally, I set up Firebase Auth and the Google Cloud Console to get Google Sign-In and Firestore cross-device sync across the iOS and web versions — matching OAuth client IDs, bundle identifiers, and the GoogleService-Info.plist so accounts sync (and fully delete) across devices.

Challenges I ran into

My biggest challenge was Firebase and the Google Cloud Console. It was my first time using either, and getting native Google Sign-In working meant carefully aligning OAuth client IDs, the app bundle ID, and the config plist — a single mismatch produced cryptic auth/invalid-credential errors. Another hurdle was the BLE connection: iOS reports 16-bit UUIDs in short form and delivers data in fragmented hex packets, so I had to register listeners at the right moments, discover the actual notify characteristic at runtime, and rebuild each JSON object from the stream. But the hardest part by far was the four-tier algorithm engine — getting the statistical models working and tuned so they caught real shifts without firing on random noise.

Accomplishments that I'm proud of

Three things stand out: the Google login with cross-device sync, the hardware and its BLE data pipeline, and the four advanced algorithms. They took the bulk of my time, and building them is something I won't forget. Along the way I learned an enormous amount — about Firebase and Google Cloud, about wiring and programming Arduinos, and about implementing real statistical models that stand on their own rather than leaning entirely on an API key. They pushed me to a completely new depth.

What I learned

Beyond the many ways to wire and debounce Arduino sensors, I learned how to operate Firebase and the Google Cloud Console, how the BLE GATT protocol actually behaves on iOS, and how to use Xcode + Capacitor to build a truly native app from a web codebase. But my biggest takeaway was turning real statistical models — things like Kalman filters and Hidden Markov Models — into working code that meaningfully improves Anchor's AI guidance.

What's next for Anchor

Right now Anchor runs natively on iOS, and I'd like to bring it to Android next (Capacitor makes this achievable from the same codebase). I also want to expand the engine with more sophisticated forecasting and on-device anomaly detection — so the app understands you on an even deeper level. Finally, I'd love to make the hardware truly presentable by 3D-printing a custom frame and enclosure for the Bedside Monitor.

Built With

Share this project:

Updates

Submission history