Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›5V, 12V and 24V Relay Modules (1 to 16 Channel)

Component guide · Beginner · 4 min read

5V, 12V and 24V Relay Modules (1 to 16 Channel)

Wiring and Code

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the 5V relay module is5V relay module pinoutWiring the 5V relay moduleExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Short answer

A relay module lets an Arduino or ESP32 switch a lamp, pump, solenoid or fan through an isolated contact rated about 10 A at 250 V AC or 30 V DC. The coil voltage (5 V, 12 V or 24 V) must match the module's supply. Most boards are active-low (input LOW turns the relay on), have an optocoupler on each input, and a JD-VCC jumper to power the coils separately.

Key specs at a glance

Coil voltage
5 V, 12 V or 24 V (module supply); wide-input 6 to 30 V model
Contacts
SPDT (COM, NO, NC), typically 10 A 250 V AC / 10 A 30 V DC
Channels
1, 2, 4, 8 or 16
Input
Active-low on most boards (some have a high/low jumper), 3.3 or 5 V logic
Isolation
Optocoupler per channel, JD-VCC jumper for separate coil supply
Coil current
About 70 to 90 mA per 5 V relay

Models in this guide

These are alternatives. Pick the one that fits your project; you only need one.

  • Option 15V Relay Module with Optocoupler₹74
  • Option 25V Relay Module (Optocoupled)₹35
  • Option 3Relay Module Board 5V, Optocoupled (2 / 4 / 8 / 16 Channel)₹82
  • Option 412V Relay Module₹160
  • Option 512V Relay Module with Optocoupler (1 to 8 Channel)₹142
  • Option 6Relay Module Board 12V, Optocoupled (2 / 4 / 8 / 16 Channel)₹164
01

What the 5V relay module is

The relay coil pulls in a contact that connects COM to NO (normally open) and breaks COM from NC (normally closed). Use NO so the load is off when the controller is off or resetting.

With the JD-VCC jumper removed, the coils run from a separate 5 V supply and the controller only lights the optocoupler LEDs, which keeps relay noise off the logic side.

02

5V relay module pinout

The pins on the 5V relay module and what each one does.

PinFunction
VCCLogic side supply (optocoupler LEDs)
GNDLogic ground
IN1...INnInputs, usually LOW = relay on
JD-VCC / VCC jumperFit to share one supply; remove to power coils from JD-VCC
COMCommon contact
NONormally open contact
NCNormally closed contact
PinFunction
VCC
Logic side supply (optocoupler LEDs)
GND
Logic ground
IN1...INn
Inputs, usually LOW = relay on
JD-VCC / VCC jumper
Fit to share one supply; remove to power coils from JD-VCC
COM
Common contact
NO
Normally open contact
NC
Normally closed contact
03

Wiring the 5V relay module

Many 5 V modules do not switch reliably from a 3.3 V ESP32 pin with the jumper fitted: remove the jumper, power VCC from 3.3 V and JD-VCC from 5 V. For mains loads, switch the live wire only, use a fuse, an enclosure and cable rated for the load, and ask a qualified electrician for permanent wiring.

5V relay module pinArduino UnoESP32
VCC5V5V (VIN) for 5 V relays, or 3V3 with jumper removed
GNDGNDGND
IN1D7GPIO 26
JD-VCC (jumper off)Separate 5 V supply +Separate 5 V supply +
COM / NOIn series with the load's live wireIn series with the load's live wire
VCC
Arduino Uno:
5V
ESP32:
5V (VIN) for 5 V relays, or 3V3 with jumper removed
GND
Arduino Uno:
GND
ESP32:
GND
IN1
Arduino Uno:
D7
ESP32:
GPIO 26
JD-VCC (jumper off)
Arduino Uno:
Separate 5 V supply +
ESP32:
Separate 5 V supply +
COM / NO
Arduino Uno:
In series with the load's live wire
ESP32:
In series with the load's live wire
04

Example code

Setting the pin HIGH before pinMode() stops the relay clicking on at boot. If your board has a high/low trigger jumper and it is set to high, swap ON and OFF.

Switch a load on for 5 seconds every minute (active-low) · Arduino C++Verify & upload in Electrolark
const int RELAY = 7;
const bool ON = LOW, OFF = HIGH;    // most modules are active-low

void setup() {
  digitalWrite(RELAY, OFF);         // set the level before enabling the output
  pinMode(RELAY, OUTPUT);
}

void loop() {
  digitalWrite(RELAY, ON);
  delay(5000);
  digitalWrite(RELAY, OFF);
  delay(55000);
}
05

Setup and tuning

Supply

an 8-channel 5 V board with all relays on draws about 0.7 A; do not run it from the Uno 5V pin.

Inductive DC loads

put a diode across DC solenoids and pumps; for motors and AC loads, add an RC snubber.

Contact rating

motors and lamps have high inrush; derate the 10 A contact to about 3 to 5 A for them.

Boot glitches

avoid ESP32 strapping pins (0, 2, 12, 15) for relays.

06

What you need

Shop this list12 of 15 found in our store · ₹1,878

  • 5V Relay Module with Optocoupler: the part this guide covers5V Relay Module with Optocoupler₹74
  • 5V Relay Module (Optocoupled): another version this guide covers5V Relay Module (Optocoupled)₹35
  • Relay Module Board 5V, Optocoupled (2 / 4 / 8 / 16 Channel): another version this guide coversRelay Module Board 5V, Optocoupled (2 / 4 / 8 / 16 Channel)₹82
  • 12V Relay Module: another version this guide covers12V Relay Module₹160
  • 12V Relay Module with Optocoupler (1 to 8 Channel): another version this guide covers12V Relay Module with Optocoupler (1 to 8 Channel)₹142
  • Relay Module Board 12V, Optocoupled (2 / 4 / 8 / 16 Channel): another version this guide coversRelay Module Board 12V, Optocoupled (2 / 4 / 8 / 16 Channel)₹164
  • 24V Relay Module 1 Channel: another version this guide covers24V Relay Module 1 Channel₹59
  • ACEBOTT 5V Relay Module, Easy-Plug, for ESP32 and Arduino: another version this guide coversACEBOTT 5V Relay Module, Easy-Plug, for ESP32 and Arduino₹227
  • Wide-Input One-Way Relay Module 6–30V: another version this guide coversWide-Input One-Way Relay Module 6–30V₹112
  • Uno R3 development board: the controller used in the wiring tableFind this part
  • ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
  • SMPS power supply (5 V, 12 V or 24 V): to power the relay coilsEnclosed SMPS Power Supply₹257Closest match, check the specs
  • Fuse holder: to fuse the switched loadFind this part
  • 1N4007 diode: flyback diode across a bare relay coilFind this part
  • Digital multimeter: to check supply and signal voltagesDigital Multimeter₹177
07

Alternatives and when to choose them

  • ✓Relay modules: types and choosing a relay board.
  • ✓SSR or relay: when a solid-state relay is better.
  • ✓Solid state relay: silent, fast switching for AC loads.
  • ✓Optocouplers: how input isolation works.
08

Common mistakes to avoid

  • !Switching neutral instead of live on mains loads.
  • !Powering many relays from the Arduino 5V pin.
  • !Expecting a 5 V relay to pull in from 3.3 V with the jumper fitted.
  • !Using the 10 A rating for a motor's inrush current.
09

Frequently asked questions

Why does the relay turn on when I write LOW?

Most modules are active-low. Write HIGH to turn it off.

Can an ESP32 drive a 5 V relay module?

Yes, with the JD-VCC jumper removed, VCC on 3.3 V and JD-VCC on 5 V, or with a module rated for 3.3 V input.

NO or NC?

Use NO for loads that should be off when the controller is off.

Can it switch a 1.5 ton AC or geyser?

Not directly. Use it to drive a contactor rated for the load.

Why does my Arduino reset when the relay switches?

Coil and load noise. Separate the coil supply with JD-VCC and add snubbers.

Parts for this guide

  • 5V Relay Module with Optocoupler
    ₹74View
  • 5V Relay Module (Optocoupled)
    ₹35View
  • Relay Module Board 5V, Optocoupled (2 / 4 / 8 / 16 Channel)
    ₹82View
  • 12V Relay Module
    ₹160View
  • 12V Relay Module with Optocoupler (1 to 8 Channel)
    ₹142View
  • Relay Module Board 12V, Optocoupled (2 / 4 / 8 / 16 Channel)
    ₹164View
  • 24V Relay Module 1 Channel
    ₹59View
  • ACEBOTT 5V Relay Module, Easy-Plug, for ESP32 and Arduino
    ₹227View
  • Wide-Input One-Way Relay Module 6–30V
    ₹112View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • SMPS Power Supply, Metal Enclosure (5V / 12V / 24V)
    ₹298View
  • Fuse Holder (Panel, PCB and HRC)
    ₹105View
  • 1N4007 Rectifier Diode (Pack of 10)
    ₹15View
  • Digital Multimeter
    ₹177View
Shop Relay Modules

Keep learning

Component guideBeginnerRelay ModulesA relay module is an electrically controlled switch that lets a microcontroller turn a separate circuit on or off, such as a 12 V pump or a mains lamp.4 min read · Switches, Relays & InputComparisonIntermediateSolid-State Relay vs Mechanical RelayA mechanical relay closes metal contacts with a coil, so it switches AC or DC with almost no voltage drop or leakage, but it clicks and wears out.3 min read · Switches, Relays & InputComponent guideIntermediateOptocouplersAn optocoupler contains an LED and a light-sensitive transistor in one package with no electrical connection between them.3 min read · Semiconductors & ICsConcept explainerIntermediateMQTT and Home Assistant for ESP32MQTT is a lightweight messaging system: devices publish messages to named topics on a broker, and anything subscribed to that topic receives them.3 min read · IoT & Wireless

Sources

  • Songle SRD-05VDC-SL-C relay datasheet
  • PC817 optocoupler datasheet

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the 5V relay module is5V relay module pinoutWiring the 5V relay moduleExample codeSetup and tuningWhat you needAlternatives and when to choose themCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide (Arduino Uno)8 items · ₹920

5V Relay Module with Optocoupler · 5V Relay Module (Optocoupled) · Relay Module Board 5V, Optocoupled (2 / 4 / 8 / 16 Channel) · 12V Relay Module · 12V Relay Module with Optocoupler (1 to 8 Channel) · Relay Module Board 12V, Optocoupled (2 / 4 / 8 / 16 Channel) · 24V Relay Module 1 Channel · Uno R3 CH340G ATmega328p Compatible Development Board

Run itChange the inputs and watch the output

Active-low module: LOW turns the relay on. Here 5 s on, 55 s off, shortened to one step per second.

Relay ON
0IN pin

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question