Close Menu
Circuit of Things
  • Home
  • About Us
  • Contact Us
  • 3D Print
  • Shop Now !
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • KSP Tools

Get Free Tutorials & Discounts!

Subscribe for the latest IoT tutorials and exclusive KSP Electronics discount codes.

Instagram WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
  • Contact Us
Circuit of Things Circuit of Things
  • Home
  • About Us
  • Contact Us
  • 3D Print
  • Shop Now !
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • KSP Tools
Hire us
Circuit of Things
Home»Arduino Projects»Relay Module with Arduino: Control High Voltage Appliances Safely
Arduino Projects

Relay Module with Arduino: Control High Voltage Appliances Safely

Sai Preetham KoyyalaBy Sai Preetham KoyyalaMay 4, 2026Updated:May 7, 2026No Comments2 Mins Read
Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
Share
Facebook Twitter LinkedIn Pinterest Email
Contents
  • Introduction
  • Important Safety Warning
  • Components Needed
  • Wiring the Relay
  • Project 1: Basic Relay Control
  • Project 2: Timer-Controlled Fan
  • Understanding Active LOW vs Active HIGH
  • Conclusion

Introduction

A relay module is the bridge between your Arduino’s low-voltage world (5V) and high-voltage appliances (230V AC). It uses an electromagnet to physically switch high-power circuits on and off under microcontroller control — allowing you to turn on/off bulbs, fans, water pumps, and heaters with just a GPIO pin.

Important Safety Warning

Warning: Working with 230V AC mains electricity is dangerous and potentially lethal. Ensure you are using a proper enclosure and following electrical safety guidelines. If you are not confident, ask a qualified electrician for help.

Components Needed

  • Arduino Uno
  • 5V Relay Module (1-channel or 4-channel)
  • An appliance to control (lamp recommended for testing)

Wiring the Relay

Relay Module Pin Arduino
VCC 5V
GND GND
IN Digital Pin 7

Project 1: Basic Relay Control

#define RELAY_PIN 7
void setup() {
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, HIGH); // Most relay modules are active LOW - HIGH = OFF
}
void loop() {
  digitalWrite(RELAY_PIN, LOW);  // Relay ON (appliance ON)
  delay(5000);
  digitalWrite(RELAY_PIN, HIGH); // Relay OFF (appliance OFF)
  delay(5000);
}

Project 2: Timer-Controlled Fan

#define RELAY_PIN 7
void setup() {
  Serial.begin(9600);
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, HIGH); // Start OFF
}
void loop() {
  Serial.println("Fan ON for 10 seconds...");
  digitalWrite(RELAY_PIN, LOW); delay(10000);
  Serial.println("Fan OFF for 5 seconds...");
  digitalWrite(RELAY_PIN, HIGH); delay(5000);
}

Understanding Active LOW vs Active HIGH

Most relay modules are Active LOW — sending a LOW signal triggers the relay (connects COM to NO). Always check your module’s datasheet. Writing HIGH to IN means OFF, and LOW means ON.

Conclusion

The relay module is one of the most powerful tools in the maker toolkit. Combined with ESP32 Wi-Fi and MQTT, you can build a full smart home automation system that controls real appliances from your phone!

Related Tutorials

  • Arduino Servo Motor Control: Sweep, Potentiometer and Button Projects
  • How to Build a DIY Robotic Hand using Flex Sensors and Arduino
  • Powerful Arduino Bluetooth Home Automation (HC-05 & KSP App Guide)
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleNodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform
Next Article How to Power Your Arduino & ESP32 Projects Properly
Sai Preetham Koyyala
  • Website
  • Facebook
  • X (Twitter)
  • Instagram
  • LinkedIn

Hello, I am Sai Preetham Koyyala. I'm an electronics engineer by profession, a DIY enthusiast by passion. ESP32 and Arduino are the main topics of my work.

Related Posts

IoT Tutorials

How to Build a DIY Robotic Hand using Flex Sensors and Arduino

May 6, 2026
IoT Tutorials

How to Build a DIY Robotic Hand using Flex Sensors and Arduino

May 6, 2026
IoT Basics

How to Power Your Arduino & ESP32 Projects Properly

May 6, 2026
Add A Comment
Leave A Reply Cancel Reply


⚡

Circuit of Things

Free IoT tutorials & electronics projects — powered by KSP Electronics.

📸 Instagram 💬 Community
✓ Official Partner Store

Everything for Your
Next IoT Build

Boards, sensors, modules & kits — fast delivery across India.

ESP32 Arduino Sensors Raspberry Pi 3D Print
🛒 Shop KSP Electronics →
Top Posts

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Step-by-Step Guide: Interface DHT11 and DHT22 Sensors with ESP32

May 6, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Available for Projects

Hire Us for IoT Development

End-to-end solutions for your needs:

  • → ESP32 & Embedded Systems
  • → LoRaWAN & Cloud Dashboards
  • → Custom Hardware Design
  • → IoT Product Prototyping
View Services →

Get Free Tutorials & Discounts!

Subscribe to get the latest IoT tutorials and exclusive hardware discount codes for KSP Electronics delivered directly to your inbox.

Follow Us
  • Instagram
  • Telegram
About Circuit of Things

We are a community-driven engineering platform dedicated to IoT, Robotics, and DIY electronics tutorials.

Proudly partnered with KSP Electronics.

Quick Links
  • Home
  • ESP32 Projects
  • Arduino Projects
  • IoT Tutorials
  • Sensors & Modules
  • Shop on KSP Electronics
  • Electro Calc
Legal & Support
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
  • Contact Us
📩

Get Free Tutorials & Discounts!

Subscribe for IoT tutorials and exclusive KSP discount codes.

Subscription Form


By subscribing, you agree to our Privacy Policy. No spam, ever.

X (Twitter) Instagram YouTube WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
  • Contact Us
© 2026 Circuit of Things. Designed by Sai Preetham Koyyala.

Type above and press Enter to search. Press Esc to cancel.