A Relay is an electrically operated Single Pole Double Throw (SPDT) switch. It uses a low-power electromagnet coil to mechanically open or close high-power AC or DC load contacts, providing complete electrical isolation between control electronics and high-voltage loads.
1. Hardware Specifications & Pinout
- Coil Voltage: 5V DC (rated). Applying more than 6V (120% of rated) damages the module — the simulator flags this as an OVERVOLTAGE fault.
- Switching Capacity: 10A @ 250VAC, 10A @ 125VAC, 10A @ 30VDC, 10A @ 28VDC (per the SRD-05VDC-SL-C markings silkscreened on the module).
- Isolation: Built-in optocoupler-style drive stage between the control side and the coil.
- Pin Configuration:
- Input Control Side:
- VCC: 5V Power.
- GND: Common Ground.
- IN: Digital control signal pin.
- High-Voltage Screw Terminals:
- COM (Common): Connected to main power source.
- NO (Normally Open): Disconnected from COM when coil is OFF; connects to COM when coil is ON.
- NC (Normally Closed): Connected to COM when coil is OFF; disconnects from COM when coil is ON.
- Input Control Side:
2. How it Works (Optocoupler & Trigger Direction)
- Active-LOW Polarity (Standard Relay Modules) — the default:
- Control pin LOW () coil energizes NO contact CLOSES (Relay ON).
- Control pin HIGH () coil de-energizes NO contact OPENS (Relay OFF).
- Active-HIGH Polarity: Control pin HIGH energizes the coil; LOW turns it off — the reverse of the default.
- This matches real hardware: most off-the-shelf 1/2/4-channel 5V relay modules are Active-LOW (their onboard driver stage pulls the coil's other end toward ground when the control pin is LOW), though Active-HIGH modules exist too.
3. Component Properties (Property Inspector)
- Trigger Polarity (
polarity): Which pin level energizes the coil — switches the simulated drive circuit's trigger direction to match.- Default:
LOW(Active LOW — matches most real modules, and the Blockly blocks' own default) - Options:
LOW(Active LOW),HIGH(Active HIGH)
- Default:
[!NOTE] Keep this Property Inspector setting consistent with whatever Polarity you pick on each Blockly block below (Section 4) — they're two independent settings (one drives the simulated circuit, the other drives the generated code), and they need to agree for the simulated behavior to match what your generated code will actually do on real hardware.

