• Arduino
  • Raspberry Pi
  • Raspberry Pi Pico
  • Micro:Bit

This module is a 5 V relay for switching higher currents. The relay switches the higher voltage when 5 V are applied to the voltage input of the switch.

The output header of the relay has two output terminals:

  • What is marked "NC" for "normally closed" in the figure below means that this passage is shorted by default without electrical switching at the relay.

  • What is marked "NO" for "normally open" in the figure below means that this passage is open or disconnected by default without electrical switching at the relay.

Technical data

Voltage range (AC) 0 V - 240 V AC at 10 A
Voltage range (DC) 0 V - 28 V DC at 10 A
Required switching current ca. 15 - 20 mA
Relay type Changeover switch
Dimensions 53 x 18 x 20 mm

Pin assignment

Warning

Working with voltages higher than 30 V and especially with mains voltage (230 V) can cause physical damage and even be fatal.

We advise that work with higher voltages should only be carried out with the appropriate professional competence.

Code example Arduino

Pin assignment Arduino

Arduino Sensor
Pin 10 signal
5 V +V
GND GND

The program simulates a flashing light - it switches the relay between the two states (or output terminals) in predefined time (delayTime).

int relay = 10; // Declares the pin to which the relay is connected
 
int delayTime = 1; // Value in seconds how long to wait between the switchovers
 
void setup ()
{
  pinMode (relay, OUTPUT); // The pin is declared as output
}
 
// The program simulates a blinker - it switches the relay in predefined 
// time (delayTime) between the two states (or output terminals).
void loop ()
{
  digitalWrite (relay, HIGH); // "NO" is now shorted;
  delay (delayTime * 1000);
  digitalWrite (relay, LOW); // "NC" is now shorted;
  delay (delayTime * 1000);
}

Example program download

KY019-Arduino.zip

This module is a 5 V relay for switching higher currents. The relay switches the higher voltage when 5 V are applied to the voltage input of the switch.

The output header of the relay has two output terminals:

  • What is marked "NC" for "normally closed" in the figure below means that this passage is shorted by default without electrical switching at the relay.

  • What is marked "NO" for "normally open" in the figure below means that this passage is open or disconnected by default without electrical switching at the relay.

Technical data

Voltage range (AC) 0 V - 240 V AC at 10 A
Voltage range (DC) 0 V - 28 V DC at 10 A
Required switching current ca. 15 - 20 mA
Relay type Changeover switch
Dimensions 53 x 18 x 20 mm

Pin assignment

Warning

Working with voltages higher than 30 V and especially with mains voltage (230 V) can cause physical damage and even be fatal.

We advise that work with higher voltages should only be carried out with the appropriate professional competence.

Code example Raspberry Pi

Pin assignment Raspberry Pi

Raspberry Pi Sensor
GPIO 24 [Pin 18] Signal
5 V [Pin 2] +V
GND [Pin 6] GND

The program simulates a flashing light - it switches the relay between the two states (or output terminals) in predefined time (delayTime).

# Required modules are imported and set up
import RPi.GPIO as GPIO
import time
 
GPIO.setmode(GPIO.BCM)
# here the pause (in seconds) between switching is declared
delayTime = 1
 
# Here the input pin is declared to which the sensor is connected. Additionally the PullUP resistor at the input is activated
RELAY_PIN = 24
GPIO.setup(RELAIS_PIN, GPIO.OUT)
GPIO.output(RELAIS_PIN, False)
 
print ("Sensor test [press CTRL+C to exit test]")
 
 
# main program loop
try:
    While True:
        GPIO.output(RELAIS_PIN, True) # NO is shorted now
        time.sleep(delayTime)
        GPIO.output(RELAIS_PIN, False) # NC is shorted now
        time.sleep(delayTime)
 
# clean up after the program is finished
except KeyboardInterrupt:
    GPIO.cleanup()

Sample program download

KY019-RPi.zip

To start with the command:

sudo python3 KY019-RPi.py

This module is a 5 V relay for switching higher currents. The relay switches the higher voltage when 5 V are applied to the voltage input of the switch.

The output header of the relay has two output terminals:

  • What is marked "NC" for "normally closed" in the figure below means that this passage is shorted by default without electrical switching at the relay.

  • What is marked "NO" for "normally open" in the figure below means that this passage is open or disconnected by default without electrical switching at the relay.

Technical data

Voltage range (AC) 0 V - 240 V AC at 10 A
Voltage range (DC) 0 V - 28 V DC at 10 A
Required switching current ca. 15 - 20 mA
Relay type Changeover switch
Dimensions 53 x 18 x 20 mm

Pin assignment

Warning

Working with voltages higher than 30 V and especially with mains voltage (230 V) can cause physical damage and even be fatal.

We advise that work with higher voltages should only be carried out with the appropriate professional competence.

Code example Micro:Bit

Pinout Micro:Bit:

Micro:Bit Sensor
Pin 1 Signal
3 V +V
GND GND

Sample program download

microbit-KY-019.zip

This module is a 5 V relay for switching higher currents. The relay switches the higher voltage when 5 V are applied to the voltage input of the switch.

The output header of the relay has two output terminals:

  • What is marked "NC" for "normally closed" in the figure below means that this passage is shorted by default without electrical switching at the relay.

  • What is marked "NO" for "normally open" in the figure below means that this passage is open or disconnected by default without electrical switching at the relay.

Technical data

Voltage range (AC) 0 V - 240 V AC at 10 A
Voltage range (DC) 0 V - 28 V DC at 10 A
Required switching current approx. 15 - 20 mA
Relay type Changeover switch
Dimensions 53 x 18 x 20 mm

Pin assignment

Warning

Working with voltages higher than 30 V and especially with mains voltage (230 V) can cause physical damage and even be fatal.

We advise that work with higher voltages should only be carried out with the appropriate professional competence.

Code example Raspberry Pi Pico

Pin assignment Raspberry Pi Pico

Raspberry Pi Pico Sensor
GPIO18 Signal
External 5V +V
GND + [External GND] GND

The program switches the relay between the two states (or output terminals) in predefined time.

# Load libraries
from machine import Pin
from utime import sleep

# Initialization of GPIO18 as output
device = Pin(18, Pin.OUT, value=0)

# Switch on relay
print('On')
device.on()

# Wait 3 seconds
print('.')
sleep(1)
print('.')
sleep(1)
print('.')
sleep(1)

# Switch off relay
print('Off')
device.off()

# You should hear some sort of click when the relay switches.

Example program download

KY019-Pico.zip