> Markdown version of https://www.imranjan.cn/projects/p-led for AI agents and other programs. It carries the same public information as the web page. Built 2026-11-30.

April 2025 - June 2025

# Voice-Interactive LED Light Panel

## Intelligent Lighting System Design and Implementation - Course Project

Tags: Hardware System Development, Arduino Programming, Voice Interaction

![Voice-Interactive LED Light Panel](https://www.imranjan.cn/images/projects/led-voice-2025/cover.png)

Click to enlarge

### Course Requirements

#### Intelligent LED Lighting System Design

This project covers the full lifecycle of an intelligent LED lighting system—from conception and design to implementation and operation. It requires the comprehensive application of knowledge in power systems, human landmark annotation and tracking, signal control, programming, LED device structures and lighting characteristics, machine vision, and artificial intelligence. The goal is to develop an intelligently controlled lighting system utilizing PWM linear control for LED brightness and human feature tracking technology.

#### Course Objectives

1

##### Application of Engineering Knowledge

Ability to apply engineering and professional knowledge to the design, control, and optimization of a lighting system and its characteristics.

2

##### System Analysis Skills

Ability to use fundamental principles of engineering science and professional knowledge to analyze and identify key aspects and important parameters of a lighting system.

3

##### Feasibility Study

Ability to research the feasibility of design solutions under real-world constraints such as social, health, safety, environmental, legal, and cultural factors.

4

##### Data Processing and Analysis

Ability to correctly collect and organize experimental data, and to research and analyze the results to draw reasonable and valid conclusions.

5

##### Expression and Communication Skills

Ability to articulate design ideas effectively.

Course TypeCompulsory

Completion MethodIndividual Project

Project Grade92/100

Course Grade93/100

### Project Introduction

Based on first-principles thinking, I analyzed that human interaction with lighting is essentially information control, and voice is a highly natural and compatible input method. Since lighting is meant to combat darkness, active voice input is more effective for a machine in the dark than passive visual capture. Therefore, I chose voice interaction to design this smart light source. My voice-interactive LED panel is an intelligent hardware system integrating voice recognition, LED display control, and human-computer interaction. Using an Arduino UNO as the main controller and an ASR-PRO voice recognition module, the system recognizes Chinese voice commands to control a WS2812 LED panel to display various lighting effects. Through modular design, the project integrates functions like voice input, signal processing, command parsing, and LED control, offering an imperfect yet relatively complete solution for smart homes and HCI.

##### Voice Recognition Technology

Utilizes the ASR-PRO module, supporting custom command training and Chinese voice recognition.

##### LED Control Technology

Based on programmable WS2812 LEDs, allowing for individual pixel control and multiple lighting effects.

##### System Integration

Achieves data transfer between modules via serial communication, ensuring system stability.

##### User Experience

Supports 5 voice command modes, providing an intuitive voice interaction experience.

### Hardware Design

The voice-interactive LED panel employs a modular design, integrating core components like voice recognition, a microcontroller, and an LED display. The system uses serial communication for data transfer between modules, ensuring good real-time performance and stability.

#### System Architecture

![Hardware wiring](https://www.imranjan.cn/images/projects/led-voice-2025/hardware-connection.png)System Hardware Connection Diagram - Showing connections between modules

#### Core Hardware Modules

![Arduino UNO board](https://www.imranjan.cn/images/projects/led-voice-2025/arduino-uno.png)Arduino UNO - The system's main controller

![ASR-PRO speech recognition module](https://www.imranjan.cn/images/projects/led-voice-2025/asrpro-module.png)ASR-PRO - Core voice recognition module

![WS2812 LED strip](https://www.imranjan.cn/images/projects/led-voice-2025/led-board.png)WS2812 LED - Programmable RGB display unit

##### Arduino UNO

- Low-cost microcontroller
- 14 digital I/O pins
- 16MHz clock speed
- Serial communication support

##### ASR-PRO Module

- Supports up to 50 command words
- Chinese voice recognition
- Voice synthesis function
- 3-5 meter recognition range

##### WS2812 LED

- 64 LED pixels (8x8)
- Full-color RGB display
- Single-bus control
- Individual pixel control

#### Final Product Showcase

![The finished voice-controlled LED panel](https://www.imranjan.cn/images/projects/led-voice-2025/system.png)The completed voice-interactive LED panel - Full system view

### Software Design

#### Arduino UNO Main Controller Program

Responsible for LED effect control and serial communication:

#### Arduino UNO Main Controller Program

cpp

code.cpp

```cpp
#include <SoftwareSerial.h>
#include <FastLED.h>

SoftwareSerial mySerial(10, 11); // RX, TX
String value;

#define LED_PIN 9
#define NUM_LEDS 64
#define BRIGHTNESS 100

CRGB leds[NUM_LEDS];  // FastLED 控制数组

// 8x8矩阵中的爱心
const int heart[] = {
  9, 10, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
  26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 42, 43,
  44, 45, 51, 52
};

void setup() {
  mySerial.begin(9600); // 软件串口用于语音模块

  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS); // 初始化灯带
  FastLED.setBrightness(BRIGHTNESS); // 设置亮度
  fill_solid(leds, NUM_LEDS, CRGB::Black); //默认关闭
  FastLED.show();
}

void loop() { //主循环持续监听语音串口
  if (mySerial.available()) {
    value = mySerial.readString();
    value.trim();
    handleCommand(value);
  }
}

void handleCommand(String cmd) { //接收到字符指令后分发给对应灯效函数
  if (cmd == "rainbow") {
    rainbowEffect();
  }
  else if (cmd == "warm") {
    warmLight();
  }
  else if (cmd == "cold") {
    coldLight();
  }
  else if (cmd == "close") {
    turnOff();
  }
  else if (cmd == "heart") {
    heartEffect();
  }
  else {
    // 如果收到未知命令
    turnOff();
  }
}

// 彩虹灯
void rainbowEffect() {
  static uint8_t hue = 0; //色调值 hue 是 0~255 的环形值，代表 HSV 色彩模型中的色相角度。

  while (true) {
    // 检查 mySerial 是否收到"打断"指令
    if (mySerial.available()) {
      String interruptCmd = mySerial.readString();
      interruptCmd.trim();

      if (interruptCmd == "close" || interruptCmd == "warm" || interruptCmd == "cold" || interruptCmd == "heart") {
        handleCommand(interruptCmd);  // 执行其他指令
        break; // 跳出彩虹效果，回到主 loop
      }
    }

    for (int i = 0; i < NUM_LEDS; i++) { // 正向扫描灯珠（彩虹推进）
      leds[i] = CHSV(hue++, 255, 255); // 色调渐变，即在颜色轮上生成一个鲜艳纯色（红→橙→绿→蓝→紫→红...）
      FastLED.show();
      fadeall(); // 所有灯珠略微变暗
      delay(10);
    }

    for (int i = NUM_LEDS - 1; i >= 0; i--) { // 反向扫描灯珠（回扫）
      leds[i] = CHSV(hue++, 255, 255);
      FastLED.show();
      fadeall();
      delay(10);
    }

    delay(100); // 循环之间的缓冲延时
  }
}

// 淡出函数
void fadeall() {
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i].nscale8(250); // 渐暗
  }
}

// 暖光
void warmLight() {
  fill_solid(leds, NUM_LEDS, CRGB(255, 150, 50));
  FastLED.show();
}

// 冷光
void coldLight() {
  fill_solid(leds, NUM_LEDS, CRGB(150, 200, 255));
  FastLED.show();
}

// 关闭灯效
void turnOff() {
  fill_solid(leds, NUM_LEDS, CRGB::Black);
  FastLED.show();
}

// 爱心效果
void heartEffect() {
  bool on = true;
  while (true) {
    // 检查是否接收到指令来停止闪烁
    if (mySerial.available()) {
      String interruptCmd = mySerial.readString();
      interruptCmd.trim();

      if (interruptCmd == "close" || interruptCmd == "warm" || interruptCmd == "cold" || interruptCmd == "rainbow") {
        handleCommand(interruptCmd);  // 执行其他指令
        break; // 跳出爱心效果，回到主 loop
      }
    }

    // 先清除所有 LED
    fill_solid(leds, NUM_LEDS, CRGB::Black); // 所有 LED 关闭

    // 绘制红色实心爱心
    for (int i = 0; i < sizeof(heart) / sizeof(heart[0]); i++) {
      leds[heart[i]] = on ? CRGB::Red : CRGB::Black;
    }
    FastLED.show();
    delay(500);  // 每次切换后延时，控制闪烁速度
    on = !on; // 翻转灯光状态，实心红色和关闭
  }
}
```

#### ASR-PRO Voice Recognition Program

Handles voice recognition and command transmission:

#### ASR-PRO Voice Recognition Program

cpp

code.cpp

```cpp
#include "asr.h"
extern "C"{ void * __dso_handle = 0 ;}
#include "setup.h"
#include "myLib/asr_event.h"
#include "HardwareSerial.h"

uint32_t snid;
void ASR_CODE();

//{speak:阿文-温和男声,vol:10,speed:10,platform:haohaodada}
//{playid:10001,voice:}
//{playid:10002,voice:}

/*描述该功能...
*/
void ASR_CODE(){
  switch (snid) {
   case 1:
    Serial.print("rainbow");
    break;
   case 2:
    Serial.print("warm");
    break;
   case 3:
    Serial.print("cold");
    break;
   case 4:
    Serial.print("heart");
    break;
   case 5:
    Serial.print("close");
    break;
  }

}

void hardware_init(){
  setPinFun(13,SECOND_FUNCTION);
  setPinFun(14,SECOND_FUNCTION);
  Serial.begin(9600);
  vTaskDelete(NULL);
}

void setup()
{
  set_wakeup_forever();
  //{ID:0,keyword:"命令词",ASR:"罗纳尔多",ASRTO:"hello Imran"}
  //{ID:1,keyword:"命令词",ASR:"打开彩虹灯",ASRTO:"彩虹灯打开了"}
  //{ID:2,keyword:"命令词",ASR:"暖光",ASRTO:"暖光打开了"}
  //{ID:3,keyword:"命令词",ASR:"冷光",ASRTO:"冷光打开了"}
  //{ID:4,keyword:"命令词",ASR:"爱心",ASRTO:"给你爱心"}
  //{ID:5,keyword:"命令词",ASR:"关灯",ASRTO:"siuuu"}
  dpmu_set_io_pull(pinToFun[13],DPMU_IO_PULL_DISABLE);
  dpmu_set_io_open_drain(pinToFun[13],ENABLE );
}
```

#### Core Algorithm Flow

1

##### Voice Activation

ASR-PRO module detects and processes voice commands.

 ➡️

2

##### Command Parsing

The recognized result is converted into a corresponding command string.

 ⬇️

3

##### Serial Transmission

The command is sent to the Arduino controller via serial communication.

 ➡️

4

##### LED Control

Arduino parses the command and calls the corresponding LED effect function.

 ⬇️

5

##### Effect Display

The WS2812 LED strip displays the corresponding color and dynamic effect.

### Function Demonstration

The voice-interactive LED panel supports 5 voice commands, each corresponding to a different LED lighting effect. The system recognizes Chinese voice commands via the ASR-PRO module and responds in real-time.

#### Complete Function Demonstration Video

Full demo of the voice-interactive LED panel - Showcasing the lighting effects for all 5 voice commands

🌈

#### Rainbow Mode

**Voice Command:** "cai hong" (Rainbow)

**Trigger:** ASR-PRO recognizes ID=1

**Serial Command:** "rainbow"

**Effect:** The LED strip displays a flowing rainbow gradient effect, creating a dynamic visual experience.

**Implementation:** Calculates a 360-degree hue shift in HSV color space to create a moving gradient.

🟡

#### Warm Light Mode

**Voice Command:** "nuan guang" (Warm Light)

**Trigger:** ASR-PRO recognizes ID=2

**Serial Command:** "warm"

**Effect:** The LED strip emits a warm yellow light, suitable for reading and relaxation.

**Implementation:** Sets the RGB value to a warm tone (255, 150, 80) for a comfortable ambiance.

🔵

#### Cold Light Mode

**Voice Command:** "leng guang" (Cold Light)

**Trigger:** ASR-PRO recognizes ID=3

**Serial Command:** "cold"

**Effect:** The LED strip produces a cool, bluish-white light, ideal for work and study.

**Implementation:** Sets the RGB value to a cool tone (180, 200, 255) for clear, bright lighting.

❤️

#### Heart Mode

**Voice Command:** "ai xin" (Heart)

**Trigger:** ASR-PRO recognizes ID=4

**Serial Command:** "heart"

**Effect:** The LED strip lights up in a preset heart-shaped pattern, displaying a pink heart.

**Implementation:** Uses a predefined 'heart' array to control specific pixels and form the shape.

⚫

#### Off Mode

**Voice Command:** "guan bi" (Turn Off)

**Trigger:** ASR-PRO recognizes ID=5

**Serial Command:** "close"

**Effect:** Turns off all LEDs, putting the system into standby.

**Implementation:** Sets the RGB value of all pixels to (0, 0, 0) to turn them off completely.

#### System Performance Metrics

Voice Recognition Accuracy95%+ (at 3-5 meters)

System Response Latency<500ms

Supported Commands5 voice commands

Number of LED Pixels64 (8x8 matrix)

### From 'Voice Switch' to 'Perceptive Companion': A Blueprint for the Smart Light Panel's Future

After completing this project, I've been thinking: my prototype works, but its 'intelligence' is limited. True innovation should break the traditional 'command-execute' paradigm. Based on this, I envision three evolutionary stages for this panel, transforming it from a simple 'tool' into a perceptive, warm 'companion'.

01

#### Depth of Intelligence: From 'Understanding' to 'Perceiving'

Enabling the panel to not just execute commands, but to understand emotions.

##### My Observed Limitation

"My panel understands 'rainbow', but it doesn't understand my fatigue."

##### My Research Direction: Deep Mining Information in Spectrograms

![Voice Signal Spectrogram - The basis of my research on voice feature extraction](https://www.imranjan.cn/images/projects/led-voice-2025/语谱图.png)Voice Signal Spectrogram - The basis of my research on voice feature extraction

I discovered that a simple sound wave can be transformed into an information-rich spectrogram via Fourier transform. This made me realize that voice contains far more information than I imagined. Beyond keywords, I can extract features like pitch variation, energy distribution, and formants, all of which can reflect the speaker's emotional state.

##### My Envisioned Applications

###### Personalized Interaction

I want the system to recognize different users' voice characteristics, including dialects, to provide a personalized interaction experience for everyone.

###### Emotional Awareness

I'm most interested in making the light emotionally aware. For example, if I say 'turn off the light' when I'm tired, the system could detect my fatigue from my tone and switch to a soft, warm light instead of just shutting off. That would be a much warmer interaction.

02

#### Architectural Innovation: From Cloud to Edge

Allowing AI to 'think' on a tiny chip.

##### The Technical Choice I Face: Cloud or Local?

###### Cloud Processing

**Pros:** Powerful computation, easy model updates.

**Cons:** Network latency, privacy concerns, network dependency.

###### Local (Edge) Processing

**Pros:** Fast response, privacy protection, offline functionality.

**Cons:** Hardware limitations, model simplification.

After consideration, I believe local processing is the better choice for smart home scenarios that require instant responses and involve privacy.

##### The Solution I Found: TinyML Technology

![CNN-based amplitude method structure](https://www.imranjan.cn/images/projects/led-voice-2025/基于CNN的振幅方法结构.png)CNN-based amplitude method structure

1

###### Cloud Training

First, train a complex AI model on a computer.

2

###### Model Optimization

Compress the model size using techniques like quantization.

3

###### Embedded Deployment

Deploy the optimized model onto hardware like Arduino.

I'm eager to connect more light panels to a networked AI model, giving even these tiny panels smart analysis capabilities.

03

#### Experience Elevation: From Tool to Art

Giving every beam of light warmth and personality.

##### My Thoughts on User Experience

I find the current LED control to be a bit rigid. I hope to use techniques like Gamma correction in the future to make every light transition feel more natural to the human eye, like a gentle breath.

##### My Ultimate Vision: Generative Light Art

**My Envisioned Evolutionary Path:**

Future light modes shouldn't be limited to a few presets. Instead, they should be able to generate unique light effects in real-time based on my emotions, the rhythm of my voice, or even the ambient music. I found a website called Mozilla Common Voice that provides extensive voice data for various Chinese dialects. I can use this data to train an AI model that allows the light panel to understand dialects from all over China and achieve personalized lighting.

![Mozilla Common Voice - A voice dataset platform I'm following](https://www.imranjan.cn/images/projects/led-voice-2025/Mozilla Common Voice网站截图.png)Mozilla Common Voice - A voice dataset platform I'm following

##### My Vision

I hope that one day, this panel will be more than just a lighting tool. It will be an intelligent companion that understands my emotions and resonates with me, truly evolving from a simple 'voice switch' to a warm 'perceptive companion'.

### Project Summary

This course project successfully completed the design and implementation of a voice-interactive LED light panel system, covering hardware assembly, software programming, and system integration. Through this project, I gained in-depth knowledge of embedded development and voice recognition technology, and achieved a good course grade.

Completion TimeJan 2025 - Feb 2025

Project Grade92

Course Grade93

![Screenshot of course grade](https://www.imranjan.cn/images/projects/led-voice-2025/grade-certificate.png)Screenshot of course grade

#### My Takeaways: Three Things This Project Taught Me Beyond Functionality

1

###### The Essence of Intelligence is 'Perception,' Not 'Execution'

True smart interaction lies in understanding the emotion and personality behind a voice, not just passively decoding commands. It should evolve from a 'tool' into a 'companion'.

2

###### Great Products Require 'Industrial-Grade' Thinking

To move from a fun prototype to a reliable product, one must bridge the gap from 'workshop' development to 'industrial-grade' design, systematically considering real-world engineering challenges like edge computing and model optimization.

3

###### Good Experiences Stem from Respect for 'People'

The ultimate purpose of technology is to serve human feeling. Whether it's a smooth lighting effect that follows the laws of human vision or generative art that creates surprise, the most moving designs are always rooted in a deep understanding of and respect for physical and physiological principles.

I am grateful to Professor Xiao Haibo for his dedicated guidance. I have benefited greatly from this course project.

## Other pages

- [Home](https://www.imranjan.cn/index.md)
- [About me](https://www.imranjan.cn/about.md)
- [Projects](https://www.imranjan.cn/projects.md)
- [Photography](https://www.imranjan.cn/gallery.md)
- [LCIMS Cloud](https://www.imranjan.cn/projects/p-lcims.md)
- [imranjan.cn](https://www.imranjan.cn/projects/p-portfolio.md)
- [Open-source tools](https://www.imranjan.cn/projects/p-open-source.md)
- [Gatehouse](https://www.imranjan.cn/projects/p-gatehouse.md)
- [PlusOne](https://www.imranjan.cn/projects/p-plusone.md)
- [Gantry](https://www.imranjan.cn/projects/p-gantry.md)
- [BYOF Agent](https://www.imranjan.cn/projects/p-byof-agent.md)
- [Shopping Copilot by KI](https://www.imranjan.cn/projects/p-shopping-copilot.md)
- [Look2Act](https://www.imranjan.cn/projects/p-look2act.md)
- [AccessAudit - On-Chain Access Approval & Audit System](https://www.imranjan.cn/projects/p-accessaudit.md)
- [Eye Touch - Real-time Eye Tracking and Gaze Control System](https://www.imranjan.cn/projects/p-eyetouch.md)
- [China Collegiate Computer Competition—Mobile Application Innovation Contest](https://www.imranjan.cn/projects/p-yigui.md)
- [Nilufar Restaurant Expense Management System](https://www.imranjan.cn/projects/p-nilufar.md)
- ["Mengsheng Cup" Electronic Design Competition](https://www.imranjan.cn/projects/p-msb.md)
- [NUS SOC SWS 2024](https://www.imranjan.cn/projects/p-nus.md)

中文版本：https://www.imranjan.cn/zh/projects/p-led.md
