Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use RelayModuleI2C: Examples, Pinouts, and Specs

Image of RelayModuleI2C
Cirkit Designer LogoDesign with RelayModuleI2C in Cirkit Designer

Introduction

The RelayModuleI2C is a versatile electronic component designed to control high-voltage devices using low-voltage signals. It features an integrated I2C interface, enabling seamless communication with microcontrollers such as Arduino, Raspberry Pi, and other platforms. This module is ideal for applications requiring remote control of electrical devices, such as home automation, industrial equipment, and robotics.

Explore Projects Built with RelayModuleI2C

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32 and MCP23017-Based Smart Relay Control System with DHT22 Sensors
Image of Indoor Lounge: A project utilizing RelayModuleI2C in a practical application
This circuit is a control system that uses an ESP32 microcontroller to manage multiple relays and read data from DHT22 temperature and humidity sensors. The DFRobot Gravity MCP23017 I2C module expands the GPIO capabilities of the ESP32, allowing it to control additional relays for switching high-power devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-S3 Based Smart IoT Distance Sensor with Ethernet Connectivity
Image of ttt: A project utilizing RelayModuleI2C in a practical application
This circuit features an ESP32-S3 microcontroller interfaced with a KY-019 Relay module, a VL53L1X time-of-flight sensor, and a W5500 Ethernet module. The ESP32-S3 controls the relay and communicates with the VL53L1X sensor via I2C, as well as with the network through the Ethernet module. An AC source is converted to DC for powering the components, and a micro USB connection is used to trigger the relay.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled I2C LCD Display and Relay Module
Image of EV WIRELESS  CHRG: A project utilizing RelayModuleI2C in a practical application
This circuit features an ESP32 microcontroller interfaced with an I2C LCD 16x2 screen and a 2-channel relay module. The ESP32 controls the display of messages on the LCD screen and the switching of the relay channels. The code provided enables the ESP32 to initialize the LCD and cycle through displaying messages with delays, while the relay channels can be controlled via the ESP32's GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU Controlled Smart Irrigation System with I2C LCD Display
Image of SIH_24: A project utilizing RelayModuleI2C in a practical application
This circuit is designed for a smart irrigation system that uses an ESP8266 NodeMCU to monitor soil moisture and ambient temperature/humidity, and display the data on an I2C LCD screen. It controls a water pump via a relay, which is activated when soil moisture falls below a threshold or manually via a tactile switch. The system aims to optimize water usage for precision farming by automating irrigation based on real-time environmental conditions.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with RelayModuleI2C

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Indoor Lounge: A project utilizing RelayModuleI2C in a practical application
ESP32 and MCP23017-Based Smart Relay Control System with DHT22 Sensors
This circuit is a control system that uses an ESP32 microcontroller to manage multiple relays and read data from DHT22 temperature and humidity sensors. The DFRobot Gravity MCP23017 I2C module expands the GPIO capabilities of the ESP32, allowing it to control additional relays for switching high-power devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ttt: A project utilizing RelayModuleI2C in a practical application
ESP32-S3 Based Smart IoT Distance Sensor with Ethernet Connectivity
This circuit features an ESP32-S3 microcontroller interfaced with a KY-019 Relay module, a VL53L1X time-of-flight sensor, and a W5500 Ethernet module. The ESP32-S3 controls the relay and communicates with the VL53L1X sensor via I2C, as well as with the network through the Ethernet module. An AC source is converted to DC for powering the components, and a micro USB connection is used to trigger the relay.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of EV WIRELESS  CHRG: A project utilizing RelayModuleI2C in a practical application
ESP32-Controlled I2C LCD Display and Relay Module
This circuit features an ESP32 microcontroller interfaced with an I2C LCD 16x2 screen and a 2-channel relay module. The ESP32 controls the display of messages on the LCD screen and the switching of the relay channels. The code provided enables the ESP32 to initialize the LCD and cycle through displaying messages with delays, while the relay channels can be controlled via the ESP32's GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SIH_24: A project utilizing RelayModuleI2C in a practical application
ESP8266 NodeMCU Controlled Smart Irrigation System with I2C LCD Display
This circuit is designed for a smart irrigation system that uses an ESP8266 NodeMCU to monitor soil moisture and ambient temperature/humidity, and display the data on an I2C LCD screen. It controls a water pump via a relay, which is activated when soil moisture falls below a threshold or manually via a tactile switch. The system aims to optimize water usage for precision farming by automating irrigation based on real-time environmental conditions.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Home automation systems (e.g., controlling lights, fans, or appliances)
  • Industrial equipment control
  • Robotics and mechatronics
  • Smart energy management systems
  • Prototyping and educational projects

Technical Specifications

Key Specifications

Parameter Value
Operating Voltage 5V DC
Relay Control Voltage 3.3V or 5V (logic level compatible)
Communication Protocol I2C
I2C Address Range 0x20 to 0x27 (configurable)
Maximum Load Voltage 250V AC / 30V DC
Maximum Load Current 10A
Number of Relays 1 to 4 (depending on the model)
Dimensions Varies by model (e.g., 50mm x 40mm)

Pin Configuration

The RelayModuleI2C typically has the following pin configuration:

Input Pins (Microcontroller Side)

Pin Name Description
VCC Power supply input (5V DC)
GND Ground
SDA I2C data line
SCL I2C clock line

Output Terminals (Relay Side)

Terminal Name Description
COM Common terminal for the relay
NO Normally Open terminal
NC Normally Closed terminal

Usage Instructions

Connecting the RelayModuleI2C

  1. Power Supply: Connect the VCC pin to a 5V DC power source and the GND pin to the ground of your microcontroller.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller (e.g., A4 and A5 on Arduino UNO).
  3. Load Connection: Connect the device you want to control to the relay terminals:
    • Use the COM and NO terminals for devices that should be off by default.
    • Use the COM and NC terminals for devices that should be on by default.

Example Arduino Code

Below is an example of how to control the RelayModuleI2C using an Arduino UNO:

#include <Wire.h> // Include the Wire library for I2C communication

#define RELAY_I2C_ADDRESS 0x20 // Default I2C address of the relay module

void setup() {
  Wire.begin(); // Initialize I2C communication
  Serial.begin(9600); // Initialize serial communication for debugging

  // Turn off all relays at startup
  Wire.beginTransmission(RELAY_I2C_ADDRESS);
  Wire.write(0x00); // Send command to turn off all relays
  Wire.endTransmission();
  Serial.println("Relay module initialized.");
}

void loop() {
  // Example: Turn on relay 1
  Wire.beginTransmission(RELAY_I2C_ADDRESS);
  Wire.write(0x01); // Command to turn on relay 1
  Wire.endTransmission();
  delay(1000); // Keep relay 1 on for 1 second

  // Example: Turn off relay 1
  Wire.beginTransmission(RELAY_I2C_ADDRESS);
  Wire.write(0x00); // Command to turn off relay 1
  Wire.endTransmission();
  delay(1000); // Keep relay 1 off for 1 second
}

Important Considerations

  • Power Requirements: Ensure the module is powered with a stable 5V DC supply.
  • Load Ratings: Do not exceed the maximum voltage (250V AC / 30V DC) or current (10A) ratings of the relay.
  • I2C Address: If using multiple RelayModuleI2C units, configure unique I2C addresses for each module to avoid conflicts.
  • Isolation: The relay provides electrical isolation between the control circuit and the high-voltage load, but proper safety precautions should still be followed.

Troubleshooting and FAQs

Common Issues

  1. Relay Not Switching

    • Cause: Insufficient power supply or incorrect wiring.
    • Solution: Verify the VCC and GND connections and ensure a stable 5V DC supply.
  2. I2C Communication Failure

    • Cause: Incorrect I2C address or wiring.
    • Solution: Check the I2C address of the module and ensure SDA and SCL are connected to the correct pins on the microcontroller.
  3. Load Not Responding

    • Cause: Incorrect load wiring or exceeding load ratings.
    • Solution: Verify the load is connected to the correct relay terminals (COM, NO, or NC) and ensure the load does not exceed the relay's voltage/current ratings.

FAQs

  1. Can I use this module with a 3.3V microcontroller?

    • Yes, the module is compatible with 3.3V logic levels for I2C communication, but the VCC pin still requires a 5V power supply.
  2. How do I change the I2C address?

    • The I2C address can be configured using onboard jumpers or DIP switches. Refer to the module's datasheet for specific instructions.
  3. Is the relay module safe for high-voltage applications?

    • Yes, the relay provides electrical isolation, but always follow proper safety guidelines when working with high-voltage devices.
  4. Can I control multiple relays simultaneously?

    • Yes, you can send commands to control multiple relays on the module. Refer to the module's datasheet for the command structure.

By following this documentation, you can effectively integrate the RelayModuleI2C into your projects and control high-voltage devices with ease!