element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Light Up Your Life
  • Challenges & Projects
  • Design Challenges
  • Light Up Your Life
  • More
  • Cancel
Light Up Your Life
Projects Smart car chamber Submission-- Smart Car Ambient Lighting Control System Project
  • News
  • Forum
  • Projects
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join Light Up Your Life to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fyaocn
  • Date Created: 12 Nov 2025 8:13 AM Date Created
  • Views 33 views
  • Likes 1 like
  • Comments 0 comments
Related
Recommended

Smart car chamber Submission-- Smart Car Ambient Lighting Control System Project

fyaocn
fyaocn
12 Nov 2025

1. Project Overview

1.1 Project Background

This project designs and implements an Arduino-based intelligent car ambient lighting control system that integrates multiple lighting scene modes, brightness adjustment, proximity sensing control, and other functions, providing an intelligent and personalized lighting solution for automotive interior spaces.

1.2 System Features

  • ​​Multiple Lighting Scenes​​: 5 switchable lighting effects
  • ​​Intelligent Gesture Control​​: Hand gesture switching via ultrasonic sensor
  • ​​Adjustable Brightness​​: 5-level brightness adjustment for different environments
  • ​​Energy Efficient​​: Automatic on/off and low-power design

image

2. System Components

2.1 Hardware Components List

Component Specification Quantity Purpose
Arduino Zero 1 Main Controller
WL-ICLED Strips WL-ICLED LEDs 3 strips × 5 LEDs Ambient Light Source
WS2816 Single LED Individual control 1 Auxiliary Indicator
HC-SR04 Ultrasonic Module Detection range 2-400cm 1 Proximity Detection
Buttons 6×6mm momentary 2 Brightness/Power Control
Demo Frame- Car Chamber

2.2 Hardware Connection 

image

3. System Architecture Design

3.1 System Block Diagram

image

4. Functional Implementation Details

4.1 Lighting Scene Modes

Scene 1: Static Warm White

void scene1Static() {
    // Three strips show warm white, single LED shows white
    for (int i = 0; i < 5; i++) leds[i] = CRGB::White;
    // ... Other LED configurations
}

Scene 2: Breathing Effect

  • Blue gradient breathing effect
  • Smooth brightness transition (30ms intervals)

Scene 3: Rainbow Flow

  • Full color spectrum cycling flow
  • 7-color gradient, dynamic changes

Scene 4: Music Rhythm Simulation

  • Random color changes simulating music rhythm
  • Three different flashing patterns

Scene 5: Color Cycling

  • 5 preset colors cycle automatically
  • 1-second interval auto-switching

4.2 Proximity Detection Algorithm

void checkProximitySceneChange() {
    float distance = afstandssensor.distanceCM();
    
    // Detect gestures in 10-20cm range
    if (distance >= 10 && distance <= 20) {
        if (proximityHandled) {
            changeSceneByProximity();  // Switch scene
            proximityHandled = false;
        }
    } else {
        proximityHandled = true;
    }
}

4.3 Brightness Control Logic

void adjustBrightness() {
    currentBrightness += 51;  // 51 = 255/5
    if (currentBrightness > 255) 
        currentBrightness = 25;  // Minimum 10% brightness
    FastLED.setBrightness(currentBrightness);
}

Smart Car Ambient Lighting Control System Project Report

1. Project Overview

1.1 Project Background

This project designs and implements an Arduino-based intelligent car ambient lighting control system that integrates multiple lighting scene modes, brightness adjustment, proximity sensing control, and other functions, providing an intelligent and personalized lighting solution for automotive interior spaces.

1.2 System Features

  • Multiple Lighting Scenes: 5 switchable lighting effects
  • Intelligent Gesture Control: Hand gesture switching via ultrasonic sensor
  • Adjustable Brightness: 5-level brightness adjustment for different environments
  • Energy Efficient: Automatic on/off and low-power design

2. System Components

2.1 Hardware Components List

Component Specification Quantity Purpose
Arduino Nano/Uno ATmega328P 1 Main Controller
WS2816 LED Strips WL-ICLED LEDs 3 strips × 5 LEDs Ambient Light Source
WS2816 Single LED Individual control 1 Auxiliary Indicator
HC-SR04 Ultrasonic Module Detection range 2-400cm 1 Proximity Detection
Tactile Buttons 6×6mm momentary 2 Brightness/Power Control
Resistors 220Ω, 10kΩ Several Signal Conditioning
Connecting Wires Dupont wires Several Circuit Connections
Power Module 5V/3A DC-DC 1 System Power Supply

3. System Architecture Design

3.1 System Block Diagram

3.2 Software Architecture

4. Functional Implementation Details

4.1 Lighting Scene Modes

Scene 1: Static Warm White

void scene1Static() {
    // Three strips show warm white, single LED shows white
    for (int i = 0; i < 5; i++) leds[i] = CRGB::White;
    // ... Other LED configurations
}

Scene 2: Breathing Effect

  • Blue gradient breathing effect
  • Smooth brightness transition (30ms intervals)

Scene 3: Rainbow Flow

  • Full color spectrum cycling flow
  • 7-color gradient, dynamic changes

Scene 4: Music Rhythm Simulation

  • Random color changes simulating music rhythm
  • Three different flashing patterns

Scene 5: Color Cycling

  • 5 preset colors cycle automatically
  • 1-second interval auto-switching

4.2 Proximity Detection Algorithm

void checkProximitySceneChange() {
    float distance = afstandssensor.distanceCM();
    
    // Detect gestures in 10-20cm range
    if (distance >= 10 && distance <= 20) {
        if (proximityHandled) {
            changeSceneByProximity();  // Switch scene
            proximityHandled = false;
        }
    } else {
        proximityHandled = true;
    }
}

4.3 Brightness Control Logic

void adjustBrightness() {
    currentBrightness += 51;  // 51 = 255/5
    if (currentBrightness > 255) 
        currentBrightness = 25;  // Minimum 10% brightness
    FastLED.setBrightness(currentBrightness);
}

5. Actual Effect Demonstration

5.1 Installation Effect Diagram

5.2 Scene Effect Description

Scene Visual Effect Application Scenario
Scene 1 Soft warm white static light Night driving, reduce glare
Scene 2 Blue breathing gradient Highway cruising, relaxation
Scene 3 Rainbow flowing effect Entertainment, atmosphere enhancement
Scene 4 Random rhythm flashing Music appreciation, party mode
Scene 5 Color cycle switching Personalized customization

5.3 Control Experience

  1. Gesture Control: Wave hand 10-20cm from sensor to switch scenes
  2. Visual Feedback: LED flashing indicates current scene number
  3. Brightness Memory: System remembers last brightness setting
  4. Energy Saving: Automatic low-power mode when inactive

6. Project Photos and Final Effects

image

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

7. Codes

#include <FastLED.h>
#include <afstandssensor.h>  

#define NUM_LEDS 16  
#define DATA_PIN 3
#define TRIGGER_PIN 6
#define ECHO_PIN 7
#define BUTTON_BRIGHTNESS_PIN 8 
#define BUTTON_POWER_PIN 9      
#define MAX_DISTANCE 50          

CRGB leds[NUM_LEDS];
AfstandsSensor afstandssensor(TRIGGER_PIN, ECHO_PIN);

bool powerOn = true;
uint8_t currentScene = 0;
uint8_t currentBrightness = 128; 
uint8_t maxBrightness = 255;
unsigned long lastDistanceCheck = 0;
unsigned long lastProximityTime = 0;
bool proximityHandled = true;

const unsigned long PROXIMITY_DEBOUNCE = 1000;

const uint8_t NUM_SCENES = 5;

CRGB scene1Colors[3] = { CRGB::White, CRGB::White, CRGB::White };

CRGB scene2BaseColor = CRGB::Blue;

uint8_t scene3Hue = 0;

CRGB scene4Colors[3] = { CRGB::Red, CRGB::Green, CRGB::Blue };

CRGB scene5Colors[5] = { CRGB::Red, CRGB::Orange, CRGB::Yellow, CRGB::Green, CRGB::Blue };
uint8_t scene5Index = 0;

void setup() {
  Serial.begin(9600);
  
  FastLED.addLeds<WS2816, DATA_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(currentBrightness);
  
  pinMode(BUTTON_BRIGHTNESS_PIN, INPUT_PULLUP);
  pinMode(BUTTON_POWER_PIN, INPUT_PULLUP);

  allOff();
  FastLED.show();
  

}

void loop() {
  checkButtons();
  checkProximitySceneChange();
  
  if (powerOn) {
    switch (currentScene) {
      case 0: scene1Static(); break;
      case 1: scene2Breathing(); break;
      case 2: scene3Rainbow(); break;
      case 3: scene4Music(); break;
      case 4: scene5ColorCycle(); break;
    }
  } else {
    allOff();
    FastLED.show();
    delay(100);
  }
}


void checkButtons() {
  static unsigned long lastDebounceTime = 0;
  static bool lastBrightnessState = HIGH;
  static bool lastPowerState = HIGH;
  
  bool brightnessState = digitalRead(BUTTON_BRIGHTNESS_PIN);
  bool powerState = digitalRead(BUTTON_POWER_PIN);
  

  if (brightnessState == LOW && lastBrightnessState == HIGH && millis() - lastDebounceTime > 200) {
    currentBrightness += 51; 
    if (currentBrightness > 255) currentBrightness = 25;
    FastLED.setBrightness(currentBrightness);

    Serial.println(currentBrightness);
    lastDebounceTime = millis();
  }
  lastBrightnessState = brightnessState;
  

  if (powerState == LOW && lastPowerState == HIGH && millis() - lastDebounceTime > 200) {
    powerOn = !powerOn;
    lastDebounceTime = millis();
  }
  lastPowerState = powerState;
}


void checkProximitySceneChange() {
  if (millis() - lastDistanceCheck > 300) { 
    float distance = afstandssensor.afstandCM();
    
 
    Serial.print(distance);
    Serial.println(" cm");
    
   
    if (distance >= 10 && distance <= 20) {
      if (proximityHandled && millis() - lastProximityTime > PROXIMITY_DEBOUNCE) {
        changeSceneByProximity();
        proximityHandled = false;
        lastProximityTime = millis();
      }
    } else {
      proximityHandled = true; 
    }
    
    lastDistanceCheck = millis();
  }
}


void changeSceneByProximity() {
  currentScene = (currentScene + 1) % NUM_SCENES;
  Serial.println(currentScene + 1);  
  proximityFeedback();
}


void proximityFeedback() {

  CRGB feedbackColor = getSceneColor(currentScene);
  
  for (int i = 0; i < 2; i++) {
    fill_solid(leds, NUM_LEDS, feedbackColor);
    FastLED.show();
    delay(150);
    allOff();
    FastLED.show();
    delay(100);
  }
  

  showSceneNumber(currentScene + 1);
}


void showSceneNumber(uint8_t sceneNum) {
  allOff();
  
  for (int i = 0; i < sceneNum && i < 5; i++) {
    leds[i] = CRGB::Green;
  }
  
  FastLED.show();
  delay(800);
  allOff();
  FastLED.show();
}


CRGB getSceneColor(uint8_t scene) {
  switch (scene) {
    case 0: return CRGB::White;      // 场景1:白色
    case 1: return CRGB::Blue;       // 场景2:蓝色
    case 2: return CRGB::Purple;     // 场景3:紫色
    case 3: return CRGB::Yellow;     // 场景4:黄色
    case 4: return CRGB::Cyan;       // 场景5:青色
    default: return CRGB::White;
  }
}


void scene1Static() {
  for (int i = 0; i < 5; i++) leds[i] = scene1Colors[0];     // 第一串
  for (int i = 5; i < 10; i++) leds[i] = scene1Colors[1];    // 第二串
  for (int i = 10; i < 15; i++) leds[i] = scene1Colors[2];   // 第三串
  leds[15] = CRGB::White; // 单独的WS2816
  
  FastLED.show();
  delay(100);
}


void scene2Breathing() {
  static uint8_t breathValue = 0;
  static bool breathingUp = true;
  
  CRGB color = scene2BaseColor;
  color.fadeToBlackBy(255 - breathValue);
  
  fill_solid(leds, NUM_LEDS, color);
  FastLED.show();
  
  if (breathingUp) {
    breathValue += 2;
    if (breathValue >= 200) breathingUp = false;
  } else {
    breathValue -= 2;
    if (breathValue <= 30) breathingUp = true;
  }
  
  delay(30);
}


void scene3Rainbow() {
  fill_rainbow(leds, NUM_LEDS, scene3Hue, 7);
  FastLED.show();
  
  scene3Hue += 1;
  delay(50);
}


void scene4Music() {
  static unsigned long lastChange = 0;
  static uint8_t pattern = 0;
  
  if (millis() - lastChange > random(100, 300)) {
    pattern = random(3);
    lastChange = millis();
  }
  
  switch (pattern) {
    case 0:
      fill_solid(leds, 5, scene4Colors[0]);
      fill_solid(leds + 5, 5, scene4Colors[1]);
      fill_solid(leds + 10, 5, scene4Colors[2]);
      break;
    case 1:
      fill_solid(leds, NUM_LEDS, scene4Colors[random(3)]);
      break;
    case 2:
      fill_gradient_RGB(leds, NUM_LEDS, 
                       scene4Colors[0], scene4Colors[1], scene4Colors[2]);
      break;
  }
  
  leds[15] = scene4Colors[random(3)]; 
  FastLED.show();
  delay(80);
}


void scene5ColorCycle() {
  static unsigned long lastChange = 0;
  
  if (millis() - lastChange > 1000) {
    CRGB color = scene5Colors[scene5Index];
    fill_solid(leds, NUM_LEDS, color);
    FastLED.show();
    
    scene5Index = (scene5Index + 1) % 5;
    lastChange = millis();
  }
}


void allOff() {
  fill_solid(leds, NUM_LEDS, CRGB::Black);
}


void setStrip(uint8_t stripNum, CRGB color) {
  uint8_t start = stripNum * 5;
  uint8_t end = start + 5;
  if (stripNum == 3) { 
    leds[15] = color;
  } else {
    for (int i = start; i < end && i < NUM_LEDS; i++) {
      leds[i] = color;
    }
  }
}

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube