BnTie
Published

Hacking Headphones

I love speakers, but actually have not done much with them. I have several, but I have always loved listening to music or audio.

IntermediateProtip5,849
Hacking Headphones

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
×1
Jumper wires (generic)
Jumper wires (generic)
×3
computer to arduino board cable
×1
headphones/earbuds
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
solder (small)
Soldering arms (optional, makes easier)

Story

Read more

Schematics

Headphone Hack Circuit

This is the circuit for my headphone hack. Please note that the red is right and the green is left speaker. Also, the ends touching the headphone jack must be soldered.
File missing, please reupload.

Code

Untitled file

C/C++
//The code for my headphone hack design.
//This will only make it beep


//the pin's names
int rightSpeaker = 9;
int leftSpeaker = 10;

void setup(){
  pinMode(rightSpeaker, OUTPUT);
  pinMode(leftSpeaker, OUTPUT);
}

void beep(){
  //if run over and over, this will make a beep in the headphones.
  
  //make the two speakers HIGH
  digitalWrite(rightSpeaker, HIGH);
  digitalWrite(leftSpeaker, HIGH);
  
  //delay for 1 millisecond
  delay(1);
  
  //make the two speakers LOW
  digitalWrite(rightSpeaker, LOW);
  digitalWrite(leftSpeaker, LOW);
  
  //wait one millisecond
  delay(1);
}


void loop(){
  beep();
}

Credits

BnTie

BnTie

2 projects • 1 follower

Comments