@startuml

title ESP-RGB-LED Matrix

component "Ext. Power Supply" as extPowerSupply

interface "Vcc" as iVcc

package "Housing" {

    package "PCB" as pcb {

        package "Power Supply Protection" {

            component "Overcurrent protection" as ocp
            component "Inverse connection protection" as icp
            component "Overvoltage protection" as ovp
        }
        
        package "ESP32 DevKitV1 connector" {
        
            component "ESP32 DevKitV1" as esp32
        }

        interface "JTAG" as iJtag

        esp32 -u- iJtag
    }
    
    component "LED matrix" as ledMatrix
    component "User Button" as userButton
    component "Reset Button" as resetButton
    component "Ambilight sensor" as ambilightSensor
    component "DHT11 sensor" as dht11Sensor
    
}

extPowerSupply --( iVcc
iVcc -- ocp
ocp -- icp
icp -- ovp
ovp -r- esp32: Vcc_protected
ovp -- ledMatrix: Vcc_protected

esp32 -- ledMatrix: data
esp32 -- userButton: input
esp32 -- resetButton: reset
esp32 -- ambilightSensor: control brightness
esp32 -- dht11Sensor: read temperature\nand humidity

@enduml