Skip to content

Magical Revolving Lantern System Design

Plan Adjustment Explanation

During the project progress, I recently completed the mechanical structure design of the revolving lantern's rotating shade, which prompted me to reassess and adjust the entire system. Through practical testing of the mechanical structure, I found the following limitations in the original hardware plan:

  1. Insufficient rotational drive: The originally planned Mini Fan cannot provide enough torque to drive the shade rotation, requiring a more powerful drive solution
  2. Limited lighting effects: The six onboard LEDs cannot provide omnidirectional lighting effects, affecting the visual performance of the revolving lantern
  3. Limited interactive experience: Single-direction gesture recognition cannot adapt to user operation from different angles
  4. Insufficient power supply: Fixed power cords limit the mobility and flexibility of the device

Based on these findings, I made comprehensive adjustments to the system plan, adopting solutions such as an N20 dual-shaft worm gear motor, dual RGB light strips, multi-directional gesture sensors, and a portable battery system to provide better user experience and system performance. These adjustments also required me to redesign the PCB to support the new hardware components and functions.

The core functional modules of the current project have been adjusted to:

  • Shade rotation system: Using the Grove Mini Fan DC driver to drive the N20 dual-shaft worm gear motor, which rotates the lantern shade through a gear mechanism.
  • RGB lighting effects: Using two 14-LED programmable full-color RGB light strips, installed back-to-back to achieve 360-degree visibility.
  • Multi-directional gesture interaction: Implementing omnidirectional gesture recognition and control through three parallel APDS-9960 gesture sensors.
  • Wi-Fi connection function: Implementing status synchronization between multiple lanterns and remote control via a web interface through the MQTT protocol.
  • Portable power system: Integrating a 4000mAh rechargeable battery to support mobile use.

This system integration plan will detail how to integrate these modules into a complete and reliable system based on the adjusted circular PCB design.

Magical Revolving Lantern System Design Diagram

Overview of the Adjusted Magical Revolving Lantern System Architecture

The physical structure composition diagram is shown below.

Physical structure composition diagram of the Magical Lantern

The system architecture composition of the Magical Revolving Lantern is shown in the diagram below.

System architecture composition diagram of the Magical Revolving Lantern

Adjusted System Component List

My Magical Revolving Lantern will use the following electronic hardware, with prices converted to USD from purchases made in China.

Component CategoryComponent NameQuantityStatusPrice(USD)Notes
Control CoreXIAO ESP32C31Available$5.00Main MCU, responsible for system control
Input DevicesXLOT APDS-9960 Gesture Sensor3Available$15.00Three-directional gesture recognition, connected in parallel
Output Devices14 LED RGB Light Strip2Available$4.00Back-to-back installation, providing 360° visual effects
N20 Dual-Shaft Worm Gear Motor1Available$6.00Obtained from Tozbamboo 3D printing kit
Grove Mini Fan Driver1Available$8.80Motor control
Power System4000mAh Rechargeable Battery1Available$4.00With Type-C interface, supporting simultaneous charging and discharging
Structural ComponentsLantern Shell1Completed-Completed laser-cut prototype in Week 3
Rotation Mechanism1Designed
Manufactured
-3D printed, compatible with N20 dual-shaft motor
PCB & Battery Compartment1To be designed
To be manufactured
-To be done after PCB board design
PCBCircular PCB Board1To be designed and manufactured-Customized according to the new plan

Software Architecture Diagram

Signal Flow Diagram

Circular PCB Design Specifications and Requirements

Basic Specifications

  • Shape: Circular PCB board
  • Diameter: Approximately 70mm (adjusted according to the size of XIAO ESP32C3 and all interface requirements)
  • Layers: Double-layer PCB (providing sufficient routing space)
  • Material: FR-4 standard material
  • Surface Treatment: Lead-free HASL (complying with environmental requirements)

Key Design Requirements

  1. Remove the 6 onboard LEDs from the original design
  2. Add the following functional interfaces:
    • 5V power input/output interface
    • 3 parallel APDS-9960 gesture sensor interfaces
    • 2 programmable RGB light strip connection interfaces
    • Motor driver connection interface

Interface Design Details

Power System Interface

  • Battery Interface: JST 2-pin connector for connecting the 4000mAh rechargeable battery
  • USB-C Interface: For external power supply or debugging
  • 5V Output Interface: 2 sets of 5V and GND pins for powering external components

Gesture Sensor Interface

  • I2C Interface×3: Interfaces designed for 3 parallel APDS-9960 gesture sensors
    • Each interface includes: VCC(3.3V), GND, SDA(data line), SCL(clock line)
    • All 3 interfaces share the same I2C bus, but each interface can independently control the VCC power

RGB Light Strip Interface

  • Light Strip Interface×2: Supporting parallel connection of 2 programmable RGB light strips
    • Each interface includes: 5V, GND, data control pin
    • Data control pins connect to the GPIO pins of XIAO ESP32C3

Motor Control Interface

  • Motor Driver Interface: Connecting the Grove Mini Fan motor driver
    • Includes: VCC(5V), GND, control signal pin
    • Control signal pin connects to a GPIO pin of XIAO ESP32C3

Adjusted Integration Steps

Phase One: PCB Design and Manufacturing (Estimated 5-7 days)

  1. Circular PCB Design
    • Complete schematic design according to the new plan
    • Design circular PCB layout
    • PCB routing and design verification
  2. PCB Manufacturing and Assembly
    • Produce the PCB board
    • Purchase and prepare all components
    • Solder the XIAO ESP32C3 and interface connectors
  3. Interface Testing
    • Test the 5V power system
    • Test the I2C bus
    • Test GPIO output interfaces

Phase Two: Component Integration (Estimated 2-3 days)

  1. Sensor System Integration
    • Connect 3 APDS-9960 gesture sensors
    • Write multi-sensor management code
    • Test sensor response
  2. RGB Light Strip Integration
    • Install 2 RGB light strips
    • Integrate the Adafruit_NeoPixel library
    • Implement basic lighting effects
  3. Motor System Integration
    • Install the N20 dual-shaft worm gear motor
    • Connect the Grove Mini Fan driver
    • Test motor control functions
  4. Power System Integration
    • Connect the 4000mAh rechargeable battery
    • Test charging and discharging functions
    • Measure system power consumption

Phase Three: Software Development (Estimated 2-3 days)

  1. Basic Firmware Development
    • Integrate multi-sensor processing code
    • Implement RGB light strip control logic
    • Implement motor control functions
  2. Communication System Implementation
    • Set up WiFi connection function
    • Implement MQTT communication protocol
    • Develop web control interface
  3. Function Integration
    • Implement gesture control logic
    • Develop multi-lantern synchronization function
    • Create battery management system

Phase Four: Mechanical Structure Integration (Estimated 5-7 days)

  1. Transmission Mechanism Implementation
    • Use the already designed transmission device
    • 3D print transmission parts
    • Test transmission effect
  2. Lantern Shell Adaptation
    • Modify lantern shell design
    • Create mounting structures for PCB and battery
    • Install RGB light strip brackets
  3. Final Assembly
    • Assemble all components
    • Secure connecting cables
    • Perform overall balance adjustment

Adjusted Testing Plan

Unit Testing

Test ObjectTest ContentExpected ResultPassing Criteria
Multi-sensor SystemThree-directional Gesture RecognitionRecognize gestures from three different directionsRecognition accuracy >85%
RGB Light Strip ControlLighting Effect ControlImplement light strip marquee effectSmooth visual effect
Motor ControlSpeed Control and Start/StopSmooth motor startup and speed adjustmentResponse time <150ms
Battery SystemBattery LifeOperating time under normal use>3 hours
Communication SystemMQTT Message Sending/ReceivingDevice message synchronizationDelay <200ms

Integration Testing

Test ScenarioTest ContentExpected ResultPassing Criteria
Omnidirectional Gesture ControlGesture operations from three directionsSystem responds to gestures from any directionResponse rate >90%
Light and Motor CoordinationControl synchronized changes of light and rotationCoordinated light and rotation effectsGood visual effect
Multi-lantern SynchronizationInteraction of two or more devicesChanges on one device synchronize to other devicesSynchronization delay <300ms
Power PerformanceFull-load operation testStable power supply from power systemVoltage fluctuation <0.2V

System Testing

Test AspectTest ContentExpected ResultPassing Criteria
ReliabilityContinuous Operation TestSystem operates stably for a long timeNo failures for 24 hours
Network AdaptabilityTesting in Different Network EnvironmentsSystem can adapt to network changesAutomatic reconnection success rate >95%
User ExperienceActual User Operation TestUsers can intuitively operate the systemHigh operation satisfaction
Power Consumption TestPower Consumption in Different ModesRecord and optimize power consumption performanceMeets battery life requirements

Potential Failure Analysis

Failure PointRisk DescriptionPreventive MeasuresFailure Handling Plan
PCB OverloadMultiple devices in parallel may cause PCB overload1. Increase PCB copper thickness
2. Widen power traces
3. Monitor system temperature
1. Software current limiting protection
2. Automatically reduce power consumption when temperature is too high
I2C ConflictMultiple sensors in parallel may cause address conflicts1. Verify sensor addresses
2. Software detection of address conflicts
3. Use I2C multiplexer
1. Automatically detect available sensors
2. Downgrade to single sensor mode
RGB Light Strip FailureLight strip data line interference or damage1. Add signal buffer
2. Keep data lines short and direct
3. Shield high-speed signal lines
1. Light strip self-check
2. Single light strip downgrade mode

Maintenance and Lifecycle Considerations

Modular Design and Maintainability

The adjusted Magical Revolving Lantern adopts a highly modular design to ensure easy maintenance and upgrades:

  1. Component Independence
    • PCB design uses connector connections instead of directly soldering external components
    • Three gesture sensors can be individually replaced and adjusted
    • RGB light strips use standard interfaces for easy replacement or upgrade
  2. Maintenance Convenience
    • Lantern shell design features a removable base for easy access to internal components
    • Battery is designed to be removable, supporting quick replacement
    • All interfaces and connectors are clearly labeled
  3. Fault Diagnosis Support
    • Built-in self-diagnosis program to check the status of each module via the web interface
    • LED indicators provide system status and error codes