# momysnow/momy-desk-robot architecture

> Architecture diagram of the GitHub repository momysnow/momy-desk-robot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/momysnow/momy-desk-robot
- Repository: https://github.com/momysnow/momy-desk-robot

## Overview

Momy is an ESP32S3 desk robot combining sensing, network-connected interaction, visual feedback, and moving physical parts. The intended user flow is remote interaction or onboard sensing, followed by firmware-mediated responses through its screen, audio, or body. The README describes vision, listening, sound, environmental monitoring, and power capabilities; the tree also contains physical-part models. Source excerpts show camera upload, microphone recording/transcription upload, MQTT connectivity, and display assets. Several README capabilities have no sampled implementation, so those links are documented at a high level rather than inferred between firmware modules.

Main entry points: [`boot/boot.ino`](https://github.com/momysnow/momy-desk-robot/blob/main/boot/boot.ino) (ESP32S3 firmware), [`boot/DisplayTools.cpp`](https://github.com/momysnow/momy-desk-robot/blob/main/boot/DisplayTools.cpp) (Screen rendering), [`boot/CameraUploader.cpp`](https://github.com/momysnow/momy-desk-robot/blob/main/boot/CameraUploader.cpp) (Camera capture), [`boot/MqttHandler.cpp`](https://github.com/momysnow/momy-desk-robot/blob/main/boot/MqttHandler.cpp) (Remote control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Robot firmware"]
  node_firmware["ESP32S3 firmware<br/>[boot.ino]"]
  node_mqtt["Remote control<br/>[MqttHandler.cpp]"]
end

subgraph group_sensing["Sensing and services"]
  node_camera["Camera capture<br/>[CameraUploader.cpp]"]
  node_camera_pins["Camera pin mapping<br/>[camera_pins.h]"]
  node_mic["Audio recording<br/>[microphone.cpp]"]
  node_weather["Weather service<br/>[WeatherApi.cpp]"]
  node_sd["SD storage<br/>[sd_read_write.cpp]"]
end

subgraph group_interaction["User interaction"]
  node_display["Screen rendering<br/>[DisplayTools.cpp]"]
  node_eyes["Eye animation<br/>[Eyes.cpp]"]
  node_emotion["Emotion states<br/>[Emotion.cpp]"]
  node_audio_output["Sound response<br/>[alarm.h]"]
  node_screen_assets["Screen assets<br/>[Logo.h]"]
  node_small_font["Small font<br/>[NotoSansBold15.h]"]
  node_large_font["Large font<br/>[NotoSansBold36.h]"]
  node_chatgpt["AI interaction<br/>[chatgpt.cpp]"]
end

subgraph group_hardware["Robot hardware"]
  node_body["Moving body"]
  node_head["Head assembly"]
  node_base["Base assembly"]
end

node_user(("User"))
node_mqtt_service(("MQTT broker"))
node_vision_service(("Image server"))
node_speech_service(("Speech recognition"))
node_weather_service(("Weather provider"))

node_user -.->|"interacts with"| node_firmware
node_firmware -.->|"offers remote control"| node_mqtt
node_mqtt -->|"publishes MQTT"| node_mqtt_service
node_camera -->|"configures pins"| node_camera_pins
node_camera -->|"uploads images"| node_vision_service
node_mic -->|"uploads audio"| node_speech_service
node_firmware -.->|"uses weather data"| node_weather
node_weather -.->|"requests weather"| node_weather_service
node_display -->|"renders logo"| node_screen_assets
node_display -->|"uses font"| node_small_font
node_display -->|"uses font"| node_large_font
node_firmware -.->|"provides visual feedback"| node_display
node_firmware -.->|"animates eyes"| node_eyes
node_firmware -.->|"selects expressions"| node_emotion
node_firmware -.->|"responds with sound"| node_audio_output
node_firmware -.->|"handles complex tasks"| node_chatgpt
node_firmware -.->|"moves parts"| node_body
node_firmware -.->|"houses sensors"| node_head
node_firmware -.->|"uses battery power"| node_base

click node_firmware "https://github.com/momysnow/momy-desk-robot/blob/main/boot/boot.ino"
click node_mqtt "https://github.com/momysnow/momy-desk-robot/blob/main/boot/MqttHandler.cpp"
click node_camera "https://github.com/momysnow/momy-desk-robot/blob/main/boot/CameraUploader.cpp"
click node_camera_pins "https://github.com/momysnow/momy-desk-robot/blob/main/boot/camera_pins.h"
click node_mic "https://github.com/momysnow/momy-desk-robot/blob/main/boot/microphone.cpp"
click node_weather "https://github.com/momysnow/momy-desk-robot/blob/main/boot/WeatherApi.cpp"
click node_sd "https://github.com/momysnow/momy-desk-robot/blob/main/boot/sd_read_write.cpp"
click node_display "https://github.com/momysnow/momy-desk-robot/blob/main/boot/DisplayTools.cpp"
click node_eyes "https://github.com/momysnow/momy-desk-robot/blob/main/boot/Eyes.cpp"
click node_emotion "https://github.com/momysnow/momy-desk-robot/blob/main/boot/Emotion.cpp"
click node_audio_output "https://github.com/momysnow/momy-desk-robot/blob/main/boot/alarm.h"
click node_screen_assets "https://github.com/momysnow/momy-desk-robot/blob/main/boot/Logo.h"
click node_small_font "https://github.com/momysnow/momy-desk-robot/blob/main/boot/NotoSansBold15.h"
click node_large_font "https://github.com/momysnow/momy-desk-robot/blob/main/boot/NotoSansBold36.h"
click node_chatgpt "https://github.com/momysnow/momy-desk-robot/blob/main/boot/chatgpt.cpp"
click node_body "https://github.com/momysnow/momy-desk-robot/tree/main/components/body"
click node_head "https://github.com/momysnow/momy-desk-robot/tree/main/components/head"
click node_base "https://github.com/momysnow/momy-desk-robot/tree/main/components/base"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_firmware,node_mqtt,node_user toneBlue
class node_camera,node_camera_pins,node_mic,node_weather,node_sd toneAmber
class node_display,node_eyes,node_emotion,node_audio_output,node_screen_assets,node_small_font,node_large_font,node_chatgpt,node_vision_service toneMint
class node_body,node_head,node_base toneRose
class node_mqtt_service,node_speech_service,node_weather_service toneIndigo
```

## Components

### Robot firmware

- [ESP32S3 firmware](https://github.com/momysnow/momy-desk-robot/blob/main/boot/boot.ino): `boot/boot.ino`
- [Remote control](https://github.com/momysnow/momy-desk-robot/blob/main/boot/MqttHandler.cpp): `boot/MqttHandler.cpp`

### Sensing and services

- [Camera capture](https://github.com/momysnow/momy-desk-robot/blob/main/boot/CameraUploader.cpp): `boot/CameraUploader.cpp`
- [Camera pin mapping](https://github.com/momysnow/momy-desk-robot/blob/main/boot/camera_pins.h): `boot/camera_pins.h`
- [Audio recording](https://github.com/momysnow/momy-desk-robot/blob/main/boot/microphone.cpp): `boot/microphone.cpp`
- [Weather service](https://github.com/momysnow/momy-desk-robot/blob/main/boot/WeatherApi.cpp): `boot/WeatherApi.cpp`
- [SD storage](https://github.com/momysnow/momy-desk-robot/blob/main/boot/sd_read_write.cpp): `boot/sd_read_write.cpp`

### User interaction

- [Screen rendering](https://github.com/momysnow/momy-desk-robot/blob/main/boot/DisplayTools.cpp): `boot/DisplayTools.cpp`
- [Eye animation](https://github.com/momysnow/momy-desk-robot/blob/main/boot/Eyes.cpp): `boot/Eyes.cpp`
- [Emotion states](https://github.com/momysnow/momy-desk-robot/blob/main/boot/Emotion.cpp): `boot/Emotion.cpp`
- [Sound response](https://github.com/momysnow/momy-desk-robot/blob/main/boot/alarm.h): `boot/alarm.h`
- [Screen assets](https://github.com/momysnow/momy-desk-robot/blob/main/boot/Logo.h): `boot/Logo.h`
- [Small font](https://github.com/momysnow/momy-desk-robot/blob/main/boot/NotoSansBold15.h): `boot/NotoSansBold15.h`
- [Large font](https://github.com/momysnow/momy-desk-robot/blob/main/boot/NotoSansBold36.h): `boot/NotoSansBold36.h`
- [AI interaction](https://github.com/momysnow/momy-desk-robot/blob/main/boot/chatgpt.cpp): `boot/chatgpt.cpp`

### Robot hardware

- [Moving body](https://github.com/momysnow/momy-desk-robot/tree/main/components/body): `components/body`
- [Head assembly](https://github.com/momysnow/momy-desk-robot/tree/main/components/head): `components/head`
- [Base assembly](https://github.com/momysnow/momy-desk-robot/tree/main/components/base): `components/base`

### Other components

- **User**
- **MQTT broker**
- **Image server**
- **Speech recognition**
- **Weather provider**

## Connections

- User → ESP32S3 firmware: interacts with (evidence: `README.md`)
- ESP32S3 firmware → Remote control: offers remote control (evidence: `README.md`)
- Remote control → MQTT broker: publishes MQTT (evidence: `boot/MqttHandler.cpp`)
- Camera capture → Camera pin mapping: configures pins (evidence: `boot/CameraUploader.cpp`)
- Camera capture → Image server: uploads images (evidence: `boot/CameraUploader.cpp`)
- Audio recording → Speech recognition: uploads audio (evidence: `boot/microphone.cpp`)
- ESP32S3 firmware → Weather service: uses weather data (evidence: `README.md`)
- Weather service → Weather provider: requests weather (evidence: `README.md`)
- Screen rendering → Screen assets: renders logo
- Screen rendering → Small font: uses font
- Screen rendering → Large font: uses font
- ESP32S3 firmware → Screen rendering: provides visual feedback (evidence: `README.md`)
- ESP32S3 firmware → Eye animation: animates eyes (evidence: `README.md`)
- ESP32S3 firmware → Emotion states: selects expressions (evidence: `README.md`)
- ESP32S3 firmware → Sound response: responds with sound (evidence: `README.md`)
- ESP32S3 firmware → AI interaction: handles complex tasks (evidence: `README.md`)
- ESP32S3 firmware → Moving body: moves parts (evidence: `README.md`)
- ESP32S3 firmware → Head assembly: houses sensors (evidence: `README.md`)
- ESP32S3 firmware → Base assembly: uses battery power (evidence: `README.md`)
