Close
0%
0%

Center Surround Sound

Make You The Center of Your World

Similar projects worth following

When settling speakers in to place, you are idealizing that you will always sit dead center .. yet in our more lethargic reality, we lounge off-center. As consequence, you cease being the center of the speaker array .. until now ..

Notations
1. Intended to create an app with MIT App Inventor .. how ever .. per the previous HaD FP (Voice Kitchen Faucet) .. it was decided to employ an alternative favored open source (-ish) voice command software http://voiceattack.com purely as demonstration.
2. Adding additional speakers merely requires copy-paste and if-statement modifications .. tho ideally a more advanced 'find' function upon installation would be coded.
3. Variances of % may depend on wattage (See #4)
4. Higher voltage systems would subsequently require HV digital potentiometers (AD7376)
5. Why is this .. not already a thing?!

Archive
https://hackaday.io/project/160842-center-surround-sound
https://www.thingiverse.com/thing:3085630
http://vijemiller.com/index.php?entry=entry180912-181941

Standard Tesselated Geometry - 129.96 kB - 09/05/2018 at 23:21

Download

  • 2 × NodeMCU ESP8266 ESP-12E V2
  • 2 × X9C104 Digital Potentiometer Module
  • 2 × 5V Power Supply
  • 2 × (4) Terminals
  • 2 × 4 Pin Dip Switch

View all 6 components

  • Speaker Code (Each)

    Vije Miller09/05/2018 at 18:41 0 comments

    // Center Surround Sound
    // Speaker NodeMCU Code
    // Vije Miller
    
    #include <ESP8266WiFi.h>
    #include <DigiPotX9Cxxx.h>
    
    // Set Static IP Per Speaker
    // Ex. 20 = Center Left Speaker
    IPAddress ip(192, 168, 1, 20);
    
    IPAddress gateway(192, 168, 1, 1);
    IPAddress dns(192, 168, 1, 1);
    IPAddress subnet(255, 255, 255, 0);
    const char* ssid = "ssid";
    const char* pass = "password";
    
    WiFiServer server(80);
    
    // LED
    int led = D0;
    
    DigiPot pot(4, 5, 6);
    volatile int i = 0;
    // Start at 75%
    int wiper = 75;
    int peak = 75;
    
    // Speaker Dip Switch
    int dipone = 1;
    int diptwo = 2;
    
    void setup() {
      Serial.begin(115200);
    
      pinMode(dipone, INPUT);
      pinMode(diptwo, INPUT);
      if (digitalRead(dipone) == HIGH) {
        int dip = 1;
      } else if (digitalRead(diptwo) == HIGH) {
        int dip = 2;
      }
    
      pinMode(led, OUTPUT);
      digitalWrite(led, LOW);
    
      // Connect
      Serial.println(ssid);
      WiFi.config(ip, gateway, subnet, dns);
      WiFi.mode(WIFI_STA);
      WiFi.begin(ssid, pass);
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
      Serial.println("Connected");
      server.begin();
      Serial.print("http://");
      Serial.print(WiFi.localIP());
      Serial.println("/");
    }
    
    void loop() {
      // Active LED
      digitalWrite(led, LOW);
      // Check
      WiFiClient client = server.available();
      if (!client) {
        return;
      }
      // Wait
      while (!client.available()) {
        delay(1);
      }
      // Read
      String query = client.readStringUntil('\r');
      client.flush();
      if (query.indexOf("/center") != -1)  {
        center();
      }
      if (query.indexOf("/left_center") != -1)  {
        left_center();
      }
      if (query.indexOf("/right_center") != -1)  {
        right_center();
      }
      if (query.indexOf("/left_off_set") != -1)  {
        left_off_set();
      }
      if (query.indexOf("/right_off_set") != -1)  {
        right_off_set();
      }
      delay(1);
    }
    
    void center() {
      digitalWrite(led, HIGH);
      // Zero All Speakers
      if (wiper < peak) {
        for (i = wiper; i < peak; i++) {
          pot.increase(1);
          delay(5);
        }
      } else if (wiper > peak) {
        for (i = wiper; i > peak; i--) {
          pot.decrease(1);
          delay(5);
        }
      }
    }
    
    void left_center() {
      digitalWrite(led, HIGH);
      // 1 = Decrease -15
      // 2 = Increase +15
      if (dip == 1) {
        int lc = 60
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      } else if (dip == 2) {
        int lc = 90
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      }
    }
    
    void right_center() {
      digitalWrite(led, HIGH);
      // 1 = +15
      // 2 = -15
      if (dip == 1) {
        int lc = 90
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      } else if (dip == 2) {
        int lc = 60
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      }
    }
    
    void left_off_set() {
      digitalWrite(led, HIGH);
      // 1 = -25
      // 2 = +25
      if (dip == 1) {
        int lc = 50
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      } else if (dip == 2) {
        int lc = 100
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      }
    }
    
    void right_off_set() {
      digitalWrite(led, HIGH);
      // 1 = +25
      // 2 = -25
      if (dip == 1) {
        int lc = 100
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      } else if (dip == 2) {
        int lc = 50
        if (wiper < lc) {
          for (i = wiper; i < lc; i++) {
            pot.increase(1);
            delay(5);
          }
        } else if (wiper > lc) {
          for (i = wiper; i > lc; i--) {
            pot.decrease(1);
            delay(5);
          }
        }
      }
    }

  • Voice Attack vs MIT App Inventor

    Vije Miller09/04/2018 at 05:10 0 comments

    Originally had intended to create an app using MIT App Inventor 2 .. but due to my dislike of coding .. and pre-existing automation voice software .. the decision was made to turn to voice.

    Then (pause) due to the previous HaD FP being scrutinized for voice command software .. the decision was made to make use of my favorite alternative open source (ish) voice command program http://voiceattack.com and subsequently demonstrate how to apply it here on Project CSS:

    MIT App Inventor Alternative

  • On The Case

    Vije Miller09/01/2018 at 18:42 0 comments

View all 3 project logs

  • 1
    Step 1

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates