Arduino Bluetooth RGB LED kontrol projesi, aracınızın altına RGB LED’ler yerleştirerek mobil uygulama üzerinden istediğiniz renkte ışıklandırma yapmanızı sağlayan etkileyici bir araç modifikasyon projesidir. Bu sistemle aracınızı renkli bir halaya dönüştürebilir, gece sürüşlerinizi daha gösterişli hale getirebilirsiniz.
RGB LED sistemi, kırmızı (Red), yeşil (Green) ve mavi (Blue) LED’lerin farklı yoğunluklarda karıştırılmasıyla milyonlarca farklı renk üretebilir. Arduino Nano mikrokontrolcüsü, Bluetooth modülü üzerinden gelen komutları işleyerek PWM sinyalleri ile LED’lerin parlaklığını kontrol eder.
👉 Arduino Bluetooth RGB LED Kontrol Projesi – Video Rehber
Video içeriği: TIP41C transistör bağlantıları, LM2596 ayarları, RGB LED strip montajı, araç altı kurulum teknikleri ve mobil uygulama kullanımı
Kırmızı Kanal:
Yeşil Kanal:
Mavi Kanal:
#include <SoftwareSerial.h>
[Üye Girişi Yaparak Tüm Kodlara Erişin]
Premium paket: Gelişmiş renk animasyonları, müzik senkronizasyonu, önceden tanımlı temalar, zamanlayıcı fonksiyonları, güç yönetimi optimizasyonu
#include <SoftwareSerial.h>
// Bluetooth bağlantısı
SoftwareSerial bluetooth(2, 3); // RX, TX
// RGB LED PWM pinleri
#define RED_PIN 9
#define GREEN_PIN 10
#define BLUE_PIN 11
// Mevcut RGB değerleri
int currentRed = 0;
int currentGreen = 0;
int currentBlue = 0;
// Hedef RGB değerleri (yumuşak geçiş için)
int targetRed = 0;
int targetGreen = 0;
int targetBlue = 0;
// Animasyon değişkenleri
bool animationActive = false;
int animationMode = 0;
unsigned long lastUpdate = 0;
int animationStep = 0;
// Komut işleme değişkenleri
String receivedData = "";
bool newCommand = false;
void setup() {
Serial.begin(9600);
bluetooth.begin(9600);
// PWM pinleri çıkış olarak ayarla
pinMode(RED_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
pinMode(BLUE_PIN, OUTPUT);
// Başlangıç durumu - Tüm LED'ler kapalı
setRGBColor(0, 0, 0);
Serial.println("Arduino Bluetooth RGB LED Kontrol Sistemi Başlatıldı");
bluetooth.println("RGB_LED_READY");
// Başlangıç animasyonu
startupAnimation();
}
void loop() {
// Bluetooth veri kontrolü
checkBluetoothCommands();
// Animasyon kontrolü
if (animationActive) {
updateAnimation();
} else {
// Yumuşak renk geçişi
smoothColorTransition();
}
delay(20); // 50Hz güncelleme hızı
}
void checkBluetoothCommands() {
if (bluetooth.available()) {
char c = bluetooth.read();
if (c == '\n' || c == '\r') {
if (receivedData.length() > 0) {
processCommand(receivedData);
receivedData = "";
}
} else {
receivedData += c;
}
}
}
void processCommand(String command) {
Serial.println("Alınan komut: " + command);
// RGB renk komutu: R255G128B64
if (command.startsWith("R") && command.indexOf("G") > 0 && command.indexOf("B") > 0) {
parseRGBCommand(command);
}
// Önceden tanımlı renkler
else if (command == "RED") {
setTargetColor(255, 0, 0);
}
else if (command == "GREEN") {
setTargetColor(0, 255, 0);
}
else if (command == "BLUE") {
setTargetColor(0, 0, 255);
}
else if (command == "WHITE") {
setTargetColor(255, 255, 255);
}
else if (command == "YELLOW") {
setTargetColor(255, 255, 0);
}
else if (command == "PURPLE") {
setTargetColor(255, 0, 255);
}
else if (command == "CYAN") {
setTargetColor(0, 255, 255);
}
else if (command == "OFF") {
setTargetColor(0, 0, 0);
}
// Animasyon komutları
else if (command == "RAINBOW") {
startAnimation(1);
}
else if (command == "FADE") {
startAnimation(2);
}
else if (command == "PULSE") {
startAnimation(3);
}
else if (command == "POLICE") {
startAnimation(4);
}
else if (command == "FIRE") {
startAnimation(5);
}
else if (command == "STOP") {
stopAnimation();
}
// Parlaklık kontrolü: B50 (0-100)
else if (command.startsWith("BRIGHT")) {
int brightness = command.substring(6).toInt();
setBrightness(brightness);
}
else {
bluetooth.println("UNKNOWN_COMMAND");
Serial.println("Bilinmeyen komut: " + command);
}
}
void parseRGBCommand(String command) {
int rPos = command.indexOf("R");
int gPos = command.indexOf("G");
int bPos = command.indexOf("B");
if (rPos >= 0 && gPos > rPos && bPos > gPos) {
int red = command.substring(rPos + 1, gPos).toInt();
int green = command.substring(gPos + 1, bPos).toInt();
int blue = command.substring(bPos + 1).toInt();
// Değerleri sınırla
red = constrain(red, 0, 255);
green = constrain(green, 0, 255);
blue = constrain(blue, 0, 255);
setTargetColor(red, green, blue);
bluetooth.println("RGB_SET:" + String(red) + "," + String(green) + "," + String(blue));
}
}
void setTargetColor(int r, int g, int b) {
targetRed = r;
targetGreen = g;
targetBlue = b;
animationActive = false;
Serial.println("Hedef renk: R=" + String(r) + " G=" + String(g) + " B=" + String(b));
}
void setRGBColor(int r, int g, int b) {
currentRed = r;
currentGreen = g;
currentBlue = b;
analogWrite(RED_PIN, r);
analogWrite(GREEN_PIN, g);
analogWrite(BLUE_PIN, b);
}
void smoothColorTransition() {
bool changed = false;
// Kırmızı geçiş
if (currentRed != targetRed) {
if (currentRed < targetRed) {
currentRed = min(currentRed + 3, targetRed);
} else {
currentRed = max(currentRed - 3, targetRed);
}
changed = true;
}
// Yeşil geçiş
if (currentGreen != targetGreen) {
if (currentGreen < targetGreen) {
currentGreen = min(currentGreen + 3, targetGreen);
} else {
currentGreen = max(currentGreen - 3, targetGreen);
}
changed = true;
}
// Mavi geçiş
if (currentBlue != targetBlue) {
if (currentBlue < targetBlue) {
currentBlue = min(currentBlue + 3, targetBlue);
} else {
currentBlue = max(currentBlue - 3, targetBlue);
}
changed = true;
}
if (changed) {
setRGBColor(currentRed, currentGreen, currentBlue);
}
}
void startAnimation(int mode) {
animationMode = mode;
animationActive = true;
animationStep = 0;
lastUpdate = millis();
Serial.println("Animasyon başlatıldı: Mode " + String(mode));
bluetooth.println("ANIMATION_START:" + String(mode));
}
void stopAnimation() {
animationActive = false;
Serial.println("Animasyon durduruldu");
bluetooth.println("ANIMATION_STOP");
}
void updateAnimation() {
unsigned long currentTime = millis();
switch (animationMode) {
case 1: // Rainbow
if (currentTime - lastUpdate > 50) {
rainbowAnimation();
lastUpdate = currentTime;
}
break;
case 2: // Fade
if (currentTime - lastUpdate > 30) {
fadeAnimation();
lastUpdate = currentTime;
}
break;
case 3: // Pulse
if (currentTime - lastUpdate > 20) {
pulseAnimation();
lastUpdate = currentTime;
}
break;
case 4: // Police
if (currentTime - lastUpdate > 200) {
policeAnimation();
lastUpdate = currentTime;
}
break;
case 5: // Fire
if (currentTime - lastUpdate > 100) {
fireAnimation();
lastUpdate = currentTime;
}
break;
}
}
void rainbowAnimation() {
int hue = (animationStep * 2) % 360;
RGBColor color = HSVtoRGB(hue, 255, 255);
setRGBColor(color.r, color.g, color.b);
animationStep++;
}
void fadeAnimation() {
int brightness = (sin(animationStep * 0.1) + 1) * 127.5;
setRGBColor(brightness, brightness, brightness);
animationStep++;
}
void pulseAnimation() {
static int direction = 1;
static int pulseValue = 0;
pulseValue += direction * 5;
if (pulseValue >= 255) {
pulseValue = 255;
direction = -1;
} else if (pulseValue <= 0) {
pulseValue = 0;
direction = 1;
}
setRGBColor(pulseValue, 0, pulseValue); // Mor nabız
animationStep++;
}
void policeAnimation() {
if (animationStep % 4 < 2) {
setRGBColor(255, 0, 0); // Kırmızı
} else {
setRGBColor(0, 0, 255); // Mavi
}
animationStep++;
}
void fireAnimation() {
int red = random(200, 255);
int green = random(0, red / 2);
int blue = 0;
setRGBColor(red, green, blue);
animationStep++;
}
void setBrightness(int percent) {
float factor = percent / 100.0;
targetRed = targetRed * factor;
targetGreen = targetGreen * factor;
targetBlue = targetBlue * factor;
bluetooth.println("BRIGHTNESS_SET:" + String(percent));
}
void startupAnimation() {
// Başlangıç test animasyonu
setRGBColor(255, 0, 0);
delay(300);
setRGBColor(0, 255, 0);
delay(300);
setRGBColor(0, 0, 255);
delay(300);
setRGBColor(0, 0, 0);
}
// HSV'den RGB'ye dönüştürme yardımcı fonksiyonu
struct RGBColor {
int r, g, b;
};
RGBColor HSVtoRGB(int h, int s, int v) {
RGBColor rgb;
float H = h / 60.0;
float S = s / 255.0;
float V = v / 255.0;
int i = floor(H);
float f = H - i;
float p = V * (1 - S);
float q = V * (1 - S * f);
float t = V * (1 - S * (1 - f));
switch (i % 6) {
case 0: rgb.r = V * 255; rgb.g = t * 255; rgb.b = p * 255; break;
case 1: rgb.r = q * 255; rgb.g = V * 255; rgb.b = p * 255; break;
case 2: rgb.r = p * 255; rgb.g = V * 255; rgb.b = t * 255; break;
case 3: rgb.r = p * 255; rgb.g = q * 255; rgb.b = V * 255; break;
case 4: rgb.r = t * 255; rgb.g = p * 255; rgb.b = V * 255; break;
case 5: rgb.r = V * 255; rgb.g = p * 255; rgb.b = q * 255; break;
}
return rgb;
}
LED Akımı: 20mA x 60 LED = 1.2A (kanal başına)
Toplam Güç: 12V x 3.6A = 43.2W
TIP41C Isı: (Vce x Ic) = 1V x 1.2A = 1.2W (kanal başına)
| Özellik | RGB LED | Neon | EL Wire | OLED |
|---|---|---|---|---|
| Renk Sayısı | 16.7M | Sabit | Sabit | 16.7M |
| Güç Tüketimi | Düşük | Yüksek | Çok Düşük | Düşük |
| Ömür | 50k saat | 15k saat | 5k saat | 30k saat |
| Kontrol | PWM | ON/OFF | ON/OFF | PWM |
| Maliyet | Orta | Yüksek | Düşük | Çok Yüksek |
| Montaj | Kolay | Zor | Çok Kolay | Orta |
| Malzeme | Ortalama Fiyat (TL) |
|---|---|
| Arduino Nano | 25-35 |
| RGB LED Strip (5m) | 40-80 |
| HC-05 Bluetooth Modülü | 25-35 |
| 3x TIP41C Transistör | 15-25 |
| LM2596 Regülatör | 12-20 |
| Dirençler ve Kapasitörler | 5-10 |
| PCB ve Konnektörler | 15-25 |
| Su Geçirmez Kutu | 20-35 |
| Kablolar ve Aksesuarlar | 25-40 |
| Toplam | 182-305 TL |
Arduino Bluetooth RGB LED kontrol projesi, araç modifikasyonu ve elektronik teknolojinin mükemmel birleşimini sunar. Bu proje ile aracınızı kişiselleştirebilir, teknolojik gösteriş yapabilir ve LED teknolojisi konusunda pratik deneyim kazanabilirsiniz. Doğru uygulama ile hem güvenli hem de etkileyici sonuçlar elde edebilirsiniz.
Anahtar Kelimeler: Arduino Bluetooth RGB LED, araç altı LED sistemi, TIP41C transistör kontrolü, LM2596 voltaj regülatör, RGB LED strip kontrol, Bluetooth LED projesi, araç modifikasyon LED, Arduino PWM kontrol, mobil RGB LED uygulaması