Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Relay Add-on Module for Seeed Studio XIAO and QT Py: Examples, Pinouts, and Specs

Image of Relay Add-on Module for Seeed Studio XIAO and QT PyDesign with Relay Add-on Module for Seeed Studio XIAO and QT Py in Cirkit Designer

Introduction

The Relay Add-on Module is a compact and efficient solution for controlling high-voltage devices using low-voltage signals. Designed specifically for Seeed Studio's XIAO and Adafruit's QT Py microcontrollers, this module simplifies the process of integrating relays into your projects. It allows microcontrollers to safely switch high-power devices such as lights, fans, or motors, making it ideal for home automation, IoT applications, and prototyping.

Explore Projects Built with Relay Add-on Module for Seeed Studio XIAO and QT Py

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 ESP32C3-Based Smart AC Light Controller with Voltage Sensing: A project utilizing Relay Add-on Module for Seeed Studio XIAO and QT Py in a practical application
ESP32C3-Based Smart AC Light Controller with Voltage Sensing

This circuit appears to be a smart AC power control system. The XIAO ESP32C3 microcontroller is used to monitor AC voltage through the ZMPT101B module and to control a 12v Relay, which in turn switches an AC Bulb on or off. The Mini AC-DC module provides the 5V power required by the microcontroller and the relay, while the AC Wire provides the AC power to the system.

Open Project in Cirkit Designer
Image of ESP32-S3 Based Smart IoT Distance Sensor with Ethernet Connectivity: A project utilizing Relay Add-on Module for Seeed Studio XIAO and QT Py 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.

Open Project in Cirkit Designer
Image of ESP32-Based Smart Environment Controller with Relay and Sensor Integration: A project utilizing Relay Add-on Module for Seeed Studio XIAO and QT Py in a practical application
ESP32-Based Smart Environment Controller with Relay and Sensor Integration

This circuit features an ESP32 microcontroller interfaced with various sensors and modules, including an MLX90614 infrared temperature sensor, an HC-SR04 ultrasonic distance sensor, and an LCD display for output. A KY-019 relay module is controlled by the ESP32 to switch an AC source, with a PTC for circuit protection. Additionally, an AC-to-DC converter powers the ESP32 and a fan, indicating the circuit may be used for temperature-based control applications with visual feedback and actuation capabilities.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

The Relay Add-on Module has a simple pinout for easy integration:

Pin Name Description
VCC Power input (3.3V or 5V, depending on the microcontroller used).
GND Ground connection.
IN Signal input pin to trigger the relay (active HIGH).
COM Common terminal of the relay switch.
NO Normally Open terminal (connected to COM when the relay is activated).
NC Normally Closed terminal (connected to COM when the relay is not activated).

Usage Instructions

How to Use the Component in a Circuit

  1. Connect the Module to the Microcontroller:

    • Attach the VCC and GND pins of the module to the corresponding power and ground pins of the XIAO or QT Py.
    • Connect the IN pin to a GPIO pin on the microcontroller.
  2. Connect the High-Voltage Device:

    • Wire the high-voltage device to the relay terminals (COM, NO, or NC) based on your desired switching behavior:
      • Use COM and NO for devices that should turn ON when the relay is activated.
      • Use COM and NC for devices that should turn OFF when the relay is activated.
  3. Write the Control Code:

    • Use the microcontroller to send a HIGH signal to the IN pin to activate the relay.
  4. Power the Circuit:

    • Ensure the microcontroller and relay module are powered appropriately. Double-check all connections before applying power.

Important Considerations and Best Practices

Example Code for Arduino UNO

Below is an example code snippet to control the relay module using an Arduino-compatible board like the Seeed Studio XIAO:

// Define the GPIO pin connected to the relay module's IN pin
const int relayPin = 7;

void setup() {
  // Set the relay pin as an output
  pinMode(relayPin, OUTPUT);

  // Ensure the relay is off at startup
  digitalWrite(relayPin, LOW);
}

void loop() {
  // Turn the relay ON
  digitalWrite(relayPin, HIGH);
  delay(5000); // Keep the relay on for 5 seconds

  // Turn the relay OFF
  digitalWrite(relayPin, LOW);
  delay(5000); // Keep the relay off for 5 seconds
}

Notes on the Code

Troubleshooting and FAQs

Common Issues and Solutions

  1. Relay Not Activating:

    • Cause: Insufficient signal voltage or current from the microcontroller.
    • Solution: Verify that the GPIO pin is set to HIGH and can provide the required voltage (3.3V or 5V).
  2. High-Voltage Device Not Switching:

    • Cause: Incorrect wiring of the relay terminals (COM, NO, NC).
    • Solution: Double-check the wiring and ensure the device is connected to the correct terminals.
  3. Module Overheating:

    • Cause: Exceeding the relay's current rating (10A).
    • Solution: Use a device with a current draw within the relay's specifications.
  4. Microcontroller Resets When Relay Activates:

    • Cause: Voltage spikes or insufficient power supply.
    • Solution: Ensure the power supply can handle the relay's activation current. Use decoupling capacitors if necessary.

FAQs

By following this documentation, you can effectively integrate the Relay Add-on Module into your projects and safely control high-voltage devices with ease.