Labs / Electronic modules

GraftSense - G6KU-based Latching Relay Module (Open Version)

Author: Li Zisheng · Source: FreakStudio open documentation, v1.3 · License: CC BY 4.0 · Driver code (misc/relay_driver): MIT License

Contents
G6KU 125V 0.3A 30V 1A
G6KU U1 U2 U3 C3 C4 C5 R1 R2 LED1

I. Module Introduction

G6KU-based latching relay module takes the G6KU ultra-compact SMD latching relay as the core, and is designed with the FM116C H-bridge driver IC: it drives the latching relay via an H-bridge circuit, and is equipped with a diode freewheeling circuit to ensure circuit stability; the latching feature enables the module to achieve extremely low power consumption, while the G6KU relay itself boasts advantages such as ultra-small size (suitable for high-density layout) and high dielectric strength, and the module can carry a load of 125V 0.3A AC or 30V 1A DC.When in use, connect the control terminal to the GND, VCC, DOUT1, and DOUTO interfaces on the right side of the module, then connect the external load to the A and B output terminals to complete the connection.

II. Introduction to Main Chips

This module mainly uses G6KU ultra-compact SMD latching relays and FM116C H-bridge driver IC.

2.1 Chip Overview

2.1.1 G6KU Latching Relay

G6K 5.2 6.5 10 5.2mm 0.7g 2F 2 1500VAC 2A
G6K 2 1 2c 3 4 G6KU
G6KU

G6K is a surface-mount relay featuring the "world's smallest installation footprint" as its core selling point, with a key advantage of an ultra-compact design: it measures merely 5.2 (H) × 6.5 (W) × 10 (L) mm, has a thickness of 5.2 mm and weighs only 0.7 g, making it suitable for high-density circuit layouts; its surface-mount terminals adopt a unique structure, delivering high infrared soldering efficiency and excellent soldering stability.

Its model numbers use codes to distinguish functions (e. g., in G6K (U)-2F (Y))), where U denotes single-winding magnetically latching type, 2 indicates 2-pole DPDT contacts, F stands for outer-side L type SMT terminals, and Y refers to the high pulse withstand voltage version with optimized terminal layout). In terms of performance, it features a dielectric strength of 1500VAC (the Y type offers a pulse withstand voltage of 2500V), a rated current-carrying capacity of 2A, and complies with certifications including UL / CSA as well as the RoHS standard.

2.1.2 FM116C Motor Driver Chip

FM116C SOT23-6 typ.0.1uA 2.5V 5V 500mA 4V 5

2.2 Pin Definition

2.2.1 G6KU Latching Relay

G6K-2F-Y 10.02mm 7.6mm 5.4mm

G6K-2F-Y relay (top view) has a total of 8 pins: pins 1 and 2 are coil pins; pins 3-8 are 2-pole double-throw (DPDT) contact pins, corresponding to the normally open / normally closed contacts of the two channels, for connecting to an external load circuit.

When in use, distinguish between coil pins and contact pins, and meanwhile pay attention to the polarity matching of the coil.

2.2.2 FM116C Motor Driver Chip

FM116C OUT1 IN1 OUT2 IN2

2.3 Functional Block Diagram

2.3.1 G6KU Latching Relay

None.

2.3.2 FM116C Motor Driver Chip

FM116C IN1 IN2 OUT1 OUT2
FM116C IN1 IN2 OUT1 OUT2

On the left is the input processing unit (corresponding to the IN1 / IN2 pins), and each input is equipped with a pull-down resistor, an ESD protection diode and a buffer to stabilize the input signal and protect against electrostatic interference; in the middle is the core module, which integrates logic control and power MOSFET drive circuits, and also includes an internal thermal shutdown (TSD) circuit, responsible for signal processing, drive control and over-temperature protection;On the right is the H-bridge power output unit (corresponding to the VDD / OUT1 / OUT2 / GND pins), which consists of MOS transistors with freewheeling diodes and can implement driving functions such as forward/reverse rotation and braking for the load.

2.4 Performance Parameters

2.4.1 G6KU Latching Relay

G6K-2F-Y is a fully sealed, single-side stable 2-pole double-throw (DPDT) high-insulation patch relay, with its core parameters as follows: the coil supports rated voltages such as 3/4.5/5/12/24VDC (taking 3VDC as an example, the rated current is 33mA and the coil resistance is 91Ω), the operate/release voltage does not exceed 75% of the rated value, the maximum instantaneous voltage is 150% of the rated value, and the power consumption is about 100mW;In terms of performance, it features a maximum contact resistance of 100mΩ, an operating time ≤3ms, a release time ≤100ms, an insulation resistance between the coil and contacts ≥1000MΩ(500VDC), a dielectric strength of 1500VAC (coil to contacts), a mechanical lifespan of no less than 50 million cycles, an electrical lifespan of no less than 100,000 cycles, an operating temperature and humidity range of -40~70℃ and 5%-85%, and a weight of approximately 0.7g.

G6K G6K-2F-Y-TR 4.5VDC 50pcs/tube G6K-2F-Y
G6KU G6KU-2F-Y G6KU-2G-Y G6KU-2P-Y 3 4.5 5 12 24 4.6mA
G6KU
G6KU
G6K-2G
G6K-2G 10
G6K-2G 23 6

2.4.2 FM116C Motor Driver Chip

FM116C
G6KU FM116C OUT1 OUT2 2.0 6V 0 400 600mA
FM116C 1uA 10uA 72uA 1.4uA 2.14m 0.7VDD 0.2VDD 1.5 160

2.5 Reference Circuit

2.5.1 G6KU Latching Relay

None.

2.5.2 FM116C Motor Driver Chip

FM116C 1 6V IN1/IN2 2 3V IN1 IN2 OUT1 OUT2

Figure 1 shows the standby current test, which is conducted by connecting a 6V power supply to VDD / GND, shorting IN1 / IN2 to GND, and measuring the current during standby with an ammeter; Figure 2 is used for static current, input high-level current and pull-down resistance testing, where measurement is performed by inputting a high-level signal to IN1/IN2 under a 3V power supply.

FM116C 3V IN1 IN2 OUT2 OUT1

Figure 3 shows the output resistance test, where a current source is used to apply a load to OUT1 / OUT2, the direction of the load current is changed by switching the high and low levels of IN1 / IN2, and the output resistance is calculated by measuring the port voltage difference.

FM116C IN1 IN2 OUT1 OUT2 Vout1 Vout2 G6KU

Figure 4 shows the typical operating waveforms, which illustrate the variation logic of the output voltage difference between IN1 / IN2 in different level combinations corresponding to forward rotation, reverse rotation, braking and standby modes, and OUT1 and OUT2.

FM116C 2.5V 4.5V OUT1 OUT2 104 3V 1uF
1.8V 5V IN1 IN2 OUT1 OUT2 104 FM116C 550mA 1500V

2.6 Chip Configuration

2.6.1 G6KU Latching Relay

None.

2.6.2 FM116C Motor Driver Chip

None.

2.7.1 G6KU Latching Relay

None.

2.7.2 FM116C Motor Driver Chip

None.

2.8 PCB Routing Notes

2.8.1 G6KU Latching Relay

None.

2.8.2 FM116C Motor Driver Chip

PCB routing considerations for FM116C are as follows:

III. Instructions for Circuit Engineering and Module Usage

3.1 Circuit Source Engineering

To obtain the circuit source project, please follow the official account [Freak Embedded]

3.2 Module Usage Instructions

The principle of this module is shown as follows:

SCH_G6KU-Based_Magnetic_Latching_Relay_Module_v1.0_2025-11-26.pdf 2.6 MB

G6KU U1 U2 U3 U4 C1 C2 C3 C4 R1
v1.0 DOUT1 DOUT0

This module provides two digital interfaces DOUT0 and DOUT1 (corresponding to DOUT1 and DOUT2 in the schematic): in combination with the logic truth table and the H-bridge driving principle:

Due to the characteristics of the latching relay, after the pull-in/closure is completed, even if the interface returns to the standby (IN1= IN2= L) or braking (IN1= IN2= H) state, the relay will maintain the current on/off state without continuous power supply.

When in use, we can make the connection in the following way:

GraftSense - G6KU-based Latching Relay Module (Open Version)

Meanwhile, we have also conducted tests on its power consumption:

4.87V 0.019A 0.09W DCP1.5A 0.12W

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and the G6KU-based latching relay module uses the DIO interface to communicate with the main controller.

Here, we first use the HY2.0-4P connection cable to connect the module to the GraftPort-RP2040 development board's DIO1 interface:

HY2.0-4P GraftPort-RP2040

The module connections are shown in the following table:

Development Board Pins

Module Pins

Description

Pin 14

DOUT

The pins connected to the MCU output high and low levels.

Pin 15

NC

-

Here, we need to search for the relevant driver packages on uPyPI: https://upypi.net/zh/

106

Enter relay_driver to search, and the following will be displayed:

1.0.0 2020 2 12

Click to copy the local installation command:

168 1.0.0

Import the module driver library code via the mip tool. Below are the usage commands for the mpremote tool:

mpremote mip install https://upypi.net/pkgs/relay_driver/1.0.0

After importing the relay module driver - MicroPython driver code, copy the following main.py code into our project:

# Python env   : MicroPython v1.23.0
# -*- coding: utf-8 -*-
# @Time    : 2024/7/28 3:00 PM
# @Author  : Li Qingshui
# @File    : main.py
# @Description : Relay test example

# ======================================== Import Modules ========================================

# Import time-related modules
import time
# Import the relay module
from relay import RelayController

# ======================================== Global Variables ============================================

# If it is a 'normal' type relay, use GP14
RELAY_TYPE = 'normal'   # 'normal' or 'latching'
RELAY_PIN1 = 14           # Control pin 1
RELAY_PIN2 = 15           # Control pin 2

# Music rhythm definition (unit: ms)
# Each tuple represents (duration, whether to toggle at the end)
MUSIC_NOTES = [
    # Strong rhythm in the intro
    (50, True), (50, False), (50, True), (50, False),  # 4 fast consecutive beats
    (100, True), (100, False),  # Slow down for 2 beats
    (50, True), (50, False), (50, True), (50, False),  # Repeat 4 fast beats

    # Verse section
    (150, True), (50, True), (200, False),  # Strong-light-long pause
    (100, True), (100, True), (100, True), (100, False),  # Three consecutive hits
    (80, True), (80, True), (160, False),  # Double beat + long pause
    (60, True), (60, True), (60, True), (60, True), (120, False),  # Four fast consecutive hits

    # Chorus climax
    (40, True), (40, False), (40, True), (40, False),  # Ultra-fast eighth notes
    (40, True), (40, False), (40, True), (40, False),
    (200, True), (200, False),  # Strong downbeat
    (300, True), (100, True), (200, False),  # Long-short combination

    # Bridge tempo change
    (120, True), (80, True), (120, True), (80, False),
    (200, True), (50, True), (50, True), (200, False),

    # Ending slows down gradually
    (150, True), (150, False),
    (200, True), (200, False),
    (300, True), (300, False)
]
# ======================================== Functions ============================================

# Simple music playback function
def play_relay_music():
    for duration, should_toggle in MUSIC_NOTES:
        # Toggle the relay state
        relay.toggle()
        time.sleep_ms(duration)
        if should_toggle:
            # Toggle back again
            relay.toggle()
            # Add a small interval to prevent toggling too fast
            time.sleep_ms(50)

# ======================================== Custom Classes ============================================

# ======================================== Initialization ==========================================

# Power-on delay of 3 s
time.sleep(3)
# Print debug information
print("FreakStudio: Using GraftPort to control relay")

# Initialize the relay controller
if RELAY_TYPE == 'latching':
    relay = RelayController(RELAY_TYPE, RELAY_PIN1, RELAY_PIN2)
else:
    relay = RelayController(RELAY_TYPE, RELAY_PIN1)

# ========================================  Main Program  ===========================================

# Turn on the relay
relay.on()
print('relay.on')
# Delay 1s
time.sleep(5)
# Turn off the relay
relay.off()
print('relay.off')

Burn the code, open a terminal, and use the mpremote tool to connect to the main controller; the output is as follows:

GraftSense - G6KU-based Latching Relay Module (Open Version)

We can hear that the relays close and release in a certain regular pattern, just like music.

It can be observed that when the relay is closed, the motor starts to rotate; after 5 seconds, the relay opens and the motor stops.

IV. Drivers

relay_driver.zip 11 KB

None.

VI. Revision History

Document Version

Date of Revision

Modifier

Modify Content

v1.0

2025-11-26

Li Zisheng

Initialize the document

The BOM sheet has not been finally checked, the driver has not been re-verified, and the 3.3 application experiment

Not yet specified.

v1.1

2025-12-29

Li Zisheng

Added application experiments and production files

v1.2

2025-12-31

Xin Ruili

Create an open version of the document based on the internal document version v1.1.

v1.3

2026-03-29

Xin Ruili

Modified the application experiment section

VII. Relevant Materials

7.1 Chip Datasheet

C2153173_Magnetic Latching Relay_G6KU-2F-Y-TR+DC5_Datasheet_WJ323416.PDF 1.8 MB

C2802264_Brushed DC Motor Driver Chip_FM116C_Datasheet_WJ68220.PDF 346 KB

7.2 Unique Icons for PCB Silk Screen

GraftSense - G6KU-based Latching Relay Module (Open Version)