This is an old revision of the document!


Ambiental Lights for PC

Introduction

The project I have chosen is a device that captures the dominant colors displayed on a PC screen and reproduces them on an LED strip mounted behind it.

Its purpose is to provide a pleasant experience for users who spend a lot of time in front of the computer, especially gamers.

The idea comes from TVs that have this LED system on the back to provide a unique experience while watching movies.

The utility of the project consists in enhancing the user's visual experience, creating a more captivating atmosphere, and reducing eye strain in low-light conditions.

General Description

Hardware Design

Component Description
Arduino UNO Microcontroller
LED Strip WS2812B LEDs for color display
Button Switches between operation modes
Wires Connect components on the breadboard
Breadboard Circuit assembly
Power Source Powers the circuit
USB Cable PC Connection

Circuit

Schematic

Software Design

Used Arduino UNO and an external library (FastLED) for controlling WS2812B LED strip.

  • Abstracts the timing-sensitive signal required by addressable LEDs.

Operating Modes

The project features multiple operating modes that can be switched by pressing a button. The mode switching is handled via an external interrupt, allowing fast and responsive detection of the button press event.

ISR(INT0_vect) {
   if ((long)(micros() - lastDebounceTime) >= debounceDelay) {
       mode = (mode + 1) % 3;
       lastDebounceTime = micros();
       updateNeeded = true;
   }
}
  • Mode 0 – All LEDs are set to a specific color
  • Mode 1 - Automatic fade effect cycling through Magenta, Cyan, and Blue. Used Timer1 to generate a tick every 1 ms:
ISR(TIMER1_COMPA_vect) {
   if (mode == 1) {  // just in mode 1
       millis_counter++;
          if (millis_counter >= 30) { // every 30 ms
              millis_counter = 0;
              fadeBrightness += fadeDirection * 5;  // change intensity
                 if (fadeBrightness >= 255) {
                     fadeBrightness = 255;
                     fadeDirection = -1;  // starts to decrease
                 } else if (fadeBrightness <= 0) {
                     fadeBrightness = 0;
                     fadeDirection = 1;   // starts to increase
                     fadeColorIndex = (fadeColorIndex + 1) % 3;  // change color after a complete cycle
                 }
                 updateNeeded = true;
          }
   }
}
  • Mode 2 - Real-time color updates via serial connection using the Adalight protocol (Prismatik)

Rezultate Obţinute

Care au fost rezultatele obţinute în urma realizării proiectului vostru.

Concluzii

Download

O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului: surse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-).

Fişierele se încarcă pe wiki folosind facilitatea Add Images or other files. Namespace-ul în care se încarcă fişierele este de tipul :pm:prj20??:c? sau :pm:prj20??:c?:nume_student (dacă este cazul). Exemplu: Dumitru Alin, 331CC → :pm:prj2009:cc:dumitru_alin.

Jurnal

Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului.

Bibliografie/Resurse

Listă cu documente, datasheet-uri, resurse Internet folosite, eventual grupate pe Resurse Software şi Resurse Hardware.

Export to PDF

pm/prj2025/cmoarcas/gabriel.tintu.1748568559.txt.gz · Last modified: 2025/05/30 04:29 by gabriel.tintu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0