Dropify hit $10K MRR in month one.Read more

How to build

How to Build a Smart Pill Dispenser App With Caregiver Alerts

A smart pill dispenser app lives or dies on one thing: what happens when a dose is missed. This guide covers the device link, the offline dose log, the escalation chain to a caregiver, and what it costs to build.

Nate Laquis13 min read

What a smart pill dispenser app actually has to do

A smart pill dispenser app has three jobs: tell the dispenser when to release a dose, record what really happened, and make sure a human steps in when it did not go to plan. Build a React Native or Flutter app that talks to the device over Bluetooth Low Energy, keep a dose log on the device itself, and put your real effort into the missed-dose escalation chain that reaches a caregiver. Everything else is a screen.

That order matters because the competing products all do the first two jobs. Most consumer pill boxes pair over Bluetooth, let you set a schedule, and chime when it is time. Where they fall down is the moment after the chime. A 78-year-old who does not hear the alarm, or a patient who simply forgets, produces a missed dose that nobody knows about until the next doctor visit. If you are the founder of a dispenser, the app is the product that closes that gap.

Your users are really two people. The patient wants as little friction as possible, ideally none. The caregiver (an adult child, a home health aide, a nurse at an assisted living facility) wants to stop worrying without calling every afternoon. Design for both from the first sketch, because retrofitting a second user type into an app built for one is expensive.

Person checking a medication reminder on a smartphone at home

This post sits one level below our broader guides on building a connected device companion app and building a medical device companion app. Read those for the general pattern. Here we stay on the pill dispenser and its particular problems.

BLE or a Wi-Fi hub: the first hardware decision

Your connectivity choice shapes the whole app, so settle it before anyone writes code. There are two realistic options.

Bluetooth Low Energy only

The dispenser pairs with the patient's phone over BLE. This is cheap in hardware, needs no home Wi-Fi setup, and battery life is good. The cost is that the device only syncs when a phone is nearby and the app is allowed to run. If the patient leaves the phone in another room, or the OS suspends your app, the caregiver sees nothing until the phone reconnects.

Wi-Fi or cellular on the device

The dispenser talks to your server directly. Dose events reach the caregiver in seconds whether or not a phone is near. The price is real: a Wi-Fi module adds bill of materials cost, setup is harder for older users (typing a Wi-Fi password into a phone app is where many of them quit), and battery life drops unless the unit is plugged in. A cellular module removes the setup problem but adds a monthly data cost per unit that you have to build into your subscription.

What we would pick

For a first product aimed at older adults living alone, the hub model wins. A small plugged-in dispenser with Wi-Fi, or with a cellular fallback, gives you a dose log that does not depend on the patient's phone. Use BLE only for setup and for a nearby-phone fast path. If your target user is a working adult managing their own prescriptions, BLE only is fine and far cheaper to ship.

Whichever you pick, write the device protocol down as a short document before the firmware and app teams start. Define the dose event (timestamp, compartment, status, battery level), the schedule write, and the clock sync. Most delays on projects like this come from the app team and the firmware team disagreeing about one field.

The dose log lives on the device, not the phone

The most common architecture mistake is treating the phone as the source of truth. The dispenser is the source of truth. It knows when the lid opened, when the motor turned, and whether a dose was taken or timed out. The phone and the server are copies.

That means the device keeps an append-only log of events, each with a monotonically increasing sequence number and a timestamp from its own real-time clock. On every connection, the app asks for everything after the last sequence number it saw, writes those events to local storage, and uploads them to your backend. The backend deduplicates on device id plus sequence number, so a retry never double counts a dose.

Three details save you pain later:

  • Clock drift. A cheap real-time clock drifts by minutes per month. Sync the device clock on every connection and store both the device timestamp and the server receive time, so you can detect and correct drift in reports.
  • Schedule on the device. Write the full upcoming schedule, a week or two ahead, to the dispenser. If the phone and the network are both gone, the device still chimes and still dispenses on time. A dispenser that stops working when Wi-Fi drops is a recall waiting to happen.
  • Explicit dose states. Use a small set: scheduled, dispensed, taken, missed, skipped, refill needed. A dispensed pill that was never removed from the tray is not the same as a taken pill, and your alerts should treat them differently.

On the phone, use a local database (SQLite through WatermelonDB or Expo SQLite works well) so the dose history screen opens instantly and works offline. The server holds the shared copy that caregivers read.

Caregiver linking without a support call

Caregiver access is the feature that makes the app worth paying for, and linking is where it goes wrong. Older patients should not have to create an account, and caregivers should not have to be on the same Wi-Fi network.

The pattern that works is a pairing key printed on the device or shown on its screen. The patient (or whoever sets the unit up, often the caregiver) enters it once. Your backend checks that the key belongs to an unclaimed device, links the device to a household record, and issues the first user as the owner. After that, the owner can invite caregivers by phone number or email, and each invited person gets their own login and their own notification settings.

Build roles from the start, even if you only ship two. A patient role sees today's doses and a big confirm button. A caregiver role sees history, adherence trends, and alert settings. A third role, an organization admin for a home care agency or a facility, usually shows up within six months of launch, and it is far easier to add if you modeled households and memberships instead of a single user-to-device link.

Give the patient a way to revoke access and to see who has it. Medication information is private, and an app that quietly shares it with a relative the patient did not choose will cause a complaint sooner or later. For wider caregiver app patterns, our guide to building an elderly care caregiver app covers scheduling and shared notes in more depth.

Dashboard showing adherence charts and dose history for a caregiver

The missed-dose escalation chain is the product

This is the section to read twice. A pill dispenser that logs doses is a gadget. A pill dispenser that reliably gets a person to act when a dose is missed is a care tool, and families pay for that.

An escalation chain is a timed sequence of increasingly hard-to-ignore steps. A reasonable default looks like this:

  1. On the device, at the scheduled time: chime and light. Repeat gently for 10 to 15 minutes.
  2. Plus 15 minutes, no confirmation: push notification to the patient's phone.
  3. Plus 30 minutes: SMS to the patient, because some people disable push and never look at it.
  4. Plus 45 minutes: push and SMS to the primary caregiver, naming the medication window, not the drug, in the message text.
  5. Plus 90 minutes: an automated phone call to the caregiver, and optionally to a second contact.
  6. Dose window closed: mark the dose missed, and show it in the daily summary.

Every number in that list should be configurable per medication and per household. A blood thinner or an insulin-related schedule has a very different tolerance than a daily vitamin. Let the caregiver pick which medications escalate quickly and which only appear in the evening summary, or you will train them to ignore alerts.

Build the chain on the server

Do not run escalation timers on the phone. Phones get switched off, run out of battery, and get their background work throttled. The server owns a job per scheduled dose that fires at each step and checks, right before sending, whether the dose has been confirmed in the meantime. A durable job runner such as Inngest, Temporal, or a simple Postgres-backed queue handles this well. We compare the first two in our Inngest vs Trigger.dev vs Temporal post.

For SMS and voice, a provider like Twilio or Telnyx does the job. Budget a few cents per SMS and a few cents per call minute, which stays small until you have thousands of households. Store every step the chain took, with a timestamp and delivery status. When a family says "we were never alerted," that log is your answer, or your bug report.

Also alert on silence

A dispenser that has stopped reporting is a missed dose you cannot see. If no heartbeat has arrived for a set period, such as 12 hours for a plugged-in unit, alert the caregiver that the device is offline. Also alert on low battery and low pill count. These three alerts prevent more real-world failures than any clever feature.

Making notifications reliable on iOS and Android

The escalation chain is only as good as the last mile to the phone. Mobile operating systems actively work against apps that want to interrupt people, so plan for it.

iOS

Standard push notifications respect Focus modes and the silent switch. Apple offers Critical Alerts, which can break through both, but they require a special entitlement that you request from Apple with a justification, and approval is not guaranteed. Medication and health safety are the kind of case the entitlement exists for, so apply early, well before launch. Time Sensitive notifications are a lighter option that does not need approval and gets through most Focus modes. Because neither is certain, keep SMS and the phone call in the chain as the backstop.

Android

Use Firebase Cloud Messaging with high priority messages for dose alerts, and create a dedicated notification channel with a distinct sound and importance level so users can see it as separate from the rest of your app. If the app schedules any local alarms as a backup, Android 12 and later restrict exact alarms, and newer versions limit which apps get the permission by default. A medication reminder qualifies for the use case, but you have to declare it and handle the case where the user has not granted it. Aggressive battery managers on some phone brands kill background apps, so add a first-run screen that explains how to exempt your app.

Do not depend on the app being open

Background BLE on both platforms is limited. iOS will relaunch a properly configured app for BLE events, but it is not instant and it can be refused under low power conditions. This is a second reason the Wi-Fi or cellular hub model is stronger: the server hears from the device directly and does not wait for the phone to wake up.

Privacy, HIPAA, and the FDA question

Anything that stores a person's medication list is handling sensitive health data. We are not lawyers, and you should hire one for this part, but here is the plain version of what to ask about.

HIPAA

HIPAA applies to covered entities (providers, health plans) and their business associates. A consumer who buys your dispenser and enters their own medications is usually not covered. The moment you sell to a home care agency, a pharmacy, or a clinic, or you share data with a provider on their behalf, you may become a business associate. That brings signed agreements, access logging, encryption at rest and in transit, and breach notification duties. Choose hosting that will sign a business associate agreement from day one, even if your first customers are consumers, because switching later is painful. If you plan to sell to facilities, read our guide on medical device companion apps for the compliance basics.

Keep drug names out of messages

SMS and lock screen notifications are not private. Say "Morning medication is due" instead of naming the drug. Let the patient choose how much detail appears on the lock screen.

The FDA question

Whether your product counts as a regulated medical device depends heavily on what you claim. A simple reminder box and app that helps people stay on schedule sits in a lighter category than a device that makes dosing decisions, adjusts doses, or claims to treat a condition. Features such as "we detect that you took the wrong pill" or "we recommend a dose change" can pull you toward stricter rules. Write your intended claims down, keep marketing copy consistent with them, and ask a regulatory lawyer to classify the product before you finalize the feature list. It is much cheaper to drop a feature at the planning stage than to withdraw a launched one.

Team reviewing a product plan for a connected health device

The stack, the cost, and the timeline

Here is the stack that fits most dispenser startups, with market-typical ranges for a first version.

  • Mobile app: React Native with Expo, using react-native-ble-plx for Bluetooth, or Flutter with flutter_blue_plus. One codebase covers patients and caregivers on both platforms. Expo needs a development build for BLE, since Expo Go does not support it.
  • Backend: Node or Python on a HIPAA-eligible host, with Postgres for households, devices, doses, and escalation steps. Use a durable job queue for escalation.
  • Device link: MQTT or HTTPS from the dispenser to your backend, with per-device credentials and over-the-air firmware updates.
  • Messaging: FCM and APNs for push, Twilio or Telnyx for SMS and voice.
  • Caregiver web dashboard: optional at first, but very useful for agencies and facilities.

What it costs

For the software side only (app, backend, escalation, caregiver features), a focused first version typically lands between $60,000 and $150,000 with a competent agency or senior freelancers. The low end is a BLE-only consumer app. The high end is a hub-based product with a caregiver dashboard, over-the-air updates, and compliance work. Firmware and hardware are separate and often cost as much again, so do not let a software quote be mistaken for the whole budget. Regulatory review and security testing add several thousand to tens of thousands of dollars.

Running costs are small per household. Expect cloud hosting, SMS and voice, and push to total a dollar or two per household per month at modest scale, plus cellular data if the unit has a SIM.

How long

A BLE-only app with reminders, an offline log, and caregiver push takes roughly three to four months. A hub-based product with the full escalation chain and a dashboard usually takes five to eight months, and the firmware is usually the long pole. Hardware revisions, certification (FCC and similar), and manufacturing are on their own clock and often run longer than the software.

What to build first

Resist the urge to ship everything. A first release should prove one claim: families know within an hour when a dose is missed. Anything that does not serve that claim can wait.

Build in this order. First, device pairing and clock sync. Second, the schedule write and the device-side dose log with sync. Third, the confirm flow for the patient, kept to one large button. Fourth, caregiver linking by pairing key. Fifth, the escalation chain with push and SMS. Sixth, offline-device and low-battery alerts. Phone calls, weekly adherence reports, refill reminders, and pharmacy integrations come after you have real households using it.

Skip pill identification by camera, drug interaction checks, and AI features in version one. They add regulatory exposure and engineering time before you know whether the basic loop works. Once it does, there is plenty to add. A weekly summary written in plain language for the caregiver is a good first AI feature, and it carries much less risk than anything that touches dosing.

Plan a pilot with 20 to 50 real households before you scale. Watch the escalation logs. You will find that people mute alerts, travel with the dispenser, move it to another room, and share one phone between two spouses. Each of those is a product decision, not a bug.

How we would build it

If we were scoping this for you, we would start with a four-week design and architecture phase. That phase produces the device protocol document, the household and role data model, the escalation rules, and clickable prototypes for the patient and caregiver flows. We would also use it to list every claim the product makes, so your regulatory lawyer can review before the build starts.

The first version would be a React Native app with BLE setup and a nearby-phone sync, a Postgres backend with a durable job runner, and the escalation chain through push and SMS. The patient screen would be one confirm button and today's schedule. The caregiver screen would be a timeline of doses with alert settings per medication. We would test the notification path on a spread of old and new phones before anything else, because that is where these products fail.

After launch, the next releases would add phone call escalation, a facility dashboard with multiple patients, refill reminders, a weekly summary, and over-the-air firmware tooling. Each of those builds on the same event log, which is why we get that log right first.

If you have a dispenser prototype and want a realistic plan, scope, and timeline for the app around it, Book a free strategy call.

smart pill dispenser appmedication reminder app developmentcaregiver alertsBLE companion appconnected medical device app

Your app, on the App Store.

Thirty minutes. You leave with a plan and a number.

Book a free call