Skip to main content

Arduino Two-Channel Relay Module Tutorial - Convert Low-Level Trigger to High-Level Trigger

Relay modules are one of the most common hardware interfaces used in Arduino and IoT projects. They allow a low-voltage microcontroller to safely control high-voltage or high-current devices such as lights, fans, pumps, and home appliances.
However, many beginners encounter a frustrating problem:
Some relay modules are low-level trigger, while many microcontrollers and IoT boards expect a high-level trigger.
In this tutorial, you will learn:
  • The difference between low-level and high-level trigger relay modules
  • Why some relay modules fail to work with certain boards
  • How to modify (reassemble) a relay module to make it compatible
  • How to build your own 2-channel high-level trigger relay module
This guide is especially useful for Arduino, ESP8266, ESP32, and other IoT projects.

Why This Modification Is Needed

I originally purchased two low-level trigger relay modules for an IoT project. Unfortunately, they did not work reliably with my system. After testing and researching, the root cause was:
The relay module logic did not match the control signal logic of the microcontroller.
Instead of replacing the modules, we can convert the trigger circuitry.

The Key Idea

Low-level trigger modules typically use a PNP transistor configuration.
To make the module respond to a HIGH signal, we replace it with an NPN transistor (BC547) and rebuild the driver circuit.
This modification converts the relay board into a high-level trigger relay module.

Understanding Relay Trigger Types

Low-Level Trigger Relay

The relay activates when the input pin goes LOW (0V).
  • Signal LOW → Relay ON
  • Signal HIGH → Relay OFF
These modules are common but can cause issues with:
  • ESP8266 / ESP32 boot pins
  • Mixed-logic systems
  • Some IoT platforms

High-Level Trigger Relay

The relay activates when the input pin goes HIGH (5V/3.3V).
  • Signal HIGH → Relay ON
  • Signal LOW → Relay OFF
This behaviour is more intuitive and widely compatible.

Project Overview

We will build a two-channel 5V relay module with:
  • Common VCC and GND
  • Two independent signal pins
  • LED indicators for each relay
  • NPN transistor driver stage

Required Components

Electronic Components

  • 5V Relay (x2)
  • BC547 NPN Transistor (x2)
  • 1 kΩ Resistor (x4)
  • Red LED (x2)
  • Terminal Block (x2)
  • 4-Pin Male Header
  • PCB Prototype Board

Tools

  • Soldering iron
  • Solder wire
  • Desoldering pump (if modifying an existing board)

How Relay Driver Circuits Work

A relay coil requires more current than a microcontroller pin can supply.
Therefore, we use a transistor as a switch.

Role of the BC547 Transistor

The BC547 works as a current amplifier:
  1. Arduino sends a small current to transistor base
  2. Transistor allows larger current to flow through relay coil
  3. Relay switches ON safely

Why NPN Works Better Here

Using an NPN transistor creates a high-level trigger configuration, which is easier to control using Arduino digital outputs.

Circuit Diagram Explanation (Conceptual)

Each relay channel contains:
  • Arduino Signal → Base resistor → BC547 base
  • Emitter → Ground
  • Collector → Relay coil
  • Relay coil → VCC
  • LED indicator connected to show relay status
When the signal goes HIGH:
  • Transistor turns ON
  • Current flows through relay coil
  • Relay activates
  • LED lights up
Instead of buying a new relay, you can reconfigure the module to behave as a high-level trigger relay.

Pin Configuration of the Module

Your completed relay module will have 4 pins:
  • VCC - 5V power supply
  • GND - Ground
  • IN1 - Relay Channel 1 control
  • IN2 - Relay Channel 2 control
Both relays share the same power supply but operate independently.

Step-by-Step Assembly

Step 01: Prepare the PCB

Place the following on the prototyping board:
  • Two relays
  • Two BC547 transistors
  • Two LEDs
  • Resistors and terminal blocks
Plan the layout before soldering.

Step 02: Build the Transistor Driver Stage

For each channel:
  • Connect transistor emitter to GND
  • Connect collector to one side of relay coil
  • Connect other side of relay coil to VCC
  • Add 1kΩ resistor between Arduino signal pin and transistor base
This forms the switching stage.

Step 03: Add LED Indicators

Connect LED and resistor in parallel with relay coil so the LED lights when relay is active.
This helps debugging and testing.

Step 04: Add Header Pins

Install the 4-pin header:
  • VCC
  • GND
  • IN1
  • IN2
Your module is now ready to use.

Testing with Arduino

Example Arduino code:
int relay1 = 7;
int relay2 = 8;

void setup() {
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);
}

void loop() {
  digitalWrite(relay1, HIGH);
  delay(2000);
  digitalWrite(relay1, LOW);
  delay(2000);

  digitalWrite(relay2, HIGH);
  delay(2000);
  digitalWrite(relay2, LOW);
  delay(2000);
}
If everything is correct:
  • Relay clicks when pin goes HIGH
  • LED lights when relay is active

Applications of This Module

This high-level trigger relay module can be used for:
  • Home automation
  • IoT switching systems
  • Smart lighting
  • Motor and pump control
  • Remote appliance control

Safety Tips When Using Relays

Relays often control high-voltage AC loads. Always follow safety rules:
  • Never touch exposed AC wiring
  • Use proper insulation
  • Test using low-voltage loads first
  • Keep high-voltage side physically separated
Safety is critical when working with mains electricity.

Troubleshooting Guide

Relay Not Clicking

Check transistor orientation

LED Works But Relay Doesn't

Insufficient coil current

Relay Always ON

Base resistor missing

Arduino Resets When Relay Activates

Use separate power supply

Conclusion

In this tutorial, you learned how to convert a low-level trigger relay module into a high-level trigger relay module by redesigning the transistor driver stage using BC547 NPN transistors.

This modification improves compatibility with Arduino and IoT boards and helps you understand how relay modules work internally. Instead of treating modules as black boxes, you now know how to repair, modify, and even build your own relay boards.

FAQ

Why didn’t my original relay module work?

Because it required a LOW signal to activate, which conflicted with your control logic.

Can this work with ESP8266 or ESP32?

Yes. High-level trigger modules are ideal for these boards.

Can I power the relays from Arduino 5V pin?

For small projects yes, but for reliability use an external 5V supply.

Why use a transistor instead of driving relay directly?

Arduino pins cannot supply enough current safely.

Comments

Popular posts from this blog

Arduino Serial Communication Beginner Guide (UART Explained)

Serial communication is the backbone of most Arduino projects. It allows your Arduino to talk to your computer, Bluetooth modules, Wi-Fi modules, sensors, and even other Arduinos. If you have ever used the Serial Monitor, you have already used serial communication - now you will understand how it really works. By the end of this guide, you will learn: What serial communication is What UART means How Arduino communicates with devices How to send and receive data How baud rate works Common mistakes beginners make What is Serial Communication? Serial communication is a method of sending data one bit at a time over a single wire. Instead of sending many bits simultaneously (parallel communication), serial sends bits sequentially: Example: The letter A in binary = 01000001 These bits are sent one after another very quickly. This method is: Simple Reliable Perfect for microcontrollers What is UART? UART stands for: Universal Asynchronous Receiver Transmitter It is the hardware ins...

How to Connect HC-06 Bluetooth Module with Arduino (Step-by-Step Beginner Guide)

Bluetooth communication is one of the easiest ways to make Arduino projects wireless. Once you understand how to use a Bluetooth module, you can build robots, home automation systems, and smartphone-controlled devices. In this tutorial, you will learn how to interface the HC-06 Bluetooth module with Arduino and send data wirelessly using your phone.    By the end of this guide, you will be able to: Understand how the HC-06 Bluetooth module works Configure the module using AT commands Safely connect it to an Arduino Send and receive serial data over Bluetooth Build the foundation for wireless Arduino projects Watch the Project Overview What is the HC-06 Bluetooth Module? The HC-06 is a Bluetooth-to-Serial module designed to add wireless communication to microcontrollers such as Arduino. It uses Bluetooth 2.0 (SPP - Serial Port Protocol), which means it behaves like a wireless serial cable. Whatever is sent from the phone appears in Arduino’s Serial Monitor and vice versa. ...

How to Use SoftwareSerial on Arduino (Connect Multiple Serial Devices)

In the previous tutorial, you learned how Arduino uses hardware serial communication through pins 0 (RX) and 1 (TX). That built-in serial port is mainly used to communicate with your computer through the USB cable and Serial Monitor . But here is the problem beginners quickly face: Many popular modules use serial communication, such as: Bluetooth modules ( HC-05 / HC-06 ) GPS modules GSM modules Wi-Fi modules ( ESP8266 ) Arduino Uno has only one hardware serial port. So how can we connect these modules while still using the Serial Monitor? The solution is SoftwareSerial . In this tutorial you will learn how to create additional serial ports using normal digital pins. By the end, your Arduino will be able to talk to multiple serial devices. What is SoftwareSerial? SoftwareSerial is a special Arduino library that allows digital pins to behave like RX and TX pins. This means Arduino can create extra serial ports using software instead of hardware. Hardware Serial vs Software Seri...