Arduino UNO R4 - LED Module
In this guide, we will learn how to use a 10mm LED module with the Arduino UNO R4. The module is a ready-made light: three labeled pins, no resistor to pick and no legs to get the wrong way round. In detail, we will learn:
- What is on the LED module board and what its GND, VCC and IN pins do.
- How to connect the LED module to the Arduino UNO R4 WiFi or Minima.
- How to write a program for the Arduino UNO R4 that blinks the LED module once per second.
- How to change the brightness of the LED module with PWM, so it fades in and out smoothly.

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables STEM V4 IoT Starter Kit (Arduino included) | |
| 1 | × | DIYables STEM V4B IoT Starter Kit (Arduino included) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Buy Note: Use the LED Module for easier wiring. It includes an integrated resistor.
Overview of LED Module
The LED module is a small 20mm x 20mm black board with one big 10mm diffused LED on top. The diffused lens spreads the light, so the LED looks like an even glowing dot from any angle, not a sharp point. A pack comes with five colors: red, yellow, blue, green and white.
You can think of it as an LED that already has its helper parts on board. A 330Ω resistor limits the LED current, and a tiny transistor does the switching. The LED takes its power from the VCC pin. The IN pin only tells the transistor to open or close, so the Arduino UNO R4 pin gives almost no current.
This matters on the Arduino UNO R4. Its pins work at 5V, but each pin can give only about 8mA, which is less than the classic Arduino UNO. With a bare LED, the pin must feed the LED by itself. With the module, the pin only sends the signal, so the LED stays bright and the pin stays safe.

The module has a 3-pin header with right-angle pins, already soldered:
- GND pin: connect to GND (0V) of the Arduino UNO R4.
- VCC pin: connect to 5V (3.3V also works).
- IN pin: connect to a digital output pin. HIGH turns the LED on, LOW turns it off. A PWM signal on this pin dims the LED.
| LED Module | |
|---|---|
| LED | 10mm, diffused, round |
| Colors | red, yellow, blue, green, white |
| Operating voltage | 3.3V to 5V DC |
| Control | active HIGH (IN = HIGH means LED ON) |
| Brightness control | yes, with PWM on the IN pin |
| On-board parts | 330Ω LED resistor, 1KΩ input resistor, transistor switch |
| Board size | 20mm x 20mm |
If you used a normal LED before, as in the Arduino UNO R4 - Blink LED tutorial, here are the main changes:
- No 220Ω resistor is needed. The module has its own.
- No polarity to check. You read the pin labels instead of looking for the long leg.
- No breadboard is needed. Three jumper wires are enough.
Wiring Diagram
The module needs only three wires: GND to GND, VCC to the 5V pin, and IN to pin 9. We use pin 9 because it is a PWM pin (marked with ~ on the board), so the same wiring works for the blink code and the fade code.
| LED Module Pin | Arduino UNO R4 Pin |
|---|---|
| GND | GND |
| VCC | 5V |
| IN | 9 |

This image is created using Fritzing. Click to enlarge image
See The best way to supply power to the Arduino Uno R4 and other components.
How To Program For LED Module
No library is needed. Two built-in functions do all the work.
- Set the pin on Arduino UNO R4 that connects to the IN pin of the module:
- Make the pin an output:
- Turn the LED on or off:
- Set a brightness level from 0 (off) to 255 (full):
Arduino UNO R4 Code - Blink LED Module
This first sketch keeps things simple. The LED module is on for 1 second, then off for 1 second, again and again. Each change is also printed to the Serial Monitor, so you can match what you see on the board with what the code does.
Detailed Instructions
Follow these instructions step by step:
- If this is your first time using the Arduino Uno R4 WiFi/Minima, refer to the tutorial on setting up the environment for Arduino Uno R4 WiFi/Minima in the Arduino IDE.
- Wire the LED module to the Arduino UNO R4 according to the provided diagram.
- Connect the Arduino UNO R4 board to your computer using a USB Type-C cable.
- Launch the Arduino IDE on your computer.
- Select the appropriate Arduino UNO R4 board (e.g., Arduino UNO R4 WiFi or Arduino UNO R4 Minima) and COM port.
- Copy the code above and paste it into the Arduino IDE.
- Click the Upload button to send the code to the Arduino UNO R4.
- Look at the module: the 10mm LED lights up for 1 second and goes dark for 1 second.
- Open the Serial Monitor and set the baud rate to 9600.
If the messages appear but the LED stays dark, check the VCC wire first. The IN pin only switches the LED; the light itself comes from VCC.
Arduino UNO R4 Code - Fade LED Module
Now let's control the brightness. The sketch below uses analogWrite() on pin 9. The PWM value climbs from 0 to 255 in steps of 5, then falls back to 0. One full fade-in takes about 1 second, and one fade-out takes about 1 second too. A message is printed only at the two ends, so the Serial Monitor does not fill up.
Detailed Instructions
- Keep the same wiring. The IN pin is already on pin 9, which supports PWM.
- Copy the code above into a new sketch in the Arduino IDE.
- Click the Upload button.
- Watch the LED module: it slowly gets brighter, then slowly gets dimmer, like breathing.
- Check the Serial Monitor:
※ NOTE THAT:
If the LED only turns fully on and off with no smooth fade, the IN wire is on a pin without PWM. Move it to pin 9 (or another pin marked with ~, such as 3, 5, 6, 10 or 11) and change LED_MODULE_PIN to match.
Want to know more about PWM fading, or a fade that does not use delay()? See the Arduino UNO R4 - Fade LED tutorial.
Project Ideas
Here are some ways to put the LED module to work with the Arduino UNO R4:
- A Wi-Fi status light: on the Arduino UNO R4 WiFi, keep a green module on while the board is connected to your router, and blink a red one when the connection is lost.
- A heartbeat light: let a white module fade in and out slowly, so you can see at a glance that your sketch is still running.
- A traffic light model: put a red, a yellow and a green module side by side and switch them in turn.
- A fault alarm: blink a red module fast when a sensor reading goes over a limit.