The 4-channel relay module is the single most important component in home automation projects. It is the bridge that allows your 5V Arduino or ESP32 to safely control 230V AC appliances like lights, fans, geysers, and pumps. Yet, despite being one of the most commonly purchased electronics modules in India, it is also one of the most misunderstood. This comprehensive guide covers everything about 4-channel relay modules — from understanding the specifications to safe 230V wiring practices for Indian homes.
- What Is a Relay Module and Why Do You Need One?
- Understanding Relay Module Specifications
- Active LOW vs Active HIGH Explained
- Safe 230V AC Wiring in India
- Arduino Wiring and Basic Code
- 5 Practical Projects with 4-Channel Relay
- Common Problems and Troubleshooting
- Frequently Asked Questions
- Conclusion
What Is a Relay Module and Why Do You Need One?
A relay is an electromagnetic switch. Inside the relay, a small coil creates a magnetic field when energised, which pulls a metal contact to close (or open) a circuit. The relay module packages this relay with supporting circuitry (transistor driver, optocoupler, indicator LED, flyback diode) on a convenient PCB with screw terminals.
You need a relay module because:
- Arduino GPIO pins output only 5V at 40mA — nowhere near enough to switch a 230V, 5A load
- Direct connection between 230V AC and your microcontroller would be immediately destructive
- The relay provides galvanic isolation — complete electrical separation between the control circuit and the power circuit
Understanding Relay Module Specifications
When buying a relay module, pay attention to these specifications:
| Specification | Typical Value | What It Means |
|---|---|---|
| Coil voltage | 5V DC | Matches Arduino/ESP32 output |
| Contact rating | 10A 250V AC | Max load the relay can switch |
| Trigger level | Active LOW | LOW signal turns relay ON |
| Optocoupler | Yes / No | Additional isolation between control and relay coil |
| Coil current | ~70mA per channel | Power drawn from supply when active |
For Indian homes (230V AC): A 10A relay can safely handle loads up to 2,300 watts (230V × 10A). This covers most household appliances — lights, fans, TVs, and small water heaters. For heavy loads like 3kW geysers or 1 HP pumps, use 30A-rated relay modules.
Active LOW vs Active HIGH Explained
This is the most confusing aspect for beginners, so let us clarify:
Active LOW (Most Common in India)
digitalWrite(pin, LOW)→ Relay turns ON (LED lights up, you hear a click)digitalWrite(pin, HIGH)→ Relay turns OFF- On boot, Arduino pins are HIGH by default, so relays stay OFF — this is a safety feature
Active HIGH
digitalWrite(pin, HIGH)→ Relay turns ONdigitalWrite(pin, LOW)→ Relay turns OFF- Less common, mainly found in modules that support configurable trigger level
How to check: Apply 5V to VCC, GND to GND, and touch the IN1 pin to GND with a jumper wire. If the relay clicks ON, it is active LOW. If it stays off, try touching IN1 to VCC — if it clicks, it is active HIGH.
Safe 230V AC Wiring in India
- Always disconnect the mains MCB before touching any AC wiring
- Only switch the LIVE wire through the relay — never the neutral
- Use proper crimped ferrules or soldered connections, not bare wire twists
- Enclose all 230V connections in a proper electrical enclosure
- If unsure, hire a qualified electrician for the AC side
Per-Channel AC Wiring
For each relay channel:
Mains LIVE (Phase) wire → Relay COM terminal
Relay NO terminal → Appliance LIVE terminal
Mains NEUTRAL → Appliance NEUTRAL terminal (direct, not through relay)
Earth → Appliance Earth terminal (direct)
Each relay has three output terminals:
- COM (Common): Input from mains live wire
- NO (Normally Open): Output to appliance. Circuit is open (appliance OFF) when relay is inactive. Closes when relay is activated.
- NC (Normally Closed): Circuit is closed when relay is inactive. Use this for fail-safe applications where the appliance should be ON by default.
Arduino Wiring and Basic Code
Low-Voltage Connections
Relay VCC → Arduino 5V (or external 5V supply for 4+ channels)
Relay GND → Arduino GND
Relay IN1 → Arduino Pin 2
Relay IN2 → Arduino Pin 3
Relay IN3 → Arduino Pin 4
Relay IN4 → Arduino Pin 5
Power consideration: Each relay coil draws ~70mA. Four relays draw ~280mA simultaneously. The Arduino Uno’s 5V pin can supply up to 500mA (when USB powered), so 4 relays are fine. For 8-channel modules, use a separate 5V, 2A power supply.
Basic Test Code
// Test each relay channel in sequence
#define RELAY1 2
#define RELAY2 3
#define RELAY3 4
#define RELAY4 5
void setup() {
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
// All OFF (active LOW, so HIGH = OFF)
digitalWrite(RELAY1, HIGH);
digitalWrite(RELAY2, HIGH);
digitalWrite(RELAY3, HIGH);
digitalWrite(RELAY4, HIGH);
}
void loop() {
// Turn each relay ON for 2 seconds, then OFF
for (int pin = RELAY1; pin <= RELAY4; pin++) {
digitalWrite(pin, LOW); // ON
delay(2000);
digitalWrite(pin, HIGH); // OFF
delay(500);
}
delay(3000); // Pause before repeating
}
5 Practical Projects with 4-Channel Relay
1. Room Automation Controller
Control a room’s light, fan, and two extra outlets from Bluetooth or WiFi. This is the classic home automation project.
2. Aquarium Controller
Channel 1: Light (timer-based), Channel 2: Air pump, Channel 3: Heater (thermostat), Channel 4: Filter pump.
3. Server Room Cooling
Use temperature sensors to automatically switch exhaust fans and AC units based on room temperature.
4. Holiday Lighting Timer
Create realistic “someone is home” patterns by switching 4 lights in different rooms at randomised intervals using an RTC module.
5. Garage Door + Security
Channel 1: Garage door motor, Channel 2: Garage light, Channel 3: Alarm siren, Channel 4: Security camera power.
Common Problems and Troubleshooting
Relay clicks but appliance does not turn on
- Check if you are using NO (Normally Open) terminal — this is the one that connects when the relay activates
- Verify the AC wiring with a multimeter (with mains OFF first, then check continuity)
- Ensure the mains MCB is ON and the circuit has power
Relay does not click at all
- Check VCC and GND connections to the relay module
- Verify the trigger level — try both HIGH and LOW on the IN pin
- The relay coil may need more current than the Arduino pin can provide. Use an external 5V supply for the relay VCC
Arduino resets when relay switches
- The relay’s electromagnetic field or back-EMF is interfering with the Arduino
- Solution: Power the relay module from a separate 5V supply (connect GNDs together but separate the VCC lines)
- Add a 100µF capacitor across the Arduino’s VCC and GND
Relay turns on at startup
- Arduino pins are in a floating state during boot before
setup()runs - Active LOW relays may trigger during this period
- Solution: Add 10kΩ pull-up resistors from each relay input pin to VCC
Frequently Asked Questions
Can I use a 4-channel relay module with ESP32?
Yes. ESP32 GPIO pins output 3.3V, which is sufficient to trigger most 5V relay modules through the optocoupler. Power the relay module’s VCC from a 5V source (not from the ESP32’s 3.3V pin).
What is the lifespan of a relay?
Most relays are rated for 100,000 mechanical operations. If you switch 10 times per day, that is over 27 years. The electrical rating is typically 50,000 operations at full load.
Can I control a 3-phase motor with a 4-channel relay?
You can switch each phase with a separate relay channel, but for motor starting current (which can be 5–7 times the running current), use a proper motor contactor instead of a relay module.
Should I use SSR (Solid State Relay) instead?
SSRs are better for frequent switching (thousands of cycles per day) and silent operation. For typical home automation (a few switches per day), mechanical relays are more cost-effective and simpler to use.
Conclusion
The 4-channel relay module is the workhorse of home automation. Understanding how it works, how to wire it safely, and how to avoid common pitfalls will serve you well across dozens of projects. Whether you are building a basic room automation system or a complex multi-zone irrigation controller, the relay module is your essential building block.
Shop relay modules at Zbotic.in — from single-channel to 16-channel, standard to 30A heavy-duty, we have every relay module you need. Browse our full range of electronic components for your next project.
Add comment