How prashantbhandary/meshmerize-micromouse- works
Project Type and Purpose
• This is an embedded‐systems “Micromouse” line‐maze-solver robot. It comprises two parallel codebases:
• ArduinoNano folder: Arduino Nano–based firmware, PCB design (KiCad), and mechanical 3D models.
• Esp32 folder: ESP32–based firmware with PlatformIO and third-party Arduino libraries (Adafruit, QTR sensors, SparkFun TB6612FNG).
File Structure
• Top-level directories:
• ArduinoNano/… – multiple test sketches, two micro_mouse versions (v1, v2) with codes, PCB (“Ckt_PCB_files”), and 3D STEP models.
• Esp32/… – LineFolloweEsp32/Micromouse (source, include, lib, test), micromouse3.0 (KiCad), various test sketches.
• Key patterns: firmware (src/.ino or .cpp), hardware design (KiCad .kicad_pcb/.sch, STEP files), third-party libs under lib/, build config (platformio.ini).
• README.md provides high-level system description: sensors, motor driver, controllers, power regulation, and control algorithm (LSRB + PID).
Main Components
• Power Management: Buck converter + voltage regulators → supplies 5 V to Arduino/ESP32, 3.3 V to sensors/logic, 6 V to motors.
• Microcontroller: Arduino Nano (ATmega328P) or ESP32.
• Sensor Array: QTR reflectance sensors (digital/analog inputs).
• Motor Driver: L293D (for Nano) or TB6612FNG (for ESP32).
• Actuators: Two N20 gear motors (6 V, 500 rpm).
• Custom PCB: KiCad schematic & PCB design, 3D STEP enclosure parts.
• Firmware Modules:
– Sensor Interface (calibration, filtering)
– Maze‐solving Algorithm (LSRB)
– Control Loop (PID controller)
– Motor Control (PWM generation)
– Serial/Debug Interface (for tuning)
• Third-Party Libraries (Esp32/lib/…): Adafruit-GFX, Adafruit-BusIO, SSD1306, QTR sensors, SparkFun TB6612FNG.
• Build/IDE: Arduino IDE / PlatformIO (platformio.ini, CMakeLists).
c. External Environment
• Maze (lines on floor) and competition arena.
Relationships and Interactions
Power block → MCU, sensors, driver, motors.
Sensor Array → MCU (ADC/digital inputs).
MCU (algorithm) → Motor Driver (PWM outputs).
Motor Driver → Motors → robot motion in maze → sensors feedback (closed loop).
MCU ↔ PC (USB serial) for tuning & logging.
• For ESP32, show library dependencies under the firmware block.
Architectural Patterns and Design Principles
• Layered closed-loop control:
• Physical layer (sensors, motors)
• Hardware abstraction (driver ICs)
• Control algorithms (PID + LSRB)
• Modularity: separate test sketches, versioned firmware (v1, v2), hardware design iteration.
• Reusability: third-party Arduino libraries under lib/.
Essential Details
• PCB design files (KiCad schematic & layout).
• Mechanical parts (3D STEP models).
• Versioned firmware directories (micro_mouse_v1 vs _v2) to indicate iteration.
• If desired, annotate testing code locations (e.g., ArduinoNano/…/testing_code) as “lab validation modules”.