X
Home > Blog > STEM for Arduino > How to Program Relay Module on Kidsuno

How to Program Relay Module on Kidsuno

By r November 17th, 2025 344 views

3V Relay Module

1top

KD2089

Relay module is seen as an automatic switch which controls large current via small one. In circuits, it plays the role of automatic regulator, safety protector and converter.

1bottom

Parameters

2top

Driving voltage: DC 3.3 ~ 5V

Driving current: 75 mA(5V) ~ 125 mA(3.3V)

Contact capacity: 250 VAC/3A, 30 VDC/3A

Rated power dissipation: 0.15 W

Input signal: digital signal

Shock current: less than 3 A

Operating temperature: -10°C ~ +50°C

Control signal: digital signal

Dimensions: 24 x 48 x 18 mm (without housing)

Positioning hole: diameter of 4.8 mm

Interface: telephone socket

2bottom

Principle

3top

Internal structure:

3203

The coil inside the relay is wound around the iron core to form an electromagnet, which generates electromagnetic force after powering on.

A relay usually contains a moving contact and two static contacts.

3201

When there is no current in the coil, the electromagnet is not magnetic and is not attractive to the armature, so the moving contact B is in contact with the static contact A. Therefore, A now becomes the normally closed contact (NC). And the moving contact B is also called the common contact (COM).

NC (normally-close): The coil is closed without power.

3202

When a current flows through the coil, the electromagnet is magnetic so that it will attract the armature. At this time, B and the static contact C will be connected. Static contact C is called normally open contact (NO).

NO (normal open): The coil is opened without power.

3201

The 3V relay module is also a digital device so it need to be connected to digital io pins of the board.

In this experiment, we connect the module to port 2, which is pin D6. When we set the pin to high(1), the relay will work; if we set it to low(0), the relay will out of work.

3bottom

Wiring Diagram

3204

Test Code

3205

Click 3209 to connect to COM port and click 2210.

Explanation

5top

Code Blocks

Blocks

Code block

Events

begin

P

setmode

P

setout

Control

forever

Control

wait

line5

Conceive:

Code framework in this section is same as the last one.

  1. Initialization

    Set pin mode.

    3206

line3

  1. Main Code

    Loop: pin D6 outputs high for 1s to the relay module so then the module is conducted. Immediately, the pin outputs low for 1s to the relay and it turns off.

    3207

5bottom

Test Result

4top

After uploading code, the relay will work and stop working with an interval of 1s.

When the relay is conducted, B and C is connected and you will hear a tick-tack, and the red LED on the module will light up. When the relay is opened, A and B is connected with also a tick-tack, and the on-board LED goes off.

3208

4bottom

How to Program White LED Module on Kidsuno
Previous
How to Program White LED Module on Kidsuno
Read More
Message Us