# bdring/midtbot_esp32 architecture

> Architecture diagram of the GitHub repository bdring/midtbot_esp32, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bdring/midtbot_esp32
- Repository: https://github.com/bdring/midtbot_esp32

## Overview

MidTBot ESP32 is an open-source pen plotter: an operator supplies G-code, the ESP32 running Grbl_ESP32 receives it over USB, Bluetooth, Wi-Fi, or from onboard SD, and the machine draws using its belt-driven X/Y motion and servo-lifted pen. The repository provides controller PCB designs, mechanical models, and sample G-code rather than the firmware source. The README documents the runtime relationships; the tree identifies design artifacts, so internal firmware wiring and finer hardware connections are not shown.

Main entry points: [`STEP/midtbot_esp32_assy.stp`](https://github.com/bdring/midtbot_esp32/blob/master/STEP/midtbot_esp32_assy.stp) (Pen plotter), [`Docs/samples/midthead.gcode`](https://github.com/bdring/midtbot_esp32/blob/master/Docs/samples/midthead.gcode) (G-code input), [`README.md`](https://github.com/bdring/midtbot_esp32/blob/master/README.md) (H-bot belt drive), [`PCB/V2`](https://github.com/bdring/midtbot_esp32/tree/master/PCB/V2) (Controller PCB)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operation["Plotter operation"]
  node_gcode["G-code input<br/>[midthead.gcode]"]
  node_usb["USB"]
  node_bluetooth["Bluetooth"]
  node_wifi["Wi-Fi"]
  node_sd[("Onboard SD")]
end

subgraph group_electronics["Controller electronics"]
  node_firmware["Grbl_ESP32"]
  node_esp32["ESP32 controller"]
  node_pcb["Controller PCB"]
end

subgraph group_mechanics["Motion and pen"]
  node_steppers["Stepper motors"]
  node_hbot["H-bot belt drive<br/>[README.md]"]
  node_servo["Pen servo"]
  node_plotter["Pen plotter"]
end

subgraph group_design["Design resources"]
  node_printed_parts["Printed parts"]
  node_parts_list["Parts lists<br/>[BOM.md]"]
end

node_operator(("Operator"))

node_operator -->|"supplies"| node_gcode
node_operator -->|"controls via"| node_usb
node_operator -->|"controls via"| node_bluetooth
node_operator -->|"controls via"| node_wifi
node_operator -->|"uploads to"| node_sd
node_gcode -->|"provides commands"| node_firmware
node_usb -->|"carries commands"| node_firmware
node_bluetooth -->|"carries commands"| node_firmware
node_wifi -->|"carries commands"| node_firmware
node_sd -->|"provides files"| node_firmware
node_firmware -->|"runs on"| node_esp32
node_firmware -->|"drives"| node_steppers
node_firmware -->|"controls"| node_servo
node_steppers -->|"move belt"| node_hbot
node_hbot -->|"positions pen"| node_plotter
node_servo -->|"lifts pen"| node_plotter
node_printed_parts -.->|"form structure"| node_plotter
node_pcb -.->|"hosts controller"| node_esp32

click node_gcode "https://github.com/bdring/midtbot_esp32/blob/master/Docs/samples/midthead.gcode"
click node_pcb "https://github.com/bdring/midtbot_esp32/tree/master/PCB/V2"
click node_hbot "https://github.com/bdring/midtbot_esp32/blob/master/README.md"
click node_plotter "https://github.com/bdring/midtbot_esp32/blob/master/STEP/midtbot_esp32_assy.stp"
click node_printed_parts "https://github.com/bdring/midtbot_esp32/tree/master/STL"
click node_parts_list "https://github.com/bdring/midtbot_esp32/blob/master/PCB/BOM.md"

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_gcode,node_usb,node_bluetooth,node_wifi,node_sd toneBlue
class node_firmware,node_esp32,node_pcb toneAmber
class node_steppers,node_hbot,node_servo,node_plotter toneMint
class node_printed_parts,node_parts_list toneRose
class node_operator toneIndigo
```

## Components

### Plotter operation

- [G-code input](https://github.com/bdring/midtbot_esp32/blob/master/Docs/samples/midthead.gcode): `Docs/samples/midthead.gcode`
- **USB**
- **Bluetooth**
- **Wi-Fi**
- **Onboard SD**

### Controller electronics

- **Grbl_ESP32**
- **ESP32 controller**
- [Controller PCB](https://github.com/bdring/midtbot_esp32/tree/master/PCB/V2): `PCB/V2`

### Motion and pen

- **Stepper motors**
- [H-bot belt drive](https://github.com/bdring/midtbot_esp32/blob/master/README.md): `README.md`
- **Pen servo**
- [Pen plotter](https://github.com/bdring/midtbot_esp32/blob/master/STEP/midtbot_esp32_assy.stp): `STEP/midtbot_esp32_assy.stp`

### Design resources

- [Printed parts](https://github.com/bdring/midtbot_esp32/tree/master/STL): `STL`
- [Parts lists](https://github.com/bdring/midtbot_esp32/blob/master/PCB/BOM.md): `PCB/BOM.md`

### Other components

- **Operator**

## Connections

- Operator → G-code input: supplies
- Operator → USB: controls via
- Operator → Bluetooth: controls via
- Operator → Wi-Fi: controls via
- Operator → Onboard SD: uploads to
- G-code input → Grbl_ESP32: provides commands
- USB → Grbl_ESP32: carries commands
- Bluetooth → Grbl_ESP32: carries commands
- Wi-Fi → Grbl_ESP32: carries commands
- Onboard SD → Grbl_ESP32: provides files
- Grbl_ESP32 → ESP32 controller: runs on
- Grbl_ESP32 → Stepper motors: drives
- Grbl_ESP32 → Pen servo: controls
- Stepper motors → H-bot belt drive: move belt
- H-bot belt drive → Pen plotter: positions pen
- Pen servo → Pen plotter: lifts pen
- Printed parts → Pen plotter: form structure
- Controller PCB → ESP32 controller: hosts controller
