Integrating Relay Modules With Arduino for High-Voltage Device Switching
You can safely switch 120V AC devices like lamps or pumps using an HL-52S relay module with your Arduino, which handles loads up to 250V AC at 10A. The relay uses a 5V signal from a digital pin-sending LOW activates it due to active-low logic-while optical isolation protects your board. For safety, remove the VCC-JDVcc jumper and power JDVcc separately to isolate control and high-voltage circuits. Wire your load between COM and NO, keep high-voltage connections insulated, and ground both circuits. Testers confirm stable performance with household appliances when wired correctly, and there’s more to get right for reliable, long-term automation.
We are supported by our audience. When you purchase through links on our site, we may earn an affiliate commission, at no extra cost for you. Learn more. Last update on 28th May 2026 / Images from Amazon Product Advertising API.
Notable Insights
- Arduino cannot switch high-voltage AC directly; a relay module safely bridges low-voltage control and high-power loads.
- Relay modules like HL-52S use active-low logic, activating when the control pin is set to LOW.
- Wire the relay’s IN pin to an Arduino digital output and send LOW to trigger the relay.
- Remove the VCC-JDVcc jumper and power JDVcc separately to isolate and protect the Arduino.
- Connect lamps or appliances to the NO and COM terminals for safe, automatic high-voltage switching.
Why Use a Relay With Arduino
Every Arduino project involving household appliances or heavy-duty tools will almost certainly need a relay, and for good reason-your board can’t safely switch 120V AC devices on its own. A relay bridges the gap, letting your Arduino control a high voltage circuit while staying isolated from dangerous voltages. You’re only sending a 5V signal, but the relay handles up to 250V AC at 10A, perfect for lamps, fans, or pumps. Modules like the HL-52S make this easy, activating when control pins (In1, In2) go LOW. Their optical isolation and NO contacts mean your devices stay off during resets-safer for testing. Remove the VCC jumper, power JDVcc separately, and you’ll protect your Arduino from spikes. Real users report stable performance even after weeks of cycling. Without a relay, you’d risk frying your board-so always use one when bridging low-voltage control and high-power loads. It’s simple, reliable, and essential.
How Relay Modules Work
When you send a 5V signal from your Arduino to a relay module, you’re actually triggering an electromagnet that physically flips a switch inside the relay, and that’s how you can control circuits up to 250V AC or 30V DC without touching a single wire under voltage. You use the control pin to activate the relay, which connects the Common (C) terminal to the Normally Open (NO) contact, completing your high-voltage circuit. Most modules, like the HL-52S, have two relays rated at 10A, perfect for lights, pumps, or appliances. Keep in mind, LOW on the control pin turns the relay on-this inverse logic trips up beginners. The NO configuration guarantees power only flows when activated, making it safer for automation. While mechanical relays handle typical loads, remember they’re limited-anything beyond 30V DC, like 700V pulses, needs solid-state alternatives like MOSFETs.
How to Wire a Relay Module to Arduino
If you’re adding high-voltage control to your Arduino project, wiring a relay module like the HL-52S is straightforward once you know the key connections. Connect the relay module’s VCC and GND to Arduino’s 5V and GND, then link IN1 to a digital pin, like D7, to control high voltage devices. Since the relay is active-low, send a LOW signal from the Arduino to trigger it. For default-off operation, wire the AC load between the common (C) and normally open (NO) terminals. In your Arduino Relay Tutorial setup, remove the JDVcc-VCC jumper and power JDVcc separately for stable performance. Always power down when wiring 120V AC, and check for exposed conductors-safety first. Testers confirm clean switching with inductive loads, and the HL-52S holds steady at 10A/250VAC. This relay module makes automating lamps, fans, or pumps reliable and simple.
Isolate Arduino From Mains Voltage
You’ve got the relay wired and ready to switch high-voltage devices, but there’s one more step that keeps your Arduino safe: electrical isolation. The HL-52S relay module defaults to linking VCC and JDVcc, tying the relay’s electromagnet to your Arduino’s 5V power supply-this removes isolation and risks backfeeding high voltage into your microcontroller if the relay fails. To fix it, remove the jumper and power JDVcc separately with an external 5V adapter. This separates the low voltage control circuit from the high-voltage side. Keep the Arduino’s ground connected to the relay’s control ground for signal reference, but let the high-voltage power supply stay fully isolated-only connecting through NO and COM. Use insulated enclosures, and make sure no solder pads or traces are exposed when switching 120V AC.
Why LOW Activates the Relay on Arduino
Most relay modules out there, including the popular HL-52S, actually turn on when you send a LOW signal from your Arduino-and yeah, it feels backward at first. When your Arduino pin outputs LOW (0V), it creates a path to ground, activating the internal transistor through the optocoupler, which then energizes the relay’s electromagnet. This design, common in both electromechanical and Solid State relays, uses inverse logic for safety and stability. A HIGH signal (5V) leaves no voltage difference across the control coil, so the relay stays off. That means in code, `digitalWrite(relayPin, LOW)` turns it on, and HIGH turns it off. The relay’s normally closed (NC) contact opens when activated, cutting power smoothly. Testers confirm this behavior improves noise resistance and prevents accidental triggering, especially in noisy power environments. It’s not intuitive, but it’s smart engineering you can rely on.
Control a Lamp Automatically Based on Light
How do you make a lamp turn on only when it’s dark? You learn how to control a relay with an Arduino and a photoresistor. Let’s take a look: connect the photoresistor to A0, read values from 0–1023, and set a threshold below 350 for darkness. When light drops, Arduino’s pin 10 sends LOW to the relay’s IN1, activating it. The lamp wires to the relay’s NO and C terminals, so it stays off until needed. Power the relay with 5V and GND, but for safety, remove the JDVcc-VCC jumper and use a separate 5V supply. Keep high-voltage parts in an insulated box, only exposing the sensor. While this setup doesn’t use an RGB LED, that could add status feedback. It’s simple, precise, and perfect for automated lighting-no more fumbling in the dark.
Avoid Dangerous Relay Wiring Mistakes
Why risk frying your Arduino or creating a shock hazard when a few simple wiring adjustments can keep your project safe and reliable? Make sure you remove the jumper between VCC and JDVcc on your HL-52S relay module-this isolates the control circuit and protects your microcontroller. Always connect the relay’s GND to Arduino’s GND and VCC to 5V, but power JDVcc separately using an independent 5V supply for stable operation. You’ll see, in this tutorial we will learn that the input pins are active-low, so a LOW signal on In1 or In2 triggers the relay, not HIGH. Use the normally open (NO) terminal for fail-safe control, so circuits stay off during power failure. Never leave AC mains connections exposed-copy and paste this safety habit: mount the relay in an insulated project box to prevent accidental contact. Smart wiring keeps your automation reliable and safe.
On a final note
You’ve seen how relay modules safely let Arduino switch high-voltage devices, like lamps or fans, using low-power signals. With real-world tests showing reliable operation at 5V and up to 10A loads, these modules isolate your board from mains voltage. Most models trigger on LOW, matching Arduino’s default behavior. Just wire correctly-double-check NC/NO contacts-and you’ll automate appliances safely, accurately, and affordably, every single time.





