4 Channel Relay Module Library For Proteus New __link__ -

Connect the module’s VCC pin to the Arduino's 5V pin, and the GND pin to the Arduino's GND pin.

// Define control pins for the 4-channel relay module const int relayPins[4] = 2, 3, 4, 5; void setup() // Initialize all four pins as outputs for(int i = 0; i < 4; i++) pinMode(relayPins[i], OUTPUT); digitalWrite(relayPins[i], HIGH); // Keep relays OFF initially (Active-Low configuration) void loop() // Cycle through each relay channel sequentially for(int i = 0; i < 4; i++) digitalWrite(relayPins[i], LOW); // Turn relay ON delay(1000); // Wait 1 second digitalWrite(relayPins[i], HIGH); // Turn relay OFF delay(1000); // Wait 1 second Use code with caution. Troubleshooting Common Simulation Errors 4 channel relay module library for proteus new