กลับไปหน้ารวมไฟล์
rgb-strip-led-controlled-with-bluetooth-0b67bc-en.md

Project Overview: Ambient Lighting for Modern Spaces

Interior lighting has evolved from simple functional bulbs to dynamic, color-controllable systems. This project, RGB Strip LED controlled with Bluetooth, provides a low-cost entry into smart home automation. By combining an Arduino Nano with an HC-05 Bluetooth module, you can control the color and intensity of an RGB LED strip directly from your smartphone.

Whether you want a calm blue for reading, a vibrant yellow for energy, or a shifting rainbow fade for a gaming setup, this project provides the firmware and hardware blueprint to make it happen.

Hardware & Power Management

Lighting strips, especially NeoPixels or standard analog RGB strips, can consume a significant amount of power.

  • Arduino Nano R3: A compact microcontroller that fits easily into small lighting enclosures.
  • HC-05 Bluetooth Module: Acts as the bridge between the smartphone app and the Arduino logic.
  • Power MOSFETs (Optional/N-Channel): If using a standard high-power analog strip (rather than a low-power NeoPixel), MOSFETs are used to switch the high current for each color channel (Red, Green, Blue) based on PWM signals from the Arduino.
  • DC-DC Buck Converter: Since LED strips often require 12V while the Arduino runs on 5V, a buck converter ensures each component receives its appropriate voltage efficiently.

Understanding the Control Protocol

The system uses a simple character-based protocol over Serial. When you press a button on the custom smartphone app (built with MIT App Inventor), it sends a single character to the Arduino:

  • 'r' / 'g' / 'b': Sets the strip to pure Red, Green, or Blue.
  • 'w': Sets all channels to max (White).
  • 'a' / 'y' / 'v': Creates composite colors like Orange, Yellow, and Violet by mixing the base color intensities.
  • 's': Initiates a "Show" or Rainbow Fade mode where the colors cycle smoothly.
  • 'z': Turns all colors off.

Code Logic & Technical Excellence

The firmware utilizes SoftwareSerial on pins 8 and 9. This is a smart choice as it keeps the hardware Serial (USB) free for debugging and uploading code.

PWM Intensity Control: The project uses analogWrite() on pins 3, 5, and 6. These are PWM (Pulse Width Modulation) pins on the Arduino Nano. By varying the duty cycle from 0 to 255, the Arduino can simulate millions of color combinations.

The Rainbow Fade Function: The code includes a nested for loop structure in the rgb() helper function. It cycles through the 8-bit color space (0-255) for each channel, creating a smooth transition known as "HUE shifting."

void rgb(int rosso, int verde, int blu){
  analogWrite(rossoPin, rosso);
  analogWrite(verdePin, verde);
  analogWrite(bluPin, blu);
}

Next Steps for Expansion

While the current project uses basic color presets, the logic can be expanded. You could add a color picker in the mobile app to send specific RGB values (e.g., "R255G120B000") for precise control. Additionally, adding a sound sensor could allow the lights to "dance" to music in real-time.

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

title: "RGB Strip led controlled with Bluetooth"
description: "Simply circuit for control a RGB strip led, with Arduino."
author: "SaveForest"
category: ""
tags:
  - "bluetooth"
  - "home automation"
  - "rgb"
views: 1326
likes: 1
price: 299
difficulty: "Easy"
components:
  - "1x Arduino Nano R3"
  - "1x Breadboard (generic)"
  - "1x Jumper wires (generic)"
  - "1x LED Strip, NeoPixel Digital RGB"
  - "1x DC-DC Buck (Step Down) Regulator, Adjustable"
  - "1x Resistor 220 ohm"
  - "1x HC-05 Bluetooth Module"
  - "1x Power MOSFET N-Channel"
tools: []
apps:
  - "1x MIT App Inventor 2"
downloadableFiles:
  - "https://projects.arduinocontent.cc/ae66ec97-d39c-40e4-bb7d-6733e66072ea.ino"
  - "https://projects.arduinocontent.cc/ae66ec97-d39c-40e4-bb7d-6733e66072ea.ino"
documentationLinks: []
passwordHash: "3b3f76c19a7e91ad0fcbb9b08415f60c2cd112a7a3cc2b0a9c3f84bb8f85028e"
encryptedPayload: "U2FsdGVkX18iY46/oU1XriQlxp8azcfNigBN9wn0Pke2rllbAVxsodv5l6OmYK2jcFaI+7o6W3S/PnSPCAuG5lVBJrcwnx1/zpkFjApaMZM="
seoDescription: "Learn how to control an RGB Strip led using Arduino and Bluetooth with this simple and easy-to-build circuit project."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/rgb-strip-led-controlled-with-bluetooth-0b67bc_cover.jpg"
lang: "en"