Project tutorial

Earbuds to DuinoBuds OR soundcreator circut © GPL3+

Transform a pair of earbuds/headphones into a useable Arduino device, and make a circut to generate sound!

  • 11 views
  • 1 comment
  • 0 respects

Components and supplies

Male/Male Jumper Wires
×46
Earbuds/headphones
×1
Adafruit industries ada239 image 75px
Solderless Breadboard Full Size
×1
Omron b3f 1000 image 75px
SparkFun Pushbutton switch 12mm
any kind of pushbutton will do, as long as it has a gnd and an INPUT pin in it, but any button--4 pin, 2 pin, short, tall, white, black--will do.
×20
Ardgen mega
Arduino Mega 2560 & Genuino Mega 2560
or any kind of board that has 21 input/outputs
×1

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

First, don't get your hopes up

Okay, most makers know how to solder, which is why I put this in easy. If you don't, and would like to learn, search on the internet. I'm sure lots of tutorials are available. Anyway, this will need soldering, so be ready with your soldering iron at hand.

To start, clarify what your going to do

Today, we will be turning a pair of earbuds or headphones and making them usable in Arduino, and then using them in a small sound circuit.

IF YOU DON'T KNOW HOW TO SOLDER, OR DON"T WANT TO DO THE SOLDERING BIT, SKIP DOWN TO "Building the circuit".

So here's the basic process: to start, we will look at each part of a headphone cord, and figure out which parts we will be using, and what does what. Then, we will take 3-4 wires (depending on your type of headphone/earbuds) and solder them onto the end of the headphone/earbuds, in the correct spots. We will then plug them into the Arduino, and use them to make sound!

The most basic step

This is a test to see if you can complete (one of) the most basic step(s). PLUG IN YOUR SOLDERING IRON. If you can't do that, you shouldn't be doing Arduino.

Now to get serious

Okay, take a look at the end of a headphone cord. Some of them have three bands of metal, some four. Each band controls a different speaker in the earbuds, and the band on the end (whether you have 3 or 4 bands) is gnd. To solder earbuds (I will call them earbuds because that's what I soldered, but they can also be headphones), you need to solder a wire onto each band, without letting the solder touch another band. That would ruin the connection. go carefully and slowly on this part.

Okay, now that we have the earbuds soldered, let's build the circuit...

Building the circut

To start, wire the earbud's gnd to gnd on the breadboard, and the earbud's speaker 1 to 42. Then, place 20 pushbuttons in a row on the breadboard, hook one side of each to gnd on the breadboard, and the other, in order from pin 22 - 41. After that, upload code, and you are done.

I hope to...

  • make a sound recorder: records different sounds I make on the soundcreator and plays them back
  • Print the sound code on the serial monitor
  • make it sound like a voice
  • make a synthesizer out of it 

Code

SoundMaker for speaker/headphone/earbudsC/C++
This code lets you push different buttons, and make sounds. You can press more than one button at a time to make more sounds.
//ALL the button pins
int btn1 = 22;
int btn2 = 23;
int btn3 = 24;
int btn4 = 25;
int btn5 = 26;
int btn6 = 27;
int btn7 = 28;
int btn8 = 29;
int btn9 = 30;
int btn10 = 31;
int btn11 = 32;
int btn12 = 33;
int btn13 = 34;
int btn14 = 35;
int btn15 = 36;
int btn16 = 37;
int btn17 = 38;
int btn18 = 39;
int btn19 = 40;
int btn20 = 41;

//THE HEADPHONE PIN//
//you can do more than one, if you want even MORE sounds
int sndpin = 42

void setup(){
  for(int i = 22; i < 42; i++){
    pinMode(i, INPUT_PULLUP);
  } 
  pinMode(sndpin, OUTPUT);
}

void sndcreation(int delaytime){
  digitalWrite(sndpin, HIGH);
  delay(delaytime);
  digitalWrite(sndpin, LOW);
  delay(delaytime)
}

void loop(){
  for(int i = 22; i < 42; i++){
    if(digitalRead(i) == LOW){
      sndcreation(i);
    }
  }
}

Comments

Similar projects you might like

Water Softener

Project tutorial by moty

  • 227 views
  • 0 comments
  • 5 respects

Know the Temp of Your Home From Anywhere with Arduino Cloud!

Project tutorial by Isaac100

  • 1,193 views
  • 0 comments
  • 9 respects

Simple Obstacle Senor With Arduino

Project tutorial by muhammed shameel k.v

  • 74 views
  • 0 comments
  • 2 respects

Safe City: A Device to Keep You Safe

Project tutorial by Patel Darshil

  • 572 views
  • 0 comments
  • 5 respects

Scavenger Hunt Clues w/ Telephone Keypad

Project tutorial by Sam Horne

  • 902 views
  • 0 comments
  • 3 respects
Add projectSign up / Login