아두이노 우노 Q LED 스트립

Arduino UNO Q로 12V LED 스트립을 제어하는 방법을 배우세요. LED 스트립은 12V DC에서 작동하므로 Arduino 핀에 직접 연결할 수 없습니다 — 릴레이 모듈이 중간 역할을 합니다. 이 튜토리얼은 단색 및 RGB LED 스트립, Bridge 모드로 소프트웨어 색상 제어, Telegram 원격 명령을 다룹니다.

이 튜토리얼에서 배울 내용:

Arduino UNO Q controls LED strip

※ 주의:

이 튜토리얼은 논 어드레서블 LED 스트립(모든 LED가 함께 변합니다)을 다룹니다. 개별 어드레싱 가능한 LED 스트립은 NeoPixel 및 WS2812B 튜토리얼을 참조하세요.

필요한 하드웨어

1×Arduino UNO Q 아마존
1×USB Cable for Arduino Uno Q 아마존
1×릴레이 아마존
1×12V 1-color LED 스트립 아마존
1×12V RGB LED 스트립 아마존
1×12V 전원 어댑터 아마존
1×DC 커넥터 전원 연결 잭 플러그 소켓 쿠팡 | 아마존
1×점퍼케이블 쿠팡 | 아마존
1×(추천) 아두이노 우노용 스크루 터미널 블록 쉴드 쿠팡 | 아마존
1×(추천) Sensors/Servo Expansion Shield for Arduino Uno 쿠팡 | 아마존
1×(추천) 아두이노 우노용 브레드보드 쉴드 쿠팡 | 아마존
1×(추천) 아두이노 우노용 케이스 쿠팡 | 아마존
1×(추천) 아두이노 우노용 프로토타이핑 베이스 플레이트 & 브레드보드 키트 아마존
공개: 이 포스팅 에 제공된 일부 링크는 아마존 제휴 링크입니다. 이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.

논 어드레서블 LED 스트립 정보

논 어드레서블 LED 스트립은 모든 LED를 동시에 변경합니다 — 개별 LED를 제어할 수 없습니다. 이는 두 가지 유형으로 사용 가능합니다:

  • 단색 스트립: 한 가지 색상, 2개 핀 (12V+ 및 GND). 릴레이로 켜거나 끌 수 있습니다.
  • RGB 스트립: 3개 색상 채널 (빨강, 초록, 파랑), 4개 핀 (12V+, R, G, B). 각 채널은 별도의 릴레이로 제어됩니다.
non-addressaBLE LED strip 사용법 핀아웃

LED 스트립은 12V DC에서 작동합니다. Arduino UNO Q MCU는 12V를 직접 전환할 수 없습니다 — 릴레이 모듈이 MCU의 3.3V 논리 신호를 사용하여 12V 전원을 전환합니다.

개별 어드레싱 가능한 LED 스트립 (WS2812B/NeoPixel)의 경우 전용 튜토리얼을 참조하세요.

단색 LED 스트립

배선 다이어그램

Arduino UNO Q 12v LED strip 연결 배선도

이 이미지는 Fritzing을 사용하여 만들어졌습니다. 이미지를 확대하려면 클릭하세요.

연결 상세정보
Arduino UNO Q MCU D3 Relay IN 핀
Relay COM 12V 전원 양극
Relay NO LED 스트립 12V+ 핀
LED 스트립 GND 12V 전원 음극

Arduino UNO Q 코드

Arduino UNO Q에는 함께 작동하는 두 개의 프로세서가 있습니다:

  • STM32 MCU는 릴레이 핀을 토글하여 LED 스트립을 5초마다 켜고 끕니다
  • Qualcomm MPU는 Wi-Fi가 포함된 Debian Linux를 실행합니다 — 이 섹션에서는 MCU만 프로그래밍됩니다. 이후 섹션에서는 Bridge를 통해 두 프로세서가 함께 작동하는 방법을 보여줍니다.
/* * 이 Arduino UNO Q 코드는 newbiely.kr 에서 개발되었습니다 * 이 Arduino UNO Q 코드는 어떠한 제한 없이 공개 사용을 위해 제공됩니다. * 상세한 지침 및 연결도에 대해서는 다음을 방문하세요: * https://newbiely.kr/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); }

빠른 단계

Arduino UNO Q 처음 사용? 진행하기 전에 아두이노 우노 Q 시작하기 튜토리얼을 따르세요.

  • 연결: 배선 다이어그램에 표시된 대로 릴레이를 통해 단색 LED 스트립을 Arduino UNO Q MCU에 연결합니다.
  • Arduino App Lab 열기: Arduino App Lab을 시작하고 Arduino UNO Q를 감지할 때까지 기다립니다.
  • 새 앱 만들기: Create New App 버튼을 클릭합니다.
create new app in 아두이노 app lab on Arduino UNO Q
  • 앱에 이름을 지정합니다. 예: LedStrip
  • Create를 클릭하여 확인합니다.
아두이노 app lab app folders and files on Arduino UNO Q
  • 스케치 붙여넣기: 위의 MCU 코드를 복사하고 sketch/sketch.ino에 붙여넣습니다.
  • 업로드: Arduino App Lab에서 Run 버튼을 클릭합니다.
click run 버튼 in 아두이노 app lab on Arduino UNO Q
  • LED 스트립이 5초마다 켜지고 꺼지는 것을 관찰합니다.

App Lab 콘솔 출력

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 스트립

배선 다이어그램

Arduino UNO Q 12v rgb LED strip 연결 배선도

이 이미지는 Fritzing을 사용하여 만들어졌습니다. 이미지를 확대하려면 클릭하세요.

연결 상세정보
Arduino UNO Q MCU D6 Relay 1 IN (RED 채널)
Arduino UNO Q MCU D7 Relay 2 IN (GREEN 채널)
Arduino UNO Q MCU D5 Relay 3 IN (BLUE 채널)
각 Relay COM 12V 전원 양극
각 Relay NO LED 스트립의 해당 R/G/B 핀
LED 스트립 12V+ 핀 12V 전원 양극
LED 스트립 GND 12V 전원 음극

Arduino UNO Q 코드 — RGB 색상 사이클

/* * 이 Arduino UNO Q 코드는 newbiely.kr 에서 개발되었습니다 * 이 Arduino UNO Q 코드는 어떠한 제한 없이 공개 사용을 위해 제공됩니다. * 상세한 지침 및 연결도에 대해서는 다음을 방문하세요: * https://newbiely.kr/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 콘솔 출력

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

이 섹션에서는 Bridge를 통해 Linux 측에서 Arduino UNO Q의 두 프로세서를 사용하여 RGB LED 스트립 색상을 제어하는 방법을 보여줍니다:

  • 3개 릴레이는 MCU로 제어됩니다 — MCU는 Bridge를 통해 set_color() 함수를 노출합니다
  • MPU는 릴레이 핀을 직접 제어할 수 없습니다 — LED 스트립 색상을 변경하도록 Bridge를 호출합니다
  • MPU는 Wi-Fi가 있습니다 — 전체 Debian Linux를 실행하면서 Telegram 색상 명령을 수락하고 즉시 LED 스트립을 업데이트할 수 있습니다
  • Arduino_RouterBridgeRPC 통신을 두 프로세서 간에 활성화합니다
  • ⚠️ /dev/ttyHS1 (Linux) 및 Serial1 (MCU)은 라우터에서 예약됨 — 사용자 코드에서 이를 열지 마세요

MCU 코드 (Bridge)

/* * 이 Arduino UNO Q 코드는 newbiely.kr 에서 개발되었습니다 * 이 Arduino UNO Q 코드는 어떠한 제한 없이 공개 사용을 위해 제공됩니다. * 상세한 지침 및 연결도에 대해서는 다음을 방문하세요: * https://newbiely.kr/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 코드 (Bridge)

/* * 이 Arduino UNO Q 코드는 newbiely.kr 에서 개발되었습니다 * 이 Arduino UNO Q 코드는 어떠한 제한 없이 공개 사용을 위해 제공됩니다. * 상세한 지침 및 연결도에 대해서는 다음을 방문하세요: * https://newbiely.kr/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)

빠른 단계

  • 연결: RGB 배선 다이어그램에 표시된 대로 3개의 릴레이를 통해 RGB LED 스트립을 Arduino UNO Q에 연결합니다.
  • Arduino App Lab 열기하고 LedStripBridge라는 새 앱을 만듭니다.
  • MCU 스케치를 붙여넣기 sketch/sketch.ino에 붙여넣습니다.
  • Python 코드를 붙여넣기 Python 파일에 붙여넣습니다.
  • Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.
add sketch 라이브러리 in 아두이노 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
  • 업로드: Run 버튼을 클릭합니다. LED 스트립이 모든 색상을 순환하는 것을 관찰합니다.
click run 버튼 in 아두이노 app lab on Arduino UNO Q

App Lab 콘솔 출력

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

Telegram에서 RGB LED 스트립 색상을 원격으로 제어합니다 — Arduino UNO Q의 LED 스트립 색상을 즉시 변경하려면 Telegram에 /color red, /color blue 또는 지원하는 색상 이름을 보냅니다.

MCU 스케치: 이전 Bridge 섹션에서 동일한 MCU 스케치를 유지합니다.

Python 코드 (Telegram)

/* * 이 Arduino UNO Q 코드는 newbiely.kr 에서 개발되었습니다 * 이 Arduino UNO Q 코드는 어떠한 제한 없이 공개 사용을 위해 제공됩니다. * 상세한 지침 및 연결도에 대해서는 다음을 방문하세요: * https://newbiely.kr/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)

빠른 단계

  • YOUR_TELEGRAM_BOT_TOKEN을 BotFather에서 실제 봇 토큰으로 바꿉니다.
  • YOUR_CHAT_ID를 Telegram 채팅 ID로 바꿉니다.
  • 이 Python 코드를 앱의 Python 파일에 붙여넣습니다 (동일한 MCU 스케치 유지).
  • Run 버튼을 클릭합니다 — Telegram에서 /color red를 보내 LED 스트립 색상을 변경합니다.

App Lab 콘솔 출력

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

You can adapt the OpenClaw to this tutorial by refering the instruction on 아두이노 우노 Q - OpenClaw Tutorial

프로젝트 아이디어

Arduino UNO Q와 LED 스트립으로 많은 유용한 프로젝트를 만들 수 있습니다:

  • Telegram 분위기 조명: 언제든지 Telegram에서 방의 RGB LED 스트립 색상을 제어합니다 — 편안한 저녁 분위기를 위해 /color blue를 보내거나 작업 모드를 위해 /color white를 보냅니다
  • 알림 조명: 가스 센서 튜토리얼과 결합합니다 — 가스가 감지되면 Python은 Bridge를 통해 LED 스트립을 빨강(경고)으로 설정합니다; 해제되면 흰색(정상)으로 돌아갑니다
  • 일정 기반 조명: Python의 time 모듈을 사용하여 Telegram 입력 없이 시간에 따라 LED 스트립 색상을 자동으로 변경합니다 — 저녁에는 따뜻한 흰색, 아침에는 시원한 흰색
  • 음악 반응형 조명: 사운드 센서와 결합합니다 — 사운드 센서가 비트를 감지하면 Python은 빠르게 색상을 순환하여 음악 반응형 조명 효과를 만듭니다
  • 상태 표시기 패널: LED 스트립을 서버실 또는 작업실의 상태 표시기로 사용합니다 — 초록색 = 모든 시스템 정상, 노란색 = 경고, 빨강색 = 심각한 경고 — Bridge에서 모니터링 스크립트로 제어됨

도전해 보세요

Arduino UNO Q의 LED 스트립으로 더 나아가실 준비가 되셨나요? 다음 도전 과제를 시도해 보세요:

  • 쉬움: /blink <color> <count> Telegram 명령을 추가합니다. 선택한 색상으로 LED 스트립을 지정된 횟수만큼 깜박입니다. 깜박임당 500ms 켜짐 및 500ms 꺼짐입니다.
  • 중간: 부드러운 색상 순환 모드 구현: Telegram을 통해 /mode cycle이 전송되면 Python은 3초 일시 중지와 함께 모든 7개 색상을 순환하는 루프에 들어갑니다. /mode stop은 루프를 빠져나와 스트립을 끕니다.
  • 어려움: 일출 알람 빌드: 사용자가 정의한 시간 (Telegram 명령 /alarm HH:MM을 통해 설정)에 Python은 LED 스트립을 꺼짐 → 빨강색 → 노란색 → 흰색으로 10분에 걸쳐 천천히 전환하여 자연 일출 깨우기 경험을 시뮬레이션합니다.