Project tutorial

Reactive Sound Color Changing Cube! © GPL3+

Here We are going to make a light cube which will change color accordingly with surrounding sounds. This work is featured in Hackspace mag

  • 9,712 views
  • 19 comments
  • 71 respects

Components and supplies

Necessary tools and machines

Superglue
White wood
Acrylic

Apps and online services

About this project

Introduction

Today we are going to make a sound reactive wooden cube, which changes color in perfect sync to the surrounding sounds or vibration.

Things required

  • Arduino: I'm using a Nano because of its small size
  • Addressable LED: I'm using UCS1903B, 5V
  • Mic module

Working

  • The sounds will be picked by the microphone module and fed to the Arduino analog input.
  • Then using the received analog values we will change the colors of the LEDs randomly.

Construction

Pictures speak 1000 words! 

test 1

final test

Complete tutorial

Code

CodeC/C++
#include "FastLED.h" //fast led library 
#define NUM_LEDS 10 //total no. of leds used
#define DATA_PIN 5 //digital pin at which the data pin is connected
#define mic A5 //analog input from mic module
int mic_Value; //to save raw value from mic
int red, green, blue; //to store RGB color values
CRGB leds[NUM_LEDS]; //fast led function 

void setup() {
  FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS); //as our led IC is UCS1903B,fast led support lots of ICs, find more
  LEDS.setBrightness(200); //setting brightness of LED (0 to 255) //info at fastled.io
  randomSeed(analogRead(0));// for generating random no. by taking noise from analog pin 0
  for (int i = 0; i <= 9; i++) //for changing color of all 10 LEDs
  {
    leds[i] = CRGB(200, 200, 200); //for initial white color
    LEDS.show(); //fastled function, without this function the colors won't be updated
  }

}

void loop() {

  mic_Value = analogRead(mic); //storing analog values from mic to mic_value
  if(mic_Value>100) //to avoid small noise
  {
    for(int i=0;i<=9;i++)//for changing color of all 10 LEDs
    {
    red=random(255); //random red color value between 0 to 255
    green=random(255); //random green color value between 0 to 255
    blue=random(255); //random blue color value between 0 to 255
    leds[i]=CRGB(red,green,blue); //assigning color values to LEDs
    LEDS.show();
  }
 }
}

Schematics

soundcube_sche_e8rNHAumPl.jpg
Soundcube sche e8rnhaumpl

Comments

Similar projects you might like

Sound Sensor Activated LEDs with LCD for Sound Level Data!

Project tutorial by Heathen_Hacks-v2

  • 1,720 views
  • 4 comments
  • 10 respects

RCar | Robots for All!

Project tutorial by Luís Rita

  • 5,400 views
  • 1 comment
  • 38 respects

Automatizing Percussion with Solenoids: "The Sound Compass"

Project tutorial by touchmysound

  • 4,130 views
  • 4 comments
  • 13 respects

Making Sound Effects with Arduino

Project in progress by Cory Potter

  • 2,112 views
  • 2 comments
  • 8 respects

4*4*4 LED Cube Using Arduino Embedded Prototyping Platform

Project tutorial by STEMpedia

  • 1,697 views
  • 0 comments
  • 9 respects

Touch Sensor and Sound Sensor Controlling AC/DC Lights

Project showcase by Anbumachi

  • 1,454 views
  • 2 comments
  • 7 respects
Add projectSign up / Login