Arduino UNO Q - LED Strip

Learn how to control 12V LED strips with the Arduino UNO Q. Because LED strips run on 12V DC, they cannot be connected directly to Arduino pins — relay modules bridge the gap. This tutorial covers both single-color and RGB LED strips, Bridge mode for software color control, and Telegram remote commands.

In this tutorial, you will learn:

Arduino UNO Q Controls LED Strip

※ NOTE THAT:

This tutorial covers Non-Addressable LED Strips (all LEDs change together). For individually addressable LED strips, see the NeoPixel and WS2812B tutorials.

Hardware Preparation

1×Arduino UNO Q
1×USB Cable for Arduino Uno Q
1×Relay
1×12V 1-color LED Strip
1×12V RGB LED Strip
1×12V Power Adapter
1×DC Power Jack
1×Jumper Wires
1×Recommended: Screw Terminal Block Shield for Arduino Uno
1×Recommended: Sensors/Servo Expansion Shield for Arduino Uno
1×Recommended: Breadboard Shield for Arduino Uno
1×Recommended: Enclosure for Arduino Uno
1×Recommended: Prototyping Base Plate & Breadboard Kit for Arduino UNO

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 .

Overview of Non-Addressable LED Strips

A Non-Addressable LED strip changes all LEDs simultaneously — you cannot control individual LEDs. These are available in two types:

  • Single-color strip: One color, two pins (12V+ and GND). Turn it on or off with a relay.
  • RGB strip: Three color channels (Red, Green, Blue), four pins (12V+, R, G, B). Each channel is controlled by a separate relay.
Non-Addressable LED Strip Pinout

The LED strips run on 12V DC. The Arduino UNO Q MCU cannot switch 12V directly — relay modules are used to switch 12V power using 3.3V logic signals from the MCU.

For individually addressable LED strips (WS2812B/NeoPixel), refer to the dedicated tutorials.

Single-Color LED Strip

Wiring Diagram

The wiring diagram between Arduino UNO Q 12V LED Strip

This image is created using Fritzing. Click to enlarge image

Connection Details
Arduino UNO Q MCU D3 Relay IN pin
Relay COM 12V power supply positive
Relay NO LED strip 12V+ pin
LED strip GND pin 12V power supply negative

Arduino UNO Q Code

The Arduino UNO Q has two processors working together:

  • The STM32 MCU toggles the relay pin to turn the LED strip on and off every 5 seconds
  • The Qualcomm MPU runs Debian Linux with Wi-Fi — in this section, only the MCU is programmed. A later section shows how both processors work together via Bridge.
/* * This Arduino UNO Q code was developed by newbiely.com * * This Arduino UNO Q code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip */ // COPYRIGHT newbiely.com // AUTHOR: newbiely // This code is made available for public use without restriction. // For complete instructions, tutorials, and further information, visit: // https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip // Controls a 12V single-color LED strip via a relay // Relay HIGH = LED strip ON, LOW = LED strip OFF #define RELAY_PIN 3 // The Arduino UNO Q MCU pin connected to the relay for the LED strip void setup() { Serial.begin(9600); pinMode(RELAY_PIN, OUTPUT); digitalWrite(RELAY_PIN, LOW); // ensure strip is off on startup } void loop() { Serial.println("The LED strip is turned on"); digitalWrite(RELAY_PIN, HIGH); delay(5000); Serial.println("The LED strip is turned off"); digitalWrite(RELAY_PIN, LOW); delay(5000); }

Detailed Instructions

First time with Arduino UNO Q? Follow the Getting Started with Arduino UNO Q tutorial before proceeding.

  • Connect: Wire the single-color LED strip to the Arduino UNO Q MCU via the relay as shown in the wiring diagram.
  • Open Arduino App Lab: Launch Arduino App Lab and wait until it detects your Arduino UNO Q.
  • Create a new App: Click the Create New App button.
Create New App in Arduino App Lab on Arduino UNO Q
  • Give the App a name, for example: LedStrip
  • Click Create to confirm.
Arduino App Lab App folders and files on Arduino UNO Q
  • Paste the sketch: Copy the MCU code above and paste it into sketch/sketch.ino.
  • Upload: Click the Run button in Arduino App Lab.
Click Run button in Arduino App Lab on Arduino UNO Q
  • Observe the LED strip turning on and off every 5 seconds.

App Lab Console Output

DIYables_Apps
Stop
sketch.ino
1#include "Arduino_RouterBridge.h"
Serial Monitor
Python
Message (Enter to send a message to "Newbiely" on usb(2820070321))
New Line
9600 baud
[2026-04-29 09:00:01] The LED strip is turned on [2026-04-29 09:00:06] The LED strip is turned off [2026-04-29 09:00:11] The LED strip is turned on

RGB LED Strip

Wiring Diagram

The wiring diagram between Arduino UNO Q 12V RGB LED Strip

This image is created using Fritzing. Click to enlarge image

Connection Details
Arduino UNO Q MCU D6 Relay 1 IN (RED channel)
Arduino UNO Q MCU D7 Relay 2 IN (GREEN channel)
Arduino UNO Q MCU D5 Relay 3 IN (BLUE channel)
Each Relay COM 12V power supply positive
Each Relay NO Corresponding R/G/B pin on LED strip
LED strip 12V+ pin 12V power supply positive
LED strip GND 12V power supply negative

Arduino UNO Q Code — RGB Color Cycling

/* * This Arduino UNO Q code was developed by newbiely.com * * This Arduino UNO Q code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip */ // COPYRIGHT newbiely.com // AUTHOR: newbiely // This code is made available for public use without restriction. // For complete instructions, tutorials, and further information, visit: // https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip // Controls a 12V RGB LED strip via 3 relays (one per color channel) // HIGH = color channel ON, LOW = color channel OFF #define RED_PIN 6 // The Arduino UNO Q MCU pin connected to the relay for the RED channel #define GREEN_PIN 7 // The Arduino UNO Q MCU pin connected to the relay for the GREEN channel #define BLUE_PIN 5 // The Arduino UNO Q MCU pin connected to the relay for the BLUE channel void setColor(bool r, bool g, bool b) { digitalWrite(RED_PIN, r ? HIGH : LOW); digitalWrite(GREEN_PIN, g ? HIGH : LOW); digitalWrite(BLUE_PIN, b ? HIGH : LOW); } void setup() { Serial.begin(9600); pinMode(RED_PIN, OUTPUT); pinMode(GREEN_PIN, OUTPUT); pinMode(BLUE_PIN, OUTPUT); setColor(false, false, false); // all off on startup } void loop() { Serial.println("Red"); setColor(true, false, false); delay(2000); Serial.println("Green"); setColor(false, true, false); delay(2000); Serial.println("Blue"); setColor(false, false, true); delay(2000); Serial.println("Yellow"); setColor(true, true, false); delay(2000); Serial.println("Magenta"); setColor(true, false, true); delay(2000); Serial.println("Cyan"); setColor(false, true, true); delay(2000); Serial.println("White"); setColor(true, true, true); delay(2000); Serial.println("Off"); setColor(false, false, false); delay(2000); }

App Lab Console Output

DIYables_Apps
Stop
sketch.ino
1#include "Arduino_RouterBridge.h"
Serial Monitor
Python
Message (Enter to send a message to "Newbiely" on usb(2820070321))
New Line
9600 baud
[2026-04-29 09:00:01] Red [2026-04-29 09:00:03] Green [2026-04-29 09:00:05] Blue [2026-04-29 09:00:07] Yellow [2026-04-29 09:00:09] Magenta [2026-04-29 09:00:11] Cyan [2026-04-29 09:00:13] White [2026-04-29 09:00:15] Off

Bridge: Linux + MCU

This section shows how to use both processors of the Arduino UNO Q to control the RGB LED strip color from the Linux side via Bridge:

  • The 3 relays are controlled by the MCU — the MCU exposes a set_color() function via Bridge
  • The MPU cannot control the relay pins directly — it calls Bridge to change the LED strip color
  • The MPU has Wi-Fi — running full Debian Linux, it can accept Telegram color commands and instantly update the LED strip
  • Arduino_RouterBridge enables RPC communication between the two processors
  • ⚠️ /dev/ttyHS1 (Linux) and Serial1 (MCU) are RESERVED by the router — never open them in user code

MCU Code (Bridge)

/* * This Arduino UNO Q code was developed by newbiely.com * * This Arduino UNO Q code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip */ // COPYRIGHT newbiely.com // AUTHOR: newbiely // This code is made available for public use without restriction. // For complete instructions, tutorials, and further information, visit: // https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip #include "Arduino_RouterBridge.h" #define RED_PIN 6 // The Arduino UNO Q MCU pin connected to the relay for the RED channel #define GREEN_PIN 7 // The Arduino UNO Q MCU pin connected to the relay for the GREEN channel #define BLUE_PIN 5 // The Arduino UNO Q MCU pin connected to the relay for the BLUE channel String current_color = "off"; void applyColor(bool r, bool g, bool b) { digitalWrite(RED_PIN, r ? HIGH : LOW); digitalWrite(GREEN_PIN, g ? HIGH : LOW); digitalWrite(BLUE_PIN, b ? HIGH : LOW); } String set_color(String color) { color.toLowerCase(); color.trim(); if (color == "red") { applyColor(true, false, false); current_color = "red"; } else if (color == "green") { applyColor(false, true, false); current_color = "green"; } else if (color == "blue") { applyColor(false, false, true); current_color = "blue"; } else if (color == "yellow") { applyColor(true, true, false); current_color = "yellow"; } else if (color == "magenta") { applyColor(true, false, true); current_color = "magenta"; } else if (color == "cyan") { applyColor(false, true, true); current_color = "cyan"; } else if (color == "white") { applyColor(true, true, true); current_color = "white"; } else if (color == "off") { applyColor(false, false, false); current_color = "off"; } else { return "unknown color: " + color; } Monitor.println("Color set to: " + current_color); return "ok:" + current_color; } String get_state(String arg) { return current_color; } void setup() { Bridge.begin(); Monitor.begin(); pinMode(RED_PIN, OUTPUT); pinMode(GREEN_PIN, OUTPUT); pinMode(BLUE_PIN, OUTPUT); applyColor(false, false, false); Bridge.provide_safe("set_color", set_color); Bridge.provide("get_state", get_state); Monitor.println("Arduino UNO Q RGB LED Strip Bridge ready"); } void loop() {}

Python Code (Bridge)

/* * This Arduino UNO Q code was developed by newbiely.com * * This Arduino UNO Q code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip */ # COPYRIGHT newbiely.com # AUTHOR: newbiely # This code is made available for public use without restriction. # For complete instructions, tutorials, and further information, visit: # https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip from arduino.app_utils import * import time COLORS = ["red", "green", "blue", "yellow", "magenta", "cyan", "white", "off"] def loop(): for color in COLORS: result = Bridge.call("set_color", color) state = Bridge.call("get_state") print(f"Set color: {color} → result: {result} state: {state}") time.sleep(2) App.run(user_loop=loop)

Detailed Instructions

  • Connect: Wire the RGB LED strip to the Arduino UNO Q via 3 relays as shown in the RGB wiring diagram.
  • Open Arduino App Lab and create a new App named LedStripBridge.
  • Paste the MCU sketch into sketch/sketch.ino.
  • Paste the Python code into the Python file.
  • Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.
Add sketch library in Arduino App Lab on Arduino UNO Q
  • Search for Arduino_RouterBridge created by Arduino and click the Install button.
My Apps / DIYables Apps
Run
Bricks
No bricks added...
Sketch Libraries
No sketch libra...
Files
python
sketch
.gitignore
README.md
app.yaml
sketch.ino
Add sketch library
Arduino_RouterBridge Arduino

This library provides a simple RPC bridge for Arduino UNO Q boards, allowing communication between the board and other devices using MsgPack serialization.

0.4.1
Install
More Info
  • Upload: Click the Run button. Observe the LED strip cycling through all colors.
Click Run button in Arduino App Lab on Arduino UNO Q

App Lab Console Output

DIYables_Apps
Stop
sketch.ino
1#include "Arduino_RouterBridge.h"
Serial Monitor
Python
Message (Enter to send a message to "Newbiely" on usb(2820070321))
New Line
9600 baud
[2026-04-29 09:00:01] Arduino UNO Q RGB LED Strip Bridge ready [2026-04-29 09:00:02] Color set to: red [2026-04-29 09:00:04] Color set to: green [2026-04-29 09:00:06] Color set to: blue
DIYables_Apps
Stop
sketch.ino
1#include "Arduino_RouterBridge.h"
Serial Monitor
Python
[2026-04-29 09:00:02] Set color: red → result: ok:red state: red [2026-04-29 09:00:04] Set color: green → result: ok:green state: green [2026-04-29 09:00:06] Set color: blue → result: ok:blue state: blue [2026-04-29 09:00:08] Set color: yellow → result: ok:yellow state: yellow [2026-04-29 09:00:10] Set color: magenta → result: ok:magenta state: magenta [2026-04-29 09:00:12] Set color: cyan → result: ok:cyan state: cyan [2026-04-29 09:00:14] Set color: white → result: ok:white state: white [2026-04-29 09:00:16] Set color: off → result: ok:off state: off

Telegram

Control the RGB LED strip color remotely from Telegram — send /color red, /color blue, or any supported color name to instantly change the LED strip color on your Arduino UNO Q.

MCU sketch: Keep the same MCU sketch from the previous Bridge section.

Python Code (Telegram)

/* * This Arduino UNO Q code was developed by newbiely.com * * This Arduino UNO Q code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip */ # COPYRIGHT newbiely.com # AUTHOR: newbiely # This code is made available for public use without restriction. # For complete instructions, tutorials, and further information, visit: # https://newbiely.com/tutorials/arduino-uno-q/arduino-uno-q-led-strip from arduino.app_utils import * import requests import time TELEGRAM_BOT_TOKEN = "YOUR_TELEGRAM_BOT_TOKEN" CHAT_ID = "YOUR_CHAT_ID" last_update_id = 0 COLORS = ["red", "green", "blue", "yellow", "magenta", "cyan", "white", "off"] def get_updates(): global last_update_id url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/getUpdates" params = {"offset": last_update_id + 1, "timeout": 5} try: response = requests.get(url, params=params, timeout=10) data = response.json() if data["ok"]: return data["result"] except Exception as e: print(f"Error getting updates: {e}") return [] def send_message(chat_id, text): url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage" payload = {"chat_id": chat_id, "text": text} try: requests.post(url, data=payload, timeout=10) except Exception as e: print(f"Error sending message: {e}") def loop(): updates = get_updates() for update in updates: last_update_id = update["update_id"] if "message" not in update: continue message = update["message"] chat_id = message["chat"]["id"] text = message.get("text", "").strip() print(f"Received: {text}") if text == "/start": send_message(chat_id, "Arduino UNO Q RGB LED Strip Bot\n" "/color <name> - Set color (red, green, blue, yellow, magenta, cyan, white, off)\n" "/state - Current LED strip color\n" "Example: /color red") elif text.startswith("/color"): parts = text.split() if len(parts) < 2: send_message(chat_id, "Usage: /color <name>\nColors: " + ", ".join(COLORS)) else: color = parts[1].lower() if color not in COLORS: send_message(chat_id, f"Unknown color: {color}\nAvailable: " + ", ".join(COLORS)) else: result = Bridge.call("set_color", color) state = Bridge.call("get_state") send_message(chat_id, f"💡 LED strip color set to: {state}") elif text == "/state": state = Bridge.call("get_state") send_message(chat_id, f"Current LED strip color: {state}") else: send_message(chat_id, "Unknown command. Send /start for help.") time.sleep(0.3) App.run(user_loop=loop)

Detailed Instructions

  • Replace YOUR_TELEGRAM_BOT_TOKEN with your actual bot token from BotFather.
  • Replace YOUR_CHAT_ID with your Telegram chat ID.
  • Paste this Python code into your App's Python file (keep the same MCU sketch).
  • Click the Run button — send /color red in Telegram to change the LED strip color.

App Lab Console Output

DIYables_Apps
Stop
sketch.ino
1#include "Arduino_RouterBridge.h"
Serial Monitor
Python
[2026-04-29 09:10:01] Waiting for Telegram messages... [2026-04-29 09:10:05] Received: /color red [2026-04-29 09:10:08] Received: /color cyan [2026-04-29 09:10:12] Received: /state [2026-04-29 09:10:15] Received: /color off
Telegram
Telegram 12:45
Welcome to Telegram!
ArduinoBot 10:19
Chatting with Arduino...
telegram-botfather
BotFather Yesterday
Your bot has been created.

ArduinoBot

bot
Today
/color red
10:15 AM ✓✓
💡 LED strip color set to: red
10:16 AM
/color cyan
10:17 AM ✓✓
💡 LED strip color set to: cyan
10:18 AM
/state
10:19 AM ✓✓
Current LED strip color: cyan
10:20 AM
/color off
10:21 AM ✓✓
💡 LED strip color set to: off
10:22 AM

OpenClaw

...OPENCLAW

OpenClaw support for Arduino UNO Q LED Strip is coming soon.

...OPENCLAW

Project Ideas

You can build many useful projects with the LED strip and Arduino UNO Q:

  • Telegram Mood Lighting: Control your room's RGB LED strip color from Telegram at any time — send /color blue for a cool evening atmosphere or /color white for work mode
  • Notification Light: Combine with the gas sensor tutorial — when gas is detected, Python sets the LED strip to red (alert) via Bridge; when cleared, it returns to white (normal)
  • Schedule-Based Lighting: Use Python's time module to automatically change LED strip colors based on time of day — warm white in the evening, cool white in the morning — without any Telegram input
  • Music-Reactive Lighting: Combine with the sound sensor — when the sound sensor detects a beat, Python cycles through colors rapidly for a music-reactive light effect
  • Status Indicator Panel: Use the LED strip as a status indicator for a server room or tutorial — green = all systems normal, yellow = warning, red = critical alert — controlled by Bridge from any monitoring script

Challenge Yourself

Ready to go further with the LED strip on Arduino UNO Q? Try these challenges:

  • Easy: Add a /blink <color> <count> Telegram command that blinks the LED strip in the selected color a specified number of times, with 500 ms on and 500 ms off per blink.
  • Medium: Implement a smooth color-cycling mode: when /mode cycle is sent via Telegram, Python enters a loop that cycles through all 7 colors with a 3-second pause, and /mode stop breaks out of the cycle and turns off the strip.
  • Advanced: Build a sunrise alarm: at a user-defined time (set via a /alarm HH:MM Telegram command), Python slowly transitions the LED strip from off → red → yellow → white over 10 minutes, simulating a natural sunrise wake-up experience.

※ 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!