Sound Reactive RGB LED strip with ESP8266 with screen reactive

Sound Reactive RGB LED strip with ESP8266 with screen reactive Sound Reactive RGB LED strip with ESP8266 with screen reactive

As everyone wants to make there room creative than others, one thing which comes under the main factor is lighting. Now a days lighting became a decorative mandatory thing for every homes, restaurants and offices. Mainly for gamers and tech lovers RGB lighting is their love. So taking that into consideration we came up with new creative sound or music sensitive LED lighting which reacts with sound on your PC or Laptop. This has an ambient light feature with amazing colors.

Advanced version: DIY Smart LED strip with Sound reactive effects using ESP8266 ESP32 WiFi

BONUS: This project also includes an amazing screen responsive RGB LED lighting in which our LED light will change according to the screen colors and intensity of the screen areas. Then why late lets get started with required components.

Required components:

  • 1 X Node MCU(ESP8266) or you can use Arduino UNO or nano

nodemcu development board

  • 1 X RGB Neopixel Led strip WS2811 or WS2812b
  • 5v power supply for Nodemcu and led strip
  • Cables for connectivity (USB cable to connect to pc or laptop), (Small wires for circuit)

Circuit Diagram:

This is a very simple circuit ever where you need only 3 wires to connect the led strip to the nodemcu. Connect the wires as shown below.

sound reactive led light circuit diagram nodemcu

Software and Coding:

Software’s Required:

  • Arduino IDE for code uploading Download link here
  • Fast LED library on Arduino IDE
  • Prismatik light pack here

Code to upload:

Note:

If you are not aware of how to upload a code into a development board click here.

To know how to install a library into development board with Arduino IDE click here.

/*
 * Arduino interface for the use of WS2812 strip LEDs
 * Uses Adalight protocol and is compatible with Boblight, Prismatik etc...
 * "Magic Word" for synchronisation is 'Ada' followed by LED High, Low and Checksum 
 * @library: FastLED v3.001
 */
#include "FastLED.h"
// Enter number of LED's connected in the strip
#define NUM_LEDS 50 
// the pin number LED's data pin on Nodemcu
#define DATA_PIN 1  

// Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf)
#define serialRate 115200

// Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel data
uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;

// Initialise LED-array
CRGB leds[NUM_LEDS];

void setup() {
  // Use NEOPIXEL to keep true colors
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  
  // Initial RGB flash
  LEDS.showColor(CRGB(255, 0, 0));
  delay(500);
  LEDS.showColor(CRGB(0, 255, 0));
  delay(500);
  LEDS.showColor(CRGB(0, 0, 255));
  delay(500);
  LEDS.showColor(CRGB(0, 0, 0));
  
  Serial.begin(serialRate);
  // Send "Magic Word" string to host
  Serial.print("Ada\n");
}

void loop() { 
  // Wait for first byte of Magic Word
  for(i = 0; i < sizeof prefix; ++i) {
    waitLoop: while (!Serial.available()) ;;
    // Check next byte in Magic Word
    if(prefix[i] == Serial.read()) continue;
    // otherwise, start over
    i = 0;
    goto waitLoop;
  }
  
  // Hi, Lo, Checksum  
  while (!Serial.available()) ;;
  hi=Serial.read();
  while (!Serial.available()) ;;
  lo=Serial.read();
  while (!Serial.available()) ;;
  chk=Serial.read();
  
  // If checksum does not match go back to wait
  if (chk != (hi ^ lo ^ 0x55)) {
    i=0;
    goto waitLoop;
  }
  
  memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
  // Read the transmission data and set LED values
  for (uint8_t i = 0; i < NUM_LEDS; i++) {
    byte r, g, b;    
    while(!Serial.available());
    r = Serial.read();
    while(!Serial.available());
    g = Serial.read();
    while(!Serial.available());
    b = Serial.read();
    leds[i].r = r;
    leds[i].g = g;
    leds[i].b = b;
  }
  
  // Shows new values
  FastLED.show();
}

So after installing the code onto the NodeMCU, Install Prismatik on your pc or laptop download links provided above.

prismatik install1

Choose Ada light and click next

In the next dialogue box choose the serial port of which the nodemcu is connected and choose the baud rate mentioned on the code 115200, and finally color code as GRB. and press next.

At the end of the setup you will find a zone placement wizard where you can set the screen positions of LED lights where the lights should get the color and intensity from those areas and choose the number of light and click arrange and then finish setup thats it.

prismatik install3The sound reactive LED strip is ready with ambient light and screen reactive features.

You can Turn this RGB LED light into ambient light, screen responsive light and also sound reactive which is cool and your friends or colleagues will be in shock. You can access many cool features through the prismatick dashboard.

prismatik install dashboardIf you enjoyed this project please share your friend through the social media and please subscribe our youtube channel “CircuitSchools” for more creative content and if you have any doubts regarding the above project please comment below.

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *