> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atopile.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Relay

## Parameters

<ParamField path="coil_max_current" type="ampere" />

<ParamField path="coil_max_voltage" type="volt" />

<ParamField path="coil_resistance" type="ohm" />

<ParamField path="contact_max_current" type="ampere" />

<ParamField path="contact_max_switching_current" type="ampere" />

<ParamField path="contact_max_switching_voltage" type="volt" />

## Interfaces

<ParamField path="coil_power" type="ElectricPower" />

<ParamField path="switch_a_common" type="Electrical" />

<ParamField path="switch_a_nc" type="Electrical" />

<ParamField path="switch_a_no" type="Electrical" />

<ParamField path="switch_b_common" type="Electrical" />

<ParamField path="switch_b_nc" type="Electrical" />

<ParamField path="switch_b_no" type="Electrical" />

## Global Attributes

These attributes are available to all modules and interfaces in a design.

<ParamField path="lcsc_id" type="str">
  Assign the LCSC ID of the module.

  If set, this will tell the picker to select that part from LCSC for this block.
</ParamField>

<ParamField path="manufacturer" type="str">
  This module's manufacturer name, as a string.

  Only exact matches on the manufacturer's name will be found by the picker.
  It's recommended to fill this information based on what `ato create component`
  provides.
</ParamField>

<ParamField path="mpn" type="str">
  This module's manufacturer part number, as a string.

  For the picker to select the correct part from the manufacturer,
  this must be set.
</ParamField>

<ParamField path="package" type="str">
  The package of the module.

  This drives which components can be selected, and what footprint is used.

  Must exactly match a known package name.
</ParamField>

<ParamField path="exclude_from_bom" type="bool" />

<ParamField path="override_net_name" type="str">
  When set on an interface, this will override the net name of the interface.

  This is useful for renaming nets which are automatically generated.
</ParamField>

<ParamField path="required" type="bool">
  Only for ModuleInterfaces.
  If set to `True`, require that interface is connected to something outside
  of the module it's defined in.
</ParamField>

<RequestExample>
  ```ato Basic Usage theme={null}
  import Relay, ElectricPower, Diode, NFET, ElectricLogic

  relay = new Relay
  relay.coil_max_voltage = 12V
  relay.coil_max_current = 50mA
  relay.coil_resistance = 240ohm +/- 10%
  relay.contact_max_switching_voltage = 250V
  relay.contact_max_switching_current = 10A
  relay.contact_max_current = 16A

  # Connect coil power
  power_12v = new ElectricPower
  assert power_12v.voltage within 12V +/- 5%
  relay.coil_power ~ power_12v

  # Control relay with MOSFET and flyback diode
  control_mosfet = new NFET
  flyback_diode = new Diode
  control_signal = new ElectricLogic

  # Coil control circuit
  power_12v.hv ~ relay.coil_power.hv
  relay.coil_power.lv ~> control_mosfet ~> power_12v.lv
  control_signal ~ control_mosfet.gate

  # Flyback diode for coil protection
  relay.coil_power.hv ~ flyback_diode.cathode
  flyback_diode.anode ~ relay.coil_power.lv

  # Switch high-power load using normally open contact
  high_power_load ~ relay.switch_a_no
  relay.switch_a_common ~ high_voltage_supply
  ```
</RequestExample>
