Этот учебник является частью: Controlling Relay Using Arduino
This is groups videos all related to relay.
Controlling a 5V Relay Using Arduino to cotrol AC or DC load like bulb or motor
This tutorial demonstrates how to use a 5V relay module with Arduino to control high-voltage devices such as lights, fans, or other appliances. The relay used in this lesson is high-trigger, meaning it activates when the signal pin receives a high-level voltage (5V).

Relay modules are essential in home automation and industrial control systems, allowing you to safely interface microcontrollers with AC-powered devices.
The Arduino code and wiring diagram are available below this article.
What is a High-Trigger Relay?
A relay is an electromechanical switch controlled electrically. The high-trigger version activates when the input signal pin is brought HIGH (typically 5V). It contains:
-
An electromagnetic coil for switching
-
A normally open (NO) and normally closed (NC) contact


-
Signal, VCC, and GND pins
This module allows Arduino to control devices that operate at a higher voltage than the board can handle directly.
Wiring the Relay Module

To safely use the relay with Arduino, wire it as follows:
-
VCC (middle pin) -5V on Arduino
-
GND -GND on Arduino
-
IN (Signal pin) -Digital Pin 2 on Arduino
-
Relay Output terminals -Connect one of the terminals in series with a light bulb, fan, or any other AC/DC load.
Code Overview
Here’s the basic Arduino code used in this lesson:
cppCopyEditvoid setup() {
pinMode(2, OUTPUT); // Set pin 2 as output
}
void loop() {
digitalWrite(2, HIGH); // Turn relay ON
delay(1000); // Wait 1 second
digitalWrite(2, LOW); // Turn relay OFF
delay(1000); // Wait 1 second
}
-
The relay is turned ON when digital pin 2 is set to HIGH.
-
The relay is turned OFF when pin 2 is set to LOW.
-
The cycle repeats every 1 second.
This setup is commonly used to automate home lighting or power control based on sensors or time schedules.
Chapters From the Video
-
00:00 – Relay Explained
-
03:33 – Wiring Explained
-
04:42 – Code Explained
-
06:10 – Demonstration
Этот учебник является частью: Controlling Relay Using Arduino
- Arduino Code and Video for a Dual-Channel 5V Relay
- TTP224 4-Channel Touch Sensor to Turn AC/DC Loads with Relay
- Использование релейного модуля на 5В (низкий триггер) с Arduino
- Using a MAX6675 K-Type Thermocouple with Relay and Display
- Using a Reed Switch to Control a Relay and AC/DC Loads with an Arduino
- Using a TTP223B touch module and relay to control AC/DC loads with an Arduino
- Using an Arduino push button to switch a relay and AC bulb
Вещи, которые могут вам понадобиться
-
Амазонка1 Channel 5V Relay Moduleamzn.to
-
АлиЭкспрессPurchase 5v 12v 1 2 4 6 8 channel channel relay moduls.click.aliexpress.com
Ресурсы и ссылки
Ресурсов пока нет.
Файлы📁
Нет доступных файлов.