Arduino Giga R1 WiFi LED Module

In this guide, we will learn how to use the 10mm LED module with the Arduino Giga R1 WiFi to make a status light that you can switch and dim. In detail, we will learn:

Arduino Giga R1 WiFi and 10mm LED module

The Giga R1 WiFi has dozens of free pins. So once one module works, you can put a red one next to a green one and build a full status panel for your project: "WiFi connected", "sensor error", "pump running", and so on.

Hardware Preparation

1×Arduino Giga R1 WiFi
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×LED Module
1×Jumper Wires
1×Recommended: Screw Terminal Block Shield for Arduino Uno/Mega/Giga
1×Recommended: Sensors/Servo Expansion Shield for Arduino Mega/Giga
1×Recommended: Breadboard Shield for Arduino Mega/Giga
1×Recommended: Enclosure for Arduino Giga
1×Recommended: Power Splitter for Arduino Giga

Or you can buy the following kits:

1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
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

Think of this module as an LED that already has its resistor and its driver soldered on. A 10mm diffused round LED sits on a small 20mm x 20mm black board. Next to it are a 330Ω resistor that limits the LED current, a 1KΩ resistor on the input line, and a tiny transistor that acts as a switch. The LED takes its power from the VCC pin. The IN pin only tells the transistor to open or close.

This is good news for the Giga, because every Giga pin works at 3.3V and can give only a small current. The pin does not have to feed the LED. It only sends a weak control signal, so the LED shines with the same brightness as on a 5V board.

The modules come in a pack of 5 colors: red, yellow, blue, green and white.

LED Module
LED 10mm, diffused, round
Board size 20mm x 20mm
Operating voltage 3.3V to 5V DC
Input logic active HIGH (HIGH = ON, LOW = OFF)
Onboard parts 330Ω LED resistor, 1KΩ input resistor, transistor switch
Brightness control yes, with PWM on the IN pin
Connector 3-pin 2.54mm right-angle male header (presoldered)
Colors in a pack red, yellow, blue, green, white

Pinout

LED module pinout
image source: diyables.io

The header has three pins. They are printed on the board in this order:

  • GND pin: connect to a GND pin of the Arduino Giga R1 WiFi (0V)
  • VCC pin: connect to the 3.3V pin or the 5V pin of the Arduino Giga R1 WiFi
  • IN pin: connect to a digital output pin of the Arduino Giga R1 WiFi. Pick a PWM pin if you want to change the brightness.

How the IN pin acts:

  • IN gets HIGH (3.3V): the transistor turns on, and the LED lights up.
  • IN gets LOW (0V): the transistor turns off, and the LED goes dark.
  • IN gets a PWM signal: the LED turns on and off very fast, and your eye sees a dimmer light.

Why not just use a bare LED? A bare LED has a long leg and a short leg. You must put it in the right way round, and you must add a resistor, or the LED (or the pin) can be damaged. The module removes both jobs: the resistor is already there, and the pins have clear labels.

Wiring Diagram

Only three wires go between the module and the Giga R1 WiFi. You do not need a breadboard, because the module has its own header.

The wiring diagram between Arduino Giga R1 WiFi LED module

This image is created using Fritzing. Click to enlarge image

LED Module Pin Arduino Giga R1 WiFi Pin
GND GND
VCC 3.3V
IN Pin 9 (PWM)

The current-limiting resistor is already on the module, so there's no need to add one. This makes wiring or soldering easier. You can also take VCC from the 5V pin for a little more light. The IN pin is still safe, because it only drives the transistor through the 1KΩ resistor.

How To Program For LED Module

The module needs no library. Two built-in Arduino functions are enough.

  • Choose the Giga pin that goes to the IN pin of the module:
const int LED_MODULE_PIN = 9;
  • Set this pin as an output in setup():
pinMode(LED_MODULE_PIN, OUTPUT);
  • Turn the LED on or off:
digitalWrite(LED_MODULE_PIN, HIGH); // ON digitalWrite(LED_MODULE_PIN, LOW); // OFF
  • Set a brightness from 0 (off) to 255 (full):
analogWrite(LED_MODULE_PIN, 128); // about half brightness

Arduino Giga R1 WiFi Code - LED Module Fade

The second sketch uses PWM. The brightness climbs from 0 to 255 in steps of 15, then falls back to 0. The result is a soft "breathing" light, often used to show that a device is alive but idle.

/* * This Arduino Giga R1 WiFi code was developed by newbiely.com * * This Arduino Giga R1 WiFi code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-giga/arduino-giga-r1-wifi-led-module */ const int LED_MODULE_PIN = 9; // PWM-capable Arduino Giga R1 WiFi pin wired to the IN pin of the LED module const int STEP = 15; // brightness change per step (0-255 scale) void setup() { Serial.begin(9600); pinMode(LED_MODULE_PIN, OUTPUT); analogWrite(LED_MODULE_PIN, 0); // begin with the LED fully off } void showLevel(int level) { analogWrite(LED_MODULE_PIN, level); // the PWM duty cycle sets the brightness Serial.print("Brightness: "); Serial.print(level); Serial.println(" / 255"); } void loop() { // get brighter: 0 -> 255 for (int level = 0; level <= 255; level += STEP) { showLevel(level); delay(60); } // get dimmer: 255 -> 0 for (int level = 255; level >= 0; level -= STEP) { showLevel(level); delay(60); } delay(500); // short rest while the LED is dark }

Detailed Instructions

  • Keep the same wiring. Pin 9 is a PWM pin on the Giga, so the fade works without any change.
  • Paste the new code into the Arduino IDE and click Upload.
  • Open the Serial Monitor at 9600 baud.
  • Watch the LED slowly glow brighter, then slowly fade out, then rest for half a second.
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
Arduino Giga R1
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'Arduino Giga R1' on 'COM15')
New Line
9600 baud
Brightness: 0 / 255 Brightness: 15 / 255 Brightness: 30 / 255 Brightness: 45 / 255 Brightness: 60 / 255 Brightness: 75 / 255 Brightness: 90 / 255 Brightness: 105 / 255 Brightness: 120 / 255 Brightness: 135 / 255 Brightness: 150 / 255 Brightness: 165 / 255 Brightness: 180 / 255 Brightness: 195 / 255 Brightness: 210 / 255 Brightness: 225 / 255 Brightness: 240 / 255 Brightness: 255 / 255 Brightness: 240 / 255 Brightness: 225 / 255
Ln 11, Col 1
Arduino Giga R1 on COM15
2

Want a slower breath? Make the STEP value smaller, or raise delay(60). If the LED looks almost the same at the top levels, that is normal: our eyes notice changes in dim light much more than in bright light.

Next idea: wire a second module in another color to a different PWM pin, and let one show "OK" while the other shows "error". For a ready-made three-color project, see the Arduino Giga R1 WiFi - Traffic Light tutorial. For a plain LED with a resistor, see the Arduino Giga R1 WiFi LED blink tutorial.

Video Tutorial

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!