How tom1030507/ncu_iot_roboticpetdog works
Project Type and Purpose
• This is an embedded IoT/robotics project built around an ESP32 microcontroller.
• Purpose: a pet-dog simulator that authenticates an owner via RFID, tracks a BLE-enabled ball, reads environmental data, and displays “moods” on an OLED.
File Structure
• Single source file: robotic_pet_dog.ino – all application logic resides here.
• No separate “frontend”/“backend”: it’s a monolithic embedded application.
• The README details hardware modules and Arduino libraries, indicating tight hardware-software coupling.
Main Components
a. ESP32 Microcontroller (central processing unit)
b. Peripherals wired to ESP32:
• MFRC522 RFID Reader (owner authentication)
• DHT22 Temperature/Humidity Sensor (environmental sensing)
• Seeed OLED Display (UI / mood/chat display)
• Motor Driver Circuit + DC Motors (movement / fetch behavior)
c. External BLE Beacon (inside the ball)
d. Owner’s RFID Card (external input token)
e. Power Supply (battery or USB)
f. Arduino Runtime / Task Loop (software layer)
Relationships & Interactions
• RFID Reader ←→ ESP32: SPI interface for UID reads; toggles active/inactive state.
• DHT22 ←→ ESP32: single-wire digital sensor input; periodic reads update mood logic.
• OLED ←→ ESP32: I²C/SPI bus; displays status, temperature, humidity, and chat messages.
• Motor Driver ←→ ESP32: GPIO/PWM outputs control speed/direction based on BLE RSSI feedback.
• ESP32 ↔ BLE Beacon: Bluetooth Low Energy scanning; RSSI measurement guides locomotion.
• User’s RFID Card → RFID Reader: proximity triggers authentication event.
• Power → All hardware modules.
Architectural Patterns / Design Principles
• Event-Driven Loop: The Arduino loop() polls sensors, checks RFID/ BLE events, updates actuators/display.
• Reactive Behavior: State machine driving “Idle,” “Active,” “Finding Ball,” “Found Ball” modes.
• Layered Abstraction:
• Hardware Abstraction (libraries: MFRC522, DHT, SeeedOLED, BLEDevice)
• Application Logic (state machine, decision rules)
• Presentation (OLED messages)
Elements to Include for Clarity
• Blue for sensing (DHT22, RFID)
• Green for actuation (Motor Driver, Motors)
• Orange for UI (OLED)
• Purple for wireless comms (BLE Beacon)
• Rounded rectangles for modules