2856 views|31 replies

3386

Posts

0

Resources
The OP
 

[Flower carving DIY] Interesting and fun music visualization project (11) --- WS2812 fantasy light strip [Copy link]

 

I had the urge to do a series of topics on sound visualization. This topic is a bit difficult and covers a wide range of areas. The related FFT and FHT algorithms are also quite complicated, but I still plan to start with the simplest ones, do some experiments, try various solutions patiently, gradually accumulate some useful music spectrum visualization materials, and strive to form some practical and fun music visualizer projects.

[Flower carving DIY] Interesting and fun music visualization project (11) --- WS2812 fantasy light strip

This post is from DIY/Open Source Hardware

Latest reply

Tie this to a motorcycle, and when the front of the motorcycle tilts up, the devil will smile.  Details Published on 2022-7-19 13:44
 

6075

Posts

6

Resources
2
 

What is the power supply voltage of the WS2812 colorful light strip? Is it also PWM controlled?

This post is from DIY/Open Source Hardware

Comments

Most of them are powered by 5V or 12V, and multiple lights are connected in series with a single bus control  Details Published on 2022-7-15 06:53
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 

6841

Posts

11

Resources
3
 

Let's make something that can display images dynamically to demonstrate it.

This post is from DIY/Open Source Hardware

Comments

Thank you for the encouragement  Details Published on 2022-7-15 06:53
 
 
 

3386

Posts

0

Resources
4
 
Qintianqintian0303 posted on 2022-7-14 21:30 What is the power supply voltage of the WS2812 fantasy light strip? Is it also PWM controlled?

Most of them are powered by 5V or 12V, and multiple lights are connected in series with a single bus control

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
5
 
lugl4313820 posted on 2022-7-14 23:57 Let's make something that can display images dynamically to show you.

Thank you for the encouragement

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
6
 
This post was last edited by eagler8 on 2022-7-15 07:16

WS2812B
is an intelligent externally controlled LED light source that integrates control circuit and light-emitting circuit. Its appearance is the same as a 5050LED lamp bead, and each component is a pixel. The pixel contains an intelligent digital interface data latch signal shaping and amplification drive circuit, a high-precision internal oscillator and a 12V high-voltage programmable constant current control part, which effectively ensures that the color of the pixel light is highly consistent. The data protocol adopts a single-line return-to-zero code communication method. After the pixel is powered on and reset, the DIN end receives the data transmitted from the controller. The first 24-bit data sent is extracted by the first pixel and sent to the data latch inside the pixel. The remaining data is shaped and amplified by the internal shaping processing circuit and then forwarded to the next cascaded pixel through the DO port. After each pixel is transmitted, the signal is reduced by 24 bits. The pixel adopts automatic shaping and forwarding technology, so that the number of cascades of the pixel is not limited by signal transmission, but only by the signal transmission speed requirement.

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
7
 

Main features
1. Intelligent reverse connection protection, reverse connection of power supply will not damage IC.
2. IC control circuit and LED point light source share a power supply.
3. Control circuit and RGB chip are integrated in a 5050 package component to form a complete externally controlled pixel.
4. Built-in signal shaping circuit, any pixel receives the signal and then outputs it after waveform shaping, ensuring that line waveform distortion will not accumulate.
5. Built-in power-on reset and power-off reset circuits.
6. The three primary colors of each pixel can achieve 256 levels of brightness display, complete 16777216 colors of true color display, and the scanning frequency is not less than 400Hz/s.
7. Serial cascade interface, which can complete data reception and decoding through a signal line.
8. No circuit needs to be added when the transmission distance between any two points does not exceed 5 meters.
9. When the refresh rate is 30 frames/second, the number of cascades is not less than 1024 points.
10. The data transmission speed can reach 800Kbps.
11. The color of light is highly consistent and cost-effective.

Application fields
It has the advantages of low voltage drive, environmental protection and energy saving, high brightness, large scattering angle, good consistency, ultra-low power, and ultra-long life. By integrating the control circuit on the LED, the circuit becomes simpler, the volume is small, and the installation is easier. The main application fields are LED full-color luminous character light string, LED full-color module, LED full-color soft light bar hard light bar, LED guardrail tube. LED point light source, LED pixel screen, LED special-shaped screen, various electronic products, electrical equipment marquee, etc.

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
8
 

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
9
 

WS2812B lamp power schematic

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
10
 

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
11
 

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
12
 

WS2812B is an LED light source element that integrates control circuit and light-emitting circuit. Its control IC is WS2812B, the light-emitting element is 5050RGBLED, the voltage is 5V, the peak current of each unit is 60ma, the light strip is a three-wire system, VCC GND DIN are power +, power -, signal respectively. When using an external power supply, the external power supply - needs to be connected to the GND of the microcontroller.

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
13
 

The MAX9814 is a low-cost, high-quality microphone amplifier with automatic gain control (AGC) and low-noise microphone bias. The device features a low-noise preamplifier, variable-gain amplifier (VGA), output amplifier, microphone bias voltage generator, and AGC control circuitry. The

low-noise preamplifier has a fixed 12dB gain, while the VGA gain automatically adjusts from 20dB to 0dB based on the output voltage and AGC threshold. The output amplifier provides selectable gains of 8dB, 18dB, and 28dB. Cascading the amplifiers results in a total gain of 40dB, 50dB, or 60dB without compression. A three-level digital input programs the gain of the output amplifier. An external resistor divider controls the AGC threshold, and a single capacitor sets the attack/release times. A three-level digital input programs the ratio of the attack time to the release time. The hold time of the AGC is fixed at 30ms. The low-noise microphone bias voltage generator can bias most electret microphones.

The MAX9814 is available in a space-saving 14-pin TDFN package. The device is rated for operation over the -40°C to +85°C temperature range.

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
14
 

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
15
 

MAX9814 Microphone Amplifier Module The
MAX9814 is a low-cost, high-performance microphone amplifier with automatic gain control (AGC) and low-noise microphone bias. The device features a low-noise front-end amplifier, a variable gain amplifier (VGA), an output amplifier, a microphone bias voltage generator, and an AGC control circuit.
●Automatic gain control (AGC)
●3 gain settings (40dB, 50dB, 60dB)
●Programmable action time
●Programmable action and release time ratio
●Supply voltage range 2.7V ~ 5.5V
●Low THD: 0.04% (typical)
●Low power shutdown mode
●Built-in 2V low-noise microphone bias

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
16
 

[Flower carving hands-on] Interesting and fun music visualization project (11) --- WS2812 colorful LED light strip
Experimental procedure 1: Simple sound level measurement
module wiring:
MAX9814 Arduino
VCC 5V
GND GND
OUT A0

/*
  【花雕动手做】有趣好玩的音乐可视化项目(11)---WS2812幻彩LED灯带
  实验程序一:简易测量声级
  模块接线:
  MAX9814  Arduino
  VCC        5V
  GND        GND
  OUT         A0
*/

const int sampleWindow = 50; // 以mS为单位的采样窗口宽度(50 mS = 20Hz)
unsigned int sample;

void setup() {
  Serial.begin(9600);
  pinMode(A0, INPUT);
}


void loop() {
  unsigned long startMillis = millis(); // 样本窗口的开始
  unsigned int peakToPeak = 0;   // 峰峰值

  unsigned int signalMax = 100;
  unsigned int signalMin = 1024;

  // collect data for 50 mS
  while (millis() - startMillis < sampleWindow)
  {
    sample = analogRead(A0);
    if (sample < 1024)  // 抛出错误的读数
    {
      if (sample > signalMax)
      {
        signalMax = sample;  // 只保存最大级别
      }
      else if (sample < signalMin)
      {
        signalMin = sample;  // 仅保存最低级别
      }
    }
  }
  peakToPeak = signalMax - signalMin;  // max-min =峰峰值幅度
  double volts = (peakToPeak * 5.0) / 256;  // 转换为伏特

  Serial.println(volts);
}

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
17
 

Open Arduino IDE - Tools - Serial Port Plotter to view the experimental waveform

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
18
 

Actual measurement of ambient noise and the sound waveform of hand tapping on the desktop

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
19
 

Measured waveform of playing songs

This post is from DIY/Open Source Hardware
 
 
 

3386

Posts

0

Resources
20
 

[Flower carving hands-on] Interesting and fun music visualization project (11) --- WS2812 colorful LED light strip
experiment procedure 2: threshold-triggered rhythm light

/*
  【花雕动手做】有趣好玩的音乐可视化项目(11)---WS2812幻彩LED灯带
  实验程序二:阙值触发的节奏灯
*/

#include<FastLED.h>
#define LED_PIN 6
#define NUM_LEDS 24

CRGB leds[NUM_LEDS];
uint8_t hue = 0;
int soundsensor = 7;

void setup() {
  delay(2000);
  Serial.begin(9600);
  FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(50);
  pinMode(soundsensor, INPUT);
}

void loop() {
  int sensval = digitalRead(soundsensor);

  if (sensval == 1) {
    Serial.println("ON");
    leds[0] = CRGB :: Red;
    fill_solid(leds, NUM_LEDS, CRGB :: Blue);
    rainbow_moving();
    FastLED.show();
    delay(10);
  }
  else {
    leds[0] = CRGB :: Black;
    fill_solid(leds, NUM_LEDS, CRGB :: Black);
    FastLED.show();
    delay(10);
  }
}

void rainbow_moving() {
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CHSV(hue + (i * 10), 255, 255);
  }
  EVERY_N_MILLISECONDS(10) {
    hue++;
  }
}

This post is from DIY/Open Source Hardware
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list