15. System Integration

This week's assignment is to design and document the system integration for my final project. System integration means thinking about how all the individual parts (electronics, mechanics, firmware, housing, and user interface) come together as a single cohesive device. The framework I am following covers: design, packaging, testing, failure modes, repair, and lifecycle.

The project: Pill Dispenser

The Pill Dispenser is an automated device designed for my grandfather. The goal is to help elderly users take the right medication at the right time, every day, for a full 31-day cycle, without relying on anyone else to prepare each dose on the spot. The chosen idea is modular day-pods, where a removable module is prepared once per day by a caregiver, snapped into the dispenser, and the device handles timing, alarm, dispensing, and confirmation automatically.

Why modular pods?

The modular day-pod approach uses only one servo motor per pod to open a trapdoor, keeping the mechanical complexity low and the cost accessible. The modules are designed to be pulled out, refilled at a pharmacy or at home in batch, and snapped back in. No tools required. The electronics and mechanics are separated: the base station handles all the intelligence, and the pods are purely passive mechanical containers with a simple servo latch.

System architecture overview

The Pill Dispenser is organized around a central XIAO ESP32-C6 controller that orchestrates six independent subsystems. The diagram below shows how they connect:

Actuation

Servo SG90

Opens the day-pod trapdoor on schedule

Motion

28BYJ-48 Stepper

Rotates carousel to the correct day-pod

Sensing

IR + Load cell

Detects whether pills were actually taken

Controller

XIAO ESP32-C6

Custom PCB
I²C bus · GPIO · PWM
WiFi AP

Display

OLED SSD1306

Shows time, dose status, and alerts (I²C)

Time

RTC DS3231

Real-time clock with CR2032 backup (I²C)

Alert

Buzzer + LED RGB

Audible and visual alarm at dose time

Modular pod concept

Each day-pod is a 3D-printed rectangular container that holds up to four pills (one full day's dosage pre-sorted by a caregiver). The pod snaps onto a circular carousel with 31 slots - one per day. A single SG90 servo is mounted on the base station at a fixed dispensing position; when the carousel rotates to the active pod, the servo arm reaches into the pod and flips the trapdoor open. Pills fall through a chute into a collection tray. The pod is then either re-filled or discarded.

This keeps the electronic complexity minimal: one stepper, one servo, one ESP32 - regardless of how many types of pills the user takes. A caregiver batch-fills all 31 pods once a month in about 10 minutes.

Packaging integration

The enclosure combines FDM-printed PLA for complex 3D geometry with laser-cut acrylic for flat structural parts. All joints use M3 screws and standard connectors , no glue. The collection tray and chute clip out without tools for cleaning.