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

How to Program White LED Module on Kidsuno

By r November 13th, 2025 178 views

White LED Module

1top

KD2078

LED (Light-Emitting Diode)

LED is a commonly used light emitting device that converts electrical energy into light energy. Usually, it is used as an indicator in circuits and instruments, or as part of texts or numeric display.

It generally includes gallium(Ga), arsenic(As), phosphorus(P), nitrogen(N) and so on.

LED components

Emitting light colors

gallium arsenide diode

red

gallium phosphide diode

green

silicon carbide diode

yellow

gallium nitride diode

blue

1bottom

Parameters

2topOperating voltage: DC 3.3 ~ 5 V

Operating current: 1.5 mA (Peak: 2.3mA)

Maximum power: 0.07 W

Control signal: digital signal

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

Positioning holes: diameter of 4.8 mm

Interface: telephone socket

2bottom

Principle

3top

Modules with blue housing are digital ones, so we should connect to digital io pins of the mainboard (ports with blue).

3112

In this experiment, we connect the white LED module to port 1. According to the board ports view, the digital io pin at port 1 is digital pin D5.

When we set the pin to high(1), the LED lights up in white; if we set to low(0), it will be off.

3bottom

Wiring Diagram

3101

Test Code

3102

Click 3209 to connect to COM port and then 2210.

Explanation

5top

Code Blocks

Blocks

Code block

Events

begin

P

setmode

P

setout

Control

forever

Control

wait

line5

Conceive

1. Initialization

Set pin mode.

3103

Build blocks:

① Drag begin and setmode to the editing area.

② Click the triangle to choose pin 5.

3105

③ Modify the mode into output .

Three pin mode:

  • input

  • output

  • input-pullup

6top

Q :Why output?

A :The code is written for the mainboard. For the board, pin D5 is outputting power levels (high or low) to the connected module.

6bottom

line3

2. Main Code

Loop: LED lights on for 1s and goes off for 1s, in a loop.

3104

Build blocks:

① Drag forever.This is a loop code, in which codes will run forever.

② Drag setout into “forever”.

There are two power level to output:

  • high

  • low

Choose pin to 5 and output high.

③ Drag wait into “forever”. This is a delay code.

6top

Q :Why delay 1s?

A :If you output a high level to LED, it will be always on. Yet, we add a delay of 1s, so it lights up for only 1s. Delay time is the ON/OFF time of LED.

6bottom

Pin outputs high for 1s:

3106

④ Right-click the code and choose “Duplicate”.

3107

As follows:

3108

Set the output to low. Pin 5 outputs low for 1s.

3109

LED will lights on for 1s and goes off for 1s, in a loop.

5bottom

Test Result

4top

After uploading code, the LED module will flash with an interval of 1s (on for 1s and off for 1s).

3110

4bottom

Comprehension! HOW to Monitor Smart Home Environment with ESP32
Previous
Comprehension! HOW to Monitor Smart Home Environment with ESP32
Read More
How to Program Relay Module on Kidsuno
Next
How to Program Relay Module on Kidsuno
Read More
Message Us