กลับไปหน้ารวมไฟล์
control-rgb-led-using-bluetooth-d57796-en.md

Hey everyone,

This project shows you how to control an RGB LED using Bluetooth. Check out this video:


🛠️ Deep Dive / Technical Analysis

Why buy an $80 commercial smart light strip when you can build a customizable one for $15? The Bluetooth WS2812B Controller project fuses parsing Serial commands with the FastLED library to create gorgeous, responsive room lighting.

The FastLED Library Magic

WS2812B strips (NeoPixels) only have 3 wires: 5V, GND, and a single Data line.

  • They are "Addressable." You can tell LED #5 to be Red while LED #60 is Blue.
  • The FastLED.h library handles the excruciatingly complex timing required for the Data line.
  • leds[0] = CRGB::Red; FastLED.show();

Parsing RGB Strings from Bluetooth

The true challenge is getting the exact color from your phone.

  1. You use an Android App (like Bluetooth Electronics) to dial in a custom purple color on a color wheel.
  2. The app sends a string to the HC-05 Receiver: R:150,G:0,B:200\n.
  3. The Arduino reads the string. It uses C++ String.indexOf() to find the commas, and String.substring().toInt() to pull out the exact 150 and 200 integers.
  4. It dynamically feeds those parsed numbers directly into fill_solid(leds, NUM_LEDS, CRGB(r, g, b));.

The Power Warning

  • Arduino Uno/Nano: The command logic.
  • HC-05 Bluetooth Module.
  • An Arduino pin can supply 500mA maximum. A 1-meter strip of 60 NeoPixels running full white draws 3.6 Amps! You must power the LED strip via an external 5V/5A power supply. If you plug the strip directly into the Arduino's 5V pin, you will instantly burn out the voltage regulator.

ข้อมูล Frontmatter ดั้งเดิม

title: "Control RGB LED using Bluetooth"
description: "This project helps you with the connections of controlling RGB LED with Bluetooth module and Arduino Uno."
author: "kamatalaashish"
category: "Internet of Things, BT & Wireless"
tags:
  - "led"
  - "rgb"
views: 47138
likes: 15
price: 450
difficulty: "Easy"
components:
  - "1x Jumper wires (generic)"
  - "1x HC-05 Bluetooth Module"
  - "1x Arduino UNO"
  - "1x rgb led"
tools: []
apps:
  - "1x color led controller"
downloadableFiles: []
documentationLinks: []
passwordHash: "d53c87ecaec0c87f9e8bf019960dfd56773a9f6c77bce7224024a937e05cc7fc"
encryptedPayload: "U2FsdGVkX19i6P2dDONs1Kgz6iQtnXVttRyrvzfzCDxW5FJv7rdKozM2V60Aka6rrRGrjIgrxCEVJjX214bvTm1cJEZ6h+bZYc+ndLQaepY="
seoDescription: "Learn how to connect and control an RGB LED using a Bluetooth module and Arduino Uno in this easy-to-follow project."
videoLinks:
  - "https://www.youtube.com/embed/AW4amUw-Hwg"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/control-rgb-led-using-bluetooth-d57796_cover.png"
lang: "en"