typalowski
Published

Rubber Chicken Subwoofer

Make a Bluetooth speaker that works on rubber chickens, phase one is to make a subwoofer from said rubber chickens.

IntermediateShowcase (no instructions)3,963
Rubber Chicken Subwoofer

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
This is just what I used. Will also work with nano, uno, etc.
×1
Perma-Proto Breadboard Half Size
Perma-Proto Breadboard Half Size
×1
DFRobot Audio Analyzer
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Circuit Diagram

Use 12v Power Supply, 30N06L Mosfet, and 4006 Zener Diode

Code

Solenoid code.

C/C++
Code to activate solenoid(s) based on defined frequencies.
#include <AudioAnalyzer.h>

#define msgRST 12
#define msgStrobe 13
#define msgAnalog 0
Analyzer Audio = Analyzer(10, 11, 0); //Strobe pin ->10  RST pin ->11 Analog Pin ->0


int LEDpins[7] = {2, 3, 4, 5, 6, 7, 8};
int FreqVal[7] = {63, 160, 400, 1000, 2500, 6250, 16000};

void setup()
{
  Serial.begin(57600);  //Init the baudrate
  Audio.Init();         //Init module

  for (int x = 0; x < 7; x++) {
    pinMode(LEDpins[x], OUTPUT);
  }
  pinMode(msgRST, OUTPUT);
  pinMode(msgStrobe, OUTPUT);
}


void loop()
{
  Audio.ReadFreq(FreqVal);      //return 7 value of 7 bands pass filter
  //Frequency(Hz):63  160  400  1K  2.5K  6.25K  16K
  //FreqVal[7]:      0    1    2    3    4    5    6
  digitalWrite(msgRST, HIGH);
  delay(20);
  digitalWrite(msgRST, LOW);

  for (int x = 0; x < 7; x++)
  {
    digitalWrite(msgStrobe, LOW);
    delayMicroseconds(20);
    int spectrumRead = analogRead(0);
    int PWMvalue = map(spectrumRead, 0, 1024, 0, 255);
    if (PWMvalue < 75)
      PWMvalue = PWMvalue / 100;
    analogWrite(LEDpins[x], PWMvalue);
    digitalWrite(msgStrobe, HIGH);

    
    Serial.print(max((FreqVal[x] - 100), 0));     //Transmit the DC value of the seven bands
    if (x < 6)  Serial.print(",");
    else Serial.println();
  }



}

Credits

typalowski

typalowski

1 project • 23 followers

Comments