Ordered on weekdays before 14:00 = shipped the same day and delivered the next day in 98% of cases. Free returns 30-day reflection period 1-year warranty

Wiring diagram and code example

How to connect the 5V Relay Module for Arduino to an Arduino UNO or ESP32, with an example sketch you can upload straight away.

Control a 5V Relay with Arduino UNO

This project demonstrates how to control a 5V relay module with an Arduino UNO. The sketch toggles the relay ON and OFF every two seconds while printing the status to the Serial Monitor. You will hear an audible click from the relay each time it switches state.

Wiring diagram: 5V Relay Module for Arduino on an Arduino UNO
Wiring diagram · Click to enlarge
Connection table: 5V Relay Module for Arduino on an Arduino UNO
Connection table · Click to enlarge
Control_a_5V_Relay_with_Arduino_UNO.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Control a 5V Relay with Arduino UNO
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Relay Module 5V
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// 5V Relay Module Example
const int RELAY_PIN = 7;

void setup() {
  pinMode(RELAY_PIN, OUTPUT);
  Serial.begin(115200);
  Serial.println(F("Relay module demo started."));
}

void loop() {
  // Turn relay ON
  digitalWrite(RELAY_PIN, HIGH);
  Serial.println(F("Relay: ON"));
  delay(2000);

  // Turn relay OFF
  digitalWrite(RELAY_PIN, LOW);
  Serial.println(F("Relay: OFF"));
  delay(2000);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

5V Relay Control with ESP32

This project demonstrates how to control a 5V relay module using an ESP32. The relay switches ON and OFF every two seconds while printing its status to the Serial Monitor. The relay is powered directly from the ESP32 VIN pin (5V from USB) and triggered via GPIO 4.

Wiring diagram: 5V Relay Module for Arduino on an ESP32 DevKit V1
Wiring diagram · Click to enlarge
Connection table: 5V Relay Module for Arduino on an ESP32 DevKit V1
Connection table · Click to enlarge
5V_Relay_Control_with_ESP32.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : 5V Relay Control with ESP32
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Relay Module 5V
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// 5V Relay Control Example for ESP32
const int RELAY_PIN = 4;

void setup() {
  Serial.begin(115200);
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, LOW);
  Serial.println("Relay control initialized.");
}

void loop() {
  // Turn relay ON (Active HIGH for standard modules)
  Serial.println("Relay: ON");
  digitalWrite(RELAY_PIN, HIGH);
  delay(2000);

  // Turn relay OFF
  Serial.println("Relay: OFF");
  digitalWrite(RELAY_PIN, LOW);
  delay(2000);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

5V Relay Module for Arduino

  • High load possible: AC250V 10A / DC30V 10 A
  • Relay control 5v
  • 1 relay on PCB
  • Suitable for Arduino / ESP32 / ESP8266
  • Easy to connect with DuPont cables

Search terms: relay 5v, 5v relay, relay 5v, 5v relay, relay high, relay high, relay high, blue relay, relay blue, relay 250v, relay 220v, relay for arduino, arduino relay, relay breadboard

Dimensions
Length: 3.3cm
Width: 2.6cm
Height: 1.7cm

  • 1 relay
  • 5V control
  • DuPont cables
  • 3,3 x 2,6 x 1,7 cm

Why choose this product?

  • Easy to connect – Use with DuPont jumper wires.
  • For multiple boards – Suitable for Arduino, ESP32 and ESP8266.
  • 1 relay on PCB – Compact module with one relay.
  • 5V relay control – Controlled with 5V.
  • High load – Suitable for AC250V 10A and DC30V 10A.
Specifications
Width2,6 cm
Suitable forArduino / ESP32 / ESP8266
Length3,3 cm
Type1 relay
Height1,7 cm
High load possibleAC250V 10A / DC30V 10 A
Control5 V

Frequently bought together

Total: € 15,20

Reviews

★★★★★ 4,8/5 4 reviews
  • ★★★★★Leon ScheepersVerified purchase

    Beautiful design

  • ★★★★★Gijs HardieckVerified purchase

    works perfectly

  • ★★★★★MattVerified purchase

    Solid product.

Write a review
Your rating

Shipping & returns

Shipping

  • Parcel with track & trace€ 7,70Within 24 hours
  • Pick up at PostNL location€ 7,40Within 24 hours
  • Letterbox parcel€ 3,70Within 2 business days
  • Letterbox parcel 24 hours€ 4,55Within 24 hours
  • Pick up in storeFree
All about shipping

Returns

Not satisfied? You have 30 days after delivery to return the product.

All about returns

Recently viewed

RC Snubber Circuit Diagram

RC Snubber Circuit Diagram

€ 1,80
TCRT5000 module optical sensor

TCRT5000 module optical sensor

€ 1,60
Toggle lever switch

Toggle lever switch

€ 0,95
LCD 1602/2004 I2C adapter

LCD 1602/2004 I2C adapter

€ 1,85
Desoldering pump

Desoldering pump

€ 2,40
Relay Module 5V Low

Relay Module 5V Low

€ 1,89
ESP-01 Adapter 3.3V 5V

ESP-01 Adapter 3.3V 5V

€ 2,10