Fab Academy 2026  ·  Week 16

System
Integration

System integration was one of the most important and challenging stages of HigiBox. I combined the mechanical structure, electronics, power system, sensors, interface, and software inside a single compact enclosure through progressive testing and iteration.

Electronics CAD Modeling System Architecture Integration Testing PCB Design 3D Modeling
System integration diagram

Deliverables

  1. Design system integration for final project
  2. Document plan with CAD & sketches
  3. Create packaging strategy
  4. Show component relationships

Documentation

  • Integration diagrams
  • Exploded assembly views
  • Bill of Materials (BOM)
  • Component specifications
  • Assembly workflow

Key Topics

  • System architecture
  • CAD modeling
  • Component testing
  • Integration workflows
  • Power systems
01
System Architecture

Project Overview

HigiBox is a compact sanitary pad dispenser that stores products vertically and releases one unit through a motor-driven spiral mechanism. The complete system needed to integrate mechanical structures, electronics, power systems, sensors, interfaces, and software into a single cohesive device.

Core Systems

01
Mechanical System

Spiral mechanism for product dispensing. Motor-driven rotation. Acrylic enclosure.

02
Electrical System

Custom PCB. Motor driver. Power management. Voltage regulation.

03
Sensing System

Hand detection sensor. Stock monitoring sensor. VL53L0X Time-of-Flight.

04
User Interface

2.8-inch TFT display. Real-time information. Menstrual cycle tracking.

05
Control System

XIAO ESP32-C3 microcontroller. Arduino IDE programming. Wi-Fi connectivity.

06
Power System

12V rechargeable battery. LM2596 step-down converter. USB-C charging.

02
Concept & Inspiration

Idea and Design Development

HigiBox was inspired by commercial sanitary pad vending machines and Arduino-based dispensers. These references showed me how rotating spirals could move products forward and how empty space below the storage area could contain electronics.

Spiral mechanism reference Vending machine reference
Design Goal: Adapt the commercial concept into a smaller, personal-use device that is rigid, compact, easy to open, and capable of holding sanitary pads, dispensing mechanism, electronics, battery, and display.

Initial Layout Strategy

Before detailed 3D modeling, I sketched how main systems could be arranged inside the enclosure:

Initial internal layout sketch
Upper Section

Sanitary pads and spiral mechanism occupy vertical storage area.

Motor Position

Motor placed next to spiral, requiring minimal vertical space.

Lower Section

Microcontroller, battery, drivers, and power modules positioned below.

Electronics Bay

Sensors, PCB, wiring, and battery in reserved side areas.

Enclosure Dimensions

The first proposed enclosure provided enough space while maintaining compact form:

  • Width: 40 cm
  • Height: 22 cm
  • Depth: 13 cm
Enclosure dimensions and proportions
03
CAD & Spatial Planning

3D Modeling and Spatial Planning

I began modeling the first version of the dispenser in Autodesk Inventor. This model was not intended to represent the final appearance of HigiBox. It was an initial draft that helped me understand the available internal space and check whether the storage area, dispensing spiral, motor, electronics, and product outlet could fit inside the proposed enclosure.

Initial 3D model in Autodesk Inventor

Functional Area Division

This draft allowed me to divide the product into functional areas. The spatial planning was crucial to ensure all systems could coexist:

1️⃣
Upper Section — Product Storage

Sanitary pads and spiral mechanism occupy vertical storage compartment. Spiral diameter and storage height determined by product dimensions.

2️⃣
Motor Positioning

Motor positioned next to spiral shaft to minimize horizontal space. ULN2003 driver mounted nearby for efficient wiring.

3️⃣
Lower Electronics Area

Microcontroller, custom PCB, and power regulation circuits occupy space below product storage area. Vertical stacking optimizes enclosure depth.

4️⃣
Side Sensor & Battery Placement

VL53L0X sensors, battery, INA219 sensor, and wiring routes placed in side areas. Enables modular assembly and future modifications.

Key Insight: At this stage, exact positions of sensors, PCB, wiring, battery, and motor support were still being defined. The 3D model served as a testing ground for spatial conflicts before committing to manufacturing.

Reference CAD Models from GrabCAD

To obtain a more realistic representation, I downloaded reference CAD models of the electronic components. These models were not designed by me; they were used only to estimate the size and space required by each component inside the assembly:

📦 Reference Components Imported
+

Models included:

  • Stepper motor (28BYJ-48)
  • TFT display (2.8-inch)
  • Distance sensor (VL53L0X)
  • I2C Multiplexer (TCA9548A)
  • Motor driver (ULN2003)
  • Other electronic modules

These reference models helped identify collision zones and evaluate different mounting positions before finalizing the design.

Component CAD references and assembly exploration:

Component reference model 1 Component reference model 2 Component reference model 3
Component reference model 4 Component reference model 5 Component assembly exploration

Component Placement & Collision Detection

After importing the component models into Inventor, I placed them inside the enclosure to identify possible collisions and evaluate different mounting positions:

Complete assembly with all components inside enclosure
Collision Testing

Verified clearances between motor and spiral storage, battery and electronics bay, sensors and mounting brackets.

Mounting Position Evaluation

Tested multiple configurations for PCB placement, sensor positioning, and cable routing paths.

Access Planning

Designed internal structure to allow maintenance access to battery, PCB connectors, and sensor cables.

Assembly Sequence Planning

Determined optimal assembly order: spiral frame → motor mount → electronics tray → wiring routes.

Exploded Assembly Visualization

I also created an exploded assembly to visualize the relationship between all major components and understand the assembly process:

🎬 Assembly Component Breakdown
+

The yellow assembly version includes:

  • Upper Spiral Compartment: Holds vertically stacked sanitary pads with rotating spiral mechanism
  • Motor & Coupling: 28BYJ-48 stepper motor driving the spiral shaft rotation
  • Front Display Panel: Opening for 2.8-inch TFT display with user interface
  • Lower Electronics Area: PCB mounting plate with XIAO ESP32-C3, power regulation, and sensor connectors
  • Internal Divisions: Barriers separating product storage from electronics to prevent contamination
  • Access Door: Removable cover for battery replacement and maintenance

Assembly Relationships:

  • Spiral shaft connects front bearing to motor coupling
  • Motor bracket mounts securely to enclosure frame
  • PCB mounting plate sits on support posts above battery compartment
  • Display panel secured to front face with screws
  • Sensor holders positioned at precise locations for hand detection and stock monitoring

Work-in-Progress Design Purpose

However, this assembly was still a work-in-progress model. Its primary purpose was to guide the integration process and help identify the remaining design decisions that needed to be made:

Cable Routes

Define optimal paths for power wiring, I2C communication lines, and motor control cables. Minimize interference and mechanical stress.

Sensor Positions

Determine exact placement of VL53L0X sensors for reliable hand detection and stock monitoring. Account for optical line-of-sight requirements.

Battery Location

Select optimal battery position to balance weight distribution, minimize heat impact on other components, and allow USB-C access.

PCB Mounting Points

Define custom PCB size, connector locations, and mounting bracket design for secure positioning and vibration isolation.

Maintenance Access

Ensure design allows for battery replacement, PCB connector access, and sensor cleaning without complete disassembly.

Manufacturing Approach

Determine which parts to fabricate (laser-cut acrylic, 3D-printed components, custom PCB milling) versus purchase as assemblies.

Model as Tool: The 3D model served as a communication device between design concept and physical implementation. It helped validate feasibility, identify manufacturing constraints, and guide the subsequent fabrication process for individual components.
04
Procurement & BOM

Components Available for Integration

By this stage, I had all principal electronic components and materials ready for testing. This allowed evaluation of dimensions, connections, power requirements, and compatibility before finalizing the design.

Packaging Strategy

The rectangular enclosure would remain closed during normal operation, allowing the electronic system to be protected inside the dispenser. The internal layout divides the space into functional areas:

Product Storage Area

Upper section: Sanitary pads and spiral mechanism occupy vertical storage space.

Motor & Driver Section

Motor positioned next to spiral with ULN2003 driver nearby for space efficiency.

Electronics Bay

Custom PCB and microcontroller mounted on supporting structure below pads.

Power & Sensors

Battery, LM2596 converter, sensors, and wiring in lower and side areas.

Design Goal: This separation prevents sanitary pads from coming into direct contact with electronics while maintaining a compact, accessible design for maintenance.

Bill of Materials (BOM) with Images

Component Description Source Cost (USD) Image
TFT LCD Display 2.8-inch touchscreen for cycle, battery, stock info Zacatrex Electrónica $28.57 TFT Display
TCA9548A Multiplexer I2C bus multiplexer for dual sensors Zacatrex Electrónica $2.29 Multiplexer
ULN2003 Motor Driver Controls the 28BYJ-48 motor coils Zacatrex Electrónica $1.43 Motor Driver
28BYJ-48 Stepper Motor Rotates the dispensing mechanism Fab Lab ULima $2.86 Stepper Motor
LM2596 Converter Step-down: 12V to 5V power regulation Zacatrex Electrónica $2.00 Converter
INA219 Power Sensor Voltage, current, and power monitoring Zacatrex Electrónica $5.71 Power Sensor
12V Rechargeable Battery Powers the system with USB Type-C charging Zacatrex Electrónica $20.00 Battery
VL53L0X Sensors (×2) Time-of-Flight distance sensors for stock & hand detection Zacatrex Electrónica $6.86 Distance Sensors
Jumper Cables For prototyping and integration testing Fab Lab ULima $1.43 Jumper Cables
White Acrylic (4mm) Enclosure and internal divisions material Fab Lab ULima $30.00 Acrylic Sheet
PolyLite White PLA 3D printing material for supports & parts Fab Lab ULima $20.00 White PLA
PolyLite Black ABS 3D printing material for stronger components Fab Lab ULima $18.57 Black ABS
XIAO ESP32-C3 Main microcontroller with Wi-Fi & Bluetooth MTLab UNI $14.29 XIAO ESP32
Custom PCB Material Copper-clad PCB for milling & manufacturing Fab Lab ULima $2.28 PCB Material
TOTAL COST USD 156.86

Parts to Be Fabricated

The following custom elements needed to be designed and manufactured specifically for HigiBox:

  • Acrylic enclosure and internal divisions
  • Custom PCB design and milling
  • Rotating dispensing spiral
  • Motor-to-spiral coupling mechanism
  • Motor support structure
  • Sensor holders and spacers
  • PCB protective case
  • Rounded enclosure corners
  • Cable guides and internal mounts
  • Control software and TFT interface
05
Sensor Development

Individual Test of the VL53L0X

Distance sensing was essential because one sensor would monitor stock levels while another would detect the user's hand presence. I evaluated multiple sensor approaches before selecting the VL53L0X Time-of-Flight sensor.

Sensor Selection Process

Initially, I considered creating an infrared sensor using a separate emitter and receiver:

Initial infrared sensor concept

However, this solution required precise calibration and was affected by alignment and ambient light variations. I therefore selected the VL53L0X Time-of-Flight sensor, which uses an invisible infrared laser and communicates through I2C.

VL53L0X Sensor

VL53L0X sensor specifications
Stock Detection Logic
  • Short distance: Sanitary pads are available
  • Long distance: Compartment is empty or needs refilling
Hand Detection Logic
  • Object detected: User hand present
  • Distance threshold: < 100 mm triggers dispensing

First Test — Distance Reading

I first tested the sensor independently to understand its connections, measurement range, and response time before adding it to the complete system.

Test Code

#include <Wire.h>
#include <Adafruit_VL53L0X.h>

Adafruit_VL53L0X lox = Adafruit_VL53L0X();
const int pinLed = 8;

void setup() {
  Serial.begin(115200);
  pinMode(pinLed, OUTPUT);
  digitalWrite(pinLed, LOW);
  
  while (!Serial) { delay(1); }
  Serial.println("Starting VL53L0X test...");
  
  if (!lox.begin()) {
    Serial.println("Error finding VL53L0X! Check connections.");
    while (1);
  }
  Serial.println("VL53L0X ready.");
}

void loop() {
  VL53L0X_RangingMeasurementData_t measure;
  lox.rangingTest(&measure, false);
  
  if (measure.RangeStatus != 4) {
    int distancia = measure.RangeMilliMeter;
    Serial.print("Distance: ");
    Serial.print(distancia);
    Serial.println(" mm");
    
    if (distancia < 100) {
      digitalWrite(pinLed, HIGH);
    } else {
      digitalWrite(pinLed, LOW);
    }
  } else {
    Serial.println("Out of range or object too far.");
    digitalWrite(pinLed, LOW);
  }
  delay(1000);
}
Key Finding: The VL53L0X provided stable, reliable distance measurements without requiring external calibration, making it the ideal choice for both stock and hand detection in HigiBox.
05b
Integration Challenges

TFT Display Integration Challenge

The TFT display was one of the most difficult components to integrate, revealing important lessons about pin management and system architecture.

The Problem

Unlike the VL53L0X and INA219 sensors, the TFT display does not use I2C. It communicates through SPI and requires several dedicated control pins.

Pin Conflict Identified

The display required D8 for the SPI clock signal. However, the second PCB version already used D8 for a button, while D7 was assigned to an LED.

Impact

This conflict prevented the screen from being connected correctly to the complete system, blocking further integration.

The Solution

I reviewed the XIAO ESP32-C3 pinout documentation, modified the PCB design, and reserved D8 specifically for the TFT display SPI connection.

Lesson Learned: Integration is not only about connecting components physically. It also requires careful management of the microcontroller's limited GPIO pins. A complete system view is essential before finalizing PCB designs.
06
Progressive Testing

Integration Tests and Validation

After testing individual modules separately, I combined them progressively. Each stage helped identify wiring, pin-assignment, programming, power, and communication problems before transferring to the custom PCB.

Test 1 — VL53L0X Distance Reading

Focused on the VL53L0X sensor and XIAO ESP32-C3. Verified stable I2C communication and distance readings before connecting display, motor, or second sensor.

Components Tested
  • XIAO ESP32-C3
  • VL53L0X sensor
  • I2C communication
Test 2 — Distance Detection & Motor Activation

Combined XIAO ESP32-C3, one VL53L0X sensor, TFT display, ULN2003 driver, and 28BYJ-48 motor.

Results
  • TFT displayed distance readings
  • Motor activated when distance in range
  • Programmed motor movement verified
Test 3 — First Combined Breadboard Assembly

Multiple modules on breadboards to inspect wiring, power connections, communication paths, and component arrangement.

Key Finding

The circuit required many jumper cables, demonstrating why a custom PCB was essential for final design.

Test 4 — TFT Interface Sequence

Focused on graphical interface functionality and user experience displays.

Display Features
  • Menstrual cycle calendar
  • Battery status information
  • Stock availability
  • Current cycle day
  • Motivational messages
Test 5 — Dual Sensors & INA219 Monitoring

Combined two VL53L0X sensors, TCA9548A multiplexer, INA219, display, and XIAO ESP32-C3.

Verification
  • TCA9548A separated dual sensors on I2C
  • Both distances read simultaneously
  • Battery info monitored in real time
  • Display updated continuously
06
Control & Power Systems

Software Integration and Power Diagram

Microcontroller Selection

Initially, I considered the XIAO nRF52840 for its compact size, low power, and Bluetooth. However, HigiBox required internet access for Wi-Fi time synchronization through an NTP server. The XIAO nRF52840 lacks integrated Wi-Fi, so I switched to the XIAO ESP32-C3.

XIAO ESP32-C3 microcontroller XIAO pinout diagram
Key Advantages
  • Integrated 2.4 GHz Wi-Fi
  • Bluetooth Low Energy
  • Compact dimensions
  • SPI for TFT display
  • I2C for sensors
  • Flexible GPIO control
System Initialization
  1. Serial monitor start
  2. Motor pin configuration
  3. SPI & TFT initialization
  4. I2C communication start
  5. Wi-Fi connection
  6. NTP time sync
  7. VL53L0X sensors init
  8. INA219 initialization
  9. First readings
  10. Display first screen

Power Distribution

Two power diagram versions show the evolution of the system design:

Initial power diagram

Before: Dual motor concept

Final power diagram

After: Single motor + multiplexer

Power Strategy: 12V battery powers motors and drivers. LM2596 step-down converter reduces voltage to 5V for microcontroller, display, sensors, and modules. All components share common ground connection.

Dispensing Logic

if (objetoCerca && stockPermite && !objetoAntes && !motorGirando) {
  girarUnaVuelta();
}

The motor activates only when: hand detected, dispensing permitted, detection is new, and motor not already moving. The objetoAntes variable prevents repeated dispensing while the user keeps their hand in front of the sensor.

07
Custom PCB Design

PCB Evolution and Development

I manufactured three PCB versions during HigiBox development, each improving upon the previous design through iterative testing and refinement.

First PCB

First PCB prototype

The first board was too long for the internal space and eventually broke during testing. It demonstrated that the PCB needed to be smaller, stronger, and better adapted to the enclosure.

Second PCB

PCB milling process Second PCB board

The second version was smaller with thicker traces, smoother routing, greater clearance, and improved milling offset. However, D8 and D7 were occupied by a button and LED, creating conflicts with the TFT display. Some connectors were also too close to the board edge.

Third and Final PCB

Final PCB design

The third board corrected all pin conflicts and became the final PCB. It included:

  • Eight 3.3V outputs
  • Ten GND outputs
  • Six 5V outputs
  • Two D6 connections
  • Two D7 connections
  • D8 reserved for TFT SPI

These extensions allowed modules to connect directly to the custom PCB, eliminating external breadboards and reducing loose wiring.

PCB Case Design

After completing the final PCB, I designed a 3D-printed support to protect its edges and provide internal mounting points.

PCB case design 1 PCB case design 2
PCB case design 3 PCB case design 4

The PCB case included a 0.40mm FDM tolerance offset, 7mm external support offset, 1mm base, and 3mm outer ring to protect connectors and provide stable mounting inside the enclosure.

08
System Overview

Final System Architecture

The integrated HigiBox system combines mechanical, electrical, and software components into a cohesive smart dispensing device. All systems work in concert through the central XIAO ESP32-C3 microcontroller.

Core Components

🧠
Main Controller

XIAO ESP32-C3 — Processes all sensor readings, updates the display, monitors battery, obtains the date through Wi-Fi, and controls the motor.

📊
Display System

2.8-inch TFT Display — Shows menstrual cycle information, battery status, stock availability, and motivational messages in real time.

👋
Detection Sensors

Two VL53L0X Sensors — One monitors stock levels, the other detects user hand presence through Time-of-Flight distance measurement.

⚙️
Motor System

28BYJ-48 Stepper + ULN2003 Driver — Rotates the dispensing spiral mechanism to release one sanitary pad per activation.

🔋
Power Management

12V Battery + LM2596 Converter + INA219 — Powers the system with voltage regulation and real-time power monitoring.

🛠️
Custom PCB

Third-generation PCB — Routes all connections, manages I2C multiplexing, and provides mounting points for all modules.

Communication Protocols

I2C Bus

Connects: VL53L0X sensors (via TCA9548A multiplexer), INA219 power sensor. Provides multi-device support with address multiplexing.

SPI Bus

Connects: 2.8-inch TFT display. Provides high-speed graphics rendering and real-time interface updates.

GPIO Control

Connects: Motor coils via ULN2003 driver. Provides stepper motor control for dispensing mechanism.

Wi-Fi Connection

Connects: NTP server for time synchronization. No internet gateway required for basic operation.

Data Flow

Sensor → Controller → Decision → Action: VL53L0X sensors measure distances and send data via I2C to XIAO. Microcontroller evaluates dispensing conditions. If conditions met, GPIO pins activate motor through ULN2003 driver. TFT display updates continuously to show system status, battery level, and cycle information.
09

Get in Touch