{
  "metadata": {
    "id": "l298n-motor-driver",
    "name": "L298N Dual H-Bridge Motor Driver Module",
    "type": "motor_driver",
    "description": "Dual-channel H-bridge motor driver module based on the L298N IC. Capable of driving two DC motors (or one stepper motor) with up to ~2 A per channel and motor supply voltages from ~5 V up to ~35 V (board-dependent). Includes an onboard 5 V regulator (activated via jumper) that can power the logic circuitry and, within limits, an external controller. Provides directional control and speed (PWM) control for motors, with built-in clamp diodes and a heat sink for handling power dissipation. Widely used in robotics and motor control projects.",
    "manufacturer": "STMicroelectronics",
    "part_number": "L298N",
    "datasheet_url": "https://components101.com/sites/default/files/component_datasheet/L298N-Motor-Driver-Datasheet.pdf",
    "tags": [
      "motor",
      "driver",
      "H-bridge",
      "L298N",
      "DC motor",
      "stepper motor",
      "dual motor driver",
      "robotics"
    ],
    "schema_version": "1.4.0",
    "version": "0.3.0",
    "has_enable_jumpers": true,
    "taxonomy": [
      "actuator.motor_controller"
    ]
  },
  "domains": [
    {
      "domain": "electrical",
      "power_domains": [
        {
          "id": "vmotor",
          "name": "Motor Supply (Vs)",
          "nominal_voltage_V": 12,
          "voltage_range_V": [
            5,
            35
          ],
          "max_current_mA": 4000,
          "isolation_type": "non_isolated",
          "ground_reference": "common",
          "description": "Motor power supply domain for L298N module (board-dependent range, typically 5–35 V; up to ~2 A per channel)."
        },
        {
          "id": "logic5v",
          "name": "Logic 5V (Vss)",
          "nominal_voltage_V": 5,
          "voltage_range_V": [
            4.5,
            5.5
          ],
          "max_current_mA": 36,
          "isolation_type": "non_isolated",
          "ground_reference": "common",
          "description": "5 V logic supply domain for L298N inputs (TTL level inputs, ~36 mA consumption)."
        }
      ],
      "resources": [
        {
          "id": "vs_in",
          "functions": [
            {
              "name": "power_input",
              "direction": "sink",
              "signal_class": "power"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "vmotor",
          "description": "Motor supply input (Vs/Vcc2) for external power (e.g., battery or DC supply 4.5–36 V)"
        },
        {
          "id": "vss_5v",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            },
            {
              "name": "power_input",
              "direction": "sink",
              "signal_class": "power"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "logic5v",
          "description": "5 V logic pin. Acts as a regulated 5 V output when the onboard regulator jumper is installed and Vs is modest (typically ≤12 V); otherwise use as a 5 V logic input (jumper removed)."
        },
        {
          "id": "gnd",
          "functions": [
            {
              "name": "ground",
              "direction": "bidirectional",
              "signal_class": "ground"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "vmotor",
          "description": "Ground connection (common ground for motor and logic)"
        },
        {
          "id": "in1",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "logic5v",
          "description": "IN1 - Logic input for Motor A (controls OUT1, one direction)"
        },
        {
          "id": "in2",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "logic5v",
          "description": "IN2 - Logic input for Motor A (controls OUT2, opposite direction)"
        },
        {
          "id": "in3",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "logic5v",
          "description": "IN3 - Logic input for Motor B (controls OUT3, one direction)"
        },
        {
          "id": "in4",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "logic5v",
          "description": "IN4 - Logic input for Motor B (controls OUT4, opposite direction)"
        },
        {
          "id": "ena",
          "functions": [
            {
              "name": "pwm_input",
              "description": "Enable/PWM input for Motor A",
              "direction": "sink",
              "signal_class": "data"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "logic5v",
          "description": "ENA - Enable/PWM input for Motor A (jumper-able HIGH on many modules)"
        },
        {
          "id": "enb",
          "functions": [
            {
              "name": "pwm_input",
              "description": "Enable/PWM input for Motor B",
              "direction": "sink",
              "signal_class": "data"
            }
          ],
          "connector_type": "pin_header",
          "power_domain_id": "logic5v",
          "description": "ENB - Enable/PWM input for Motor B (jumper-able HIGH on many modules)"
        },
        {
          "id": "out1",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "vmotor",
          "current_rating": {
            "source": {
              "max_continuous_mA": 2000
            }
          },
          "description": "Motor A Output 1 (connect one terminal of Motor A here)"
        },
        {
          "id": "out2",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "vmotor",
          "current_rating": {
            "source": {
              "max_continuous_mA": 2000
            }
          },
          "description": "Motor A Output 2 (connect the other terminal of Motor A here)"
        },
        {
          "id": "out3",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "vmotor",
          "current_rating": {
            "source": {
              "max_continuous_mA": 2000
            }
          },
          "description": "Motor B Output 1 (connect one terminal of Motor B here)"
        },
        {
          "id": "out4",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ],
          "connector_type": "screw_terminal",
          "power_domain_id": "vmotor",
          "current_rating": {
            "source": {
              "max_continuous_mA": 2000
            }
          },
          "description": "Motor B Output 2 (connect the other terminal of Motor B here)"
        }
      ],
      "interfaces": [
        {
          "id": "motor_power_in",
          "protocol": {
            "type": "power",
            "role": "input"
          },
          "requires": [
            {
              "function": "power_input",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "max_instances": 1,
          "description": "Motor power supply input interface (connect Vs/Vcc2 and GND)",
          "name": "Power Input"
        },
        {
          "id": "logic_5v_in",
          "protocol": {
            "type": "power",
            "role": "input"
          },
          "requires": [
            {
              "function": "power_input",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "constraints": {
            "max_connections": 1,
            "requires_matching_voltage_domain": false
          },
          "description": "5 V logic input interface (Vss). Used when the onboard regulator jumper is removed or Vs is high.",
          "name": "Power Input"
        },
        {
          "id": "logic_5v_out",
          "protocol": {
            "type": "power",
            "role": "output"
          },
          "requires": [
            {
              "function": "power_output",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "constraints": {
            "max_connections": 1,
            "requires_matching_voltage_domain": false
          },
          "power_delivery": {
            "max_voltage_V": 5,
            "max_current_mA": 100,
            "regulation_tolerance_percent": 5,
            "ripple_voltage_mV": 100
          },
          "description": "5 V regulated power output interface (jumper enabled, Vs typically ≤12 V). Can power a microcontroller lightly (≈100 mA max).",
          "name": "Power Output"
        },
        {
          "id": "motor_channel_a_control",
          "protocol": {
            "type": "digital",
            "role": [
              "input"
            ]
          },
          "requires": [
            {
              "function": "digital_input",
              "count": 2
            },
            {
              "function": "pwm_input",
              "count": 1,
              "shareable_with": [
                "digital_input"
              ]
            }
          ],
          "description": "Control for Motor A: IN1/IN2 for direction, ENA for PWM/enable.",
          "name": "Digital"
        },
        {
          "id": "motor_channel_b_control",
          "protocol": {
            "type": "digital",
            "role": [
              "input"
            ]
          },
          "requires": [
            {
              "function": "digital_input",
              "count": 2
            },
            {
              "function": "pwm_input",
              "count": 1,
              "shareable_with": [
                "digital_input"
              ]
            }
          ],
          "description": "Control for Motor B: IN3/IN4 for direction, ENB for PWM/enable.",
          "name": "Digital"
        },
        {
          "id": "dc_motor_output",
          "protocol": {
            "type": "power",
            "role": "output"
          },
          "requires": [
            {
              "function": "power_output",
              "count": 2
            }
          ],
          "constraints": {
            "max_connections": 2,
            "requires_matching_voltage_domain": true
          },
          "description": "DC motor connection interface (each motor uses a pair: OUT1+OUT2 or OUT3+OUT4, ~600 mA/channel continuous).",
          "name": "Power Output"
        }
      ],
      "supply_voltage_V": [
        5,
        35
      ],
      "power_consumption_mW": 180,
      "pin_count": 15
    },
    {
      "domain": "mechanical",
      "resources": [
        {
          "id": "mount1",
          "functions": [
            {
              "name": "mounting_hole",
              "direction": "bidirectional",
              "signal_class": "mechanical_drive"
            }
          ],
          "connector_type": "through_hole",
          "hole_diameter_mm": 3,
          "thread_spec": "M3 / #4",
          "max_force_N": 100,
          "description": "Corner mounting hole"
        },
        {
          "id": "mount2",
          "functions": [
            {
              "name": "mounting_hole",
              "direction": "bidirectional",
              "signal_class": "mechanical_drive"
            }
          ],
          "connector_type": "through_hole",
          "hole_diameter_mm": 3,
          "thread_spec": "M3 / #4",
          "max_force_N": 100,
          "description": "Corner mounting hole"
        },
        {
          "id": "mount3",
          "functions": [
            {
              "name": "mounting_hole",
              "direction": "bidirectional",
              "signal_class": "mechanical_drive"
            }
          ],
          "connector_type": "through_hole",
          "hole_diameter_mm": 3,
          "thread_spec": "M3 / #4",
          "max_force_N": 100,
          "description": "Corner mounting hole"
        },
        {
          "id": "mount4",
          "functions": [
            {
              "name": "mounting_hole",
              "direction": "bidirectional",
              "signal_class": "mechanical_drive"
            }
          ],
          "connector_type": "through_hole",
          "hole_diameter_mm": 3,
          "thread_spec": "M3 / #4",
          "max_force_N": 100,
          "description": "Corner mounting hole"
        }
      ],
      "interfaces": [
        {
          "id": "module_mounting",
          "protocol": {
            "type": "threaded_connection",
            "role": "mounting_point"
          },
          "requires": [
            {
              "function": "mounting_hole",
              "count": 4
            }
          ],
          "description": "PCB module mounting interface (four M3/#4 screws at corners)",
          "name": "PCB Mounting"
        }
      ],
      "package_type": "PCB Module",
      "dimensions_mm": {
        "length": 43,
        "width": 43,
        "height": 27
      },
      "weight_g": 26
    },
    {
      "domain": "thermal",
      "resources": [],
      "interfaces": [],
      "operating_temperature_C": [
        -20,
        85
      ],
      "metadata": {
        "thermal_design_power_W": 5,
        "requires_thermal_management": true,
        "thermal_monitoring_available": false,
        "cooling_method": "passive"
      }
    }
  ],
  "design_rules": [
    "If motor supply voltage exceeds ~12 V, remove the onboard regulator jumper and supply 5 V to the logic input pin externally to avoid overheating the regulator.",
    "Do not draw more than ~100 mA from the module's 5 V output; excessive current can overheat the 78M05 regulator.",
    "Provide adequate heat sinking/airflow if running motors near 2 A continuously. The L298N dissipates significant heat (Darlington drop ~2 V+).",
    "Always connect grounds: the motor power source ground, control logic ground, and module ground must be common.",
    "For each motor, use the designated pair of outputs: connect one motor to OUT1 & OUT2 (Motor A) and the other motor to OUT3 & OUT4 (Motor B).",
    "Use ENA and ENB for PWM speed control: you can tie them HIGH for full speed or feed a PWM signal for variable speed. Ensure they are enabled (HIGH) for the motor to run.",
    "Logic input HIGH threshold is ~2.3 V, so 3.3 V control signals are typically acceptable, but the logic supply should still be 5 V."
  ],
  "validation_requirements": [
    "Verify motor supply (Vs) is within 5–35 V range and correctly connected to the Vs input terminal.",
    "If the 5 V regulator jumper is used, ensure motor supply does not exceed ~12 V. If motor supply is above 12 V, ensure jumper is removed and a stable 5 V is provided to the logic input pin.",
    "Confirm that all grounds (module, power source, microcontroller) are connected together (common ground).",
    "Validate that motor stall currents do not exceed ~2 A per channel (and consider using fuses or current limiting if motors can draw more).",
    "Check that each control input (IN1–IN4, ENA, ENB) from the microcontroller is properly assigned and within 0–5 V logic levels, and that at least one of ENA/ENB is enabled if you expect the motor to run.",
    "Ensure that no two outputs are shorted directly together or to supply/ground (other than through a motor); the motor should be the only load between each output pair."
  ],
  "usage_notes": "This L298N motor driver module allows you to control two DC motors (or one stepper motor). Set IN1/IN2 (Motor A) and IN3/IN4 (Motor B) for direction; provide PWM on ENA/ENB for speed. The module includes enable jumpers that tie ENA/ENB HIGH by default: with jumpers installed, each channel is enabled (full-speed if IN pins demand it); remove a jumper to drive that EN pin from a PWM-capable MCU output. If the onboard 5 V regulator jumper is fitted and Vs is modest (typically ≤12 V), the 5 V pin can supply light external loads (~100 mA). For Vs above ~12 V or higher 5 V loads, remove the jumper and supply a regulated 5 V to the Vss pin. Expect ~2 V or more drop across the bipolar outputs under load, so size Vs accordingly.",
  "application_examples": [
    "Arduino-based 2WD robot car (driving two DC gear motors for left/right wheels)",
    "Controlling a small bipolar stepper motor (using both H-bridges together)",
    "DIY RC tank or rover (two motor channels for track drive)",
    "Automating a curtain or conveyor using DC motors with forward/reverse control",
    "Educational projects and prototyping where a simple motor driver is needed for DC motors or solenoids"
  ],
  "compatibility_notes": "The L298N module works with any microcontroller that can provide 5 V logic signals (TTL). It is directly compatible with Arduino Uno and other 5 V logic boards. It can also be controlled by 3.3 V logic (e.g., Raspberry Pi, ESP32) because 3.3 V is typically recognized as HIGH by the L298N (~2.3 V threshold), but you still need to provide a 5 V supply to the module's logic. Note this driver is less efficient than modern MOSFET drivers (TB6612FNG, DRV8833).",
  "warnings": [
    "The onboard regulator can overheat if you draw too much current from the 5 V pin or if Vs is high; use it only for light loads or provide an external 5 V.",
    "During operation, the L298N chip and heat sink can become very hot. Avoid touching the heat sink and provide ventilation if possible.",
    "A significant voltage drop (~2 V or more) occurs across the driver at high currents due to bipolar transistor outputs.",
    "Using both channels (e.g., for a stepper) increases dissipation; monitor temperature under load.",
    "Double-check wiring: ensure Vs is not connected to the 5 V logic pin and that grounds are common."
  ]
}