BPM'S: Beats Per Mile Sneakers
Whenever im walking and I hear the tempo of my own footsteps, i'll start to make a beat in my head to go along with it. One day I thought 'What if my shoes actually made these sounds when i take a step?'. This sparked the idea of this project, to put speakers into my shoes and make them play a drum beat with every step taken.
Supplies
2 - Speakers (small enough to fit in your sole)
2 - Shoes (soles big enough to fit electronics)
2 - Buttons (strong enough to be stepped on and not break)
3 - LED lights (preferably Green, Orange & Red to indicate speed)
1 - Potentiometer (with knob to go on top)
1 - Arduino UNO (to control everything)
1 - MicroSD module (plays & reads mp4 files)
1 - Battery Pack (4 x AA)
Long Wires (Length of your legs plus a little more)
Short Wires (connect electronics in the shoes)
Tools - Superglue, Stanley Knife, Soldering Kit, Markers or other crafts stuff
Concept
The initial concept was to put four buttons in the shoes, two at the heel (for the Bass & Snare) and two at the toes (for the Hi-Hat). This however became a problem once I realised that your toes touch the ground almost immediatly after your heels, this would create a very strange beat and wouldn't work which is why I instead chose to implement only two buttons. This sadly gets rid of the impatient cymbal that would've played if you tapped your foot, but that was merely a fun extra function and not the core of the idea.
Secondly I chose to change the volume meter to a tempo meter, this would make it easier to code the different tempo's you could walk. I also added three different coloured LED lights to compliment this change, these will indicate the speed at which you walk
(Green = Slow, Orange = Medium, Red = Fast).
Finally I decided to put the potentiometer and LED's on the shoes instead of with the Arduino on the hip, this would compliment and elevate the design seeing as it fits the whole sounds/audio look they have.
Writing the Code
Format for MP4 files:
8-bit
11025 Hz
mono
name the sound files '1.wav' through '6.wav', the code will call upon only these names. Example: '1.wav' and '2.wav' will be the bass and snare for the slow state. '3.wav and '4.wav 'are for medium state, etc.
Include these libraries in your Arduino software:
SD
SPI
TRMpcm
Code: copy this into the Arduino Software, press ctrl + t to format everything accordingly
//these include all necessary libraries
#include <pcmConfig.h>
#include <pcmRF.h>
#include <TMRpcm.h>
#include <SPI.h>
#include <SD.h>
#define SD_ChipSelectPin 4
TMRpcm tmrpcm;
//these define pin inputs
const int buttonPin = 2;
int buttonState = 0;
int LEDg = 5;
int LEDr = 7;
int LEDy = 6;
const int buttonPin1 = 8;
int buttonState1 = 0;
int State = 0;
int State1 = 0;
void setup() {
Serial.begin(9600);
pinMode(buttonPin, INPUT);
pinMode(buttonPin1, INPUT);
pinMode(LEDg, OUTPUT);
pinMode(LEDr, OUTPUT);
pinMode(LEDy, OUTPUT);
//checks if SD fails and determines speaker volume
tmrpcm.speakerPin = 9;
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD fails");
return;
}
tmrpcm.setVolume(6); }
void loop() {
tmrpcm.stopPlayback();
int POD = map(analogRead (A0), 0 , 666, 0, 255 );
buttonState = digitalRead(buttonPin);
buttonState1 = digitalRead(buttonPin1);
//Determines if button is pressed and plays sound file, SLOW STATE
if (POD < 86) {
digitalWrite(LEDg, HIGH);
if (State == 0 && buttonState == 1) {
State = 1;
tmrpcm.play("1.wav");
delay(620);
}
if (State1 == 0 && buttonState1 == 1 ) {
State1 = 1;
tmrpcm.play("2.wav");
delay(620);
}
}
else {
digitalWrite(LEDg, LOW);
}
//Determines if button is pressed and plays sound file, MEDIUM STATE
if (85 < POD && POD < 171) {
digitalWrite(LEDy, HIGH);
if (State == 0 && buttonState == 1) {
State = 1;
tmrpcm.play("3.wav");
delay(620);
}
if (State1 == 0 && buttonState1 == 1 ) {
State1 = 1;
tmrpcm.play("4.wav");
delay(620);
}
}
else {
digitalWrite(LEDy, LOW);
}
//Determines if button is pressed and plays sound file, FAST STATE
if (170 < POD ) {
digitalWrite(LEDr, HIGH);
if (State == 0 && buttonState == 1) {
State = 1;
tmrpcm.play("5.wav");
delay(500);
}
if (State1 == 0 && buttonState1 == 1 ) {
State1 = 1;
tmrpcm.play("6.wav");
delay(500);
}
}
else {
digitalWrite(LEDr, LOW);
}
if (State == 1 && buttonState == 0 ) {
State = 0;
}
if (State1 == 1 && buttonState1 == 0 ) {
State1 = 0;
}
return;
}
Wiring the Electronics
To test the electronics and if the code works, connect everything to a breadboard. This will keep a simple overview and make it easier to change and correct things that arent working. Some electronics will already need to have wires soldered on to test (speakers & potentiometer).
Simply copy the fritzing schematic shown and everything should be working.
This would also be the moment to choose which sounds you would like to implement, just make sure the hi-hat sounds plays along with your bass or snare otherwise the beat wont make sense.
Preparing the Electronics (and Shoes)
In order to implement your electronics you will first need to make sure certain parts are wired correctly, if this part of the process goes wrong then you are going to have a hard time with your hardware further along the line.
Simply solder on all the corresponding wires and resistors like the picture (if unclear check previous schematic to see what goes where), some parts should already be wired in order to be tested (speakers & potentiometer).
Prepare the shoes by cutting out holes where your electronics are going to sit, this can be done easily with a stanley knife. Make sure to choose the thinnest part of the shoe for where your wires will run through. Also pay attention that you don't cut too deep, you still want to be able to fit inside the shoe.
Implementing the Electronics Into the Shoe
Now comes the part where you fit in all the electronics into the holes you've carved out, try to do this as careful as possible, escpecially with the wires. It helps to cut the plastic protection off your wires if they have any, this will make them through the holes much easier.
Do no start securing the electronics permanently yet! This will only be annoying later on.
You can however already start connecting certain wires to eachother, all wires running to your GROUND and VOLT can be connected. Check the schematic in the next step if you're uncertain which one's can connect.
Make sure you don't connect wires running to DIGITAL pins to the VOLT, these need to stay seperate.
Testing the Implementation
The next step is to test if you implemented the electronics correctly, to do this you simply need to connect the wires according to the shown schematic. This is also a reference for which wires can be connected to eachother, the GROUND and VOLT wires need to be connected at the top so they can split to each shoe. At the bottom you should also connect the GROUND and VOLT wires to keep the wires running up your leg to a minimum.
If all goes according to plan your shoes should work the same as in the video.
Add the Longer Wires
The next step will be the easiest, you have to run the long wires from the Arduino to the shoes. These wires should be long enough to wear the Arduino comfortably at belt height whilst wearing the shoes. Try to keep the wires grouped seperately to each corresponding shoe.
What would also help is colour coordinating these wires, along with making a cheat sheet. This helps to keep track of what goes where for everytime you need to unplug and replug everything to take off the shoes, You'll need to unplug them because your going to be running wires along the inside of your pants, and shoes usually don't fit through pant legs.
Securing Everything in Place
Now if all is still working correctly, it's time to secure everything into place mainly using superglue. Secure the button directly under where your heel touches the shoe, then push the wires as far back against the shoe as possible. Keeping them all together helps when putting the shoes on. Also try to secure the electronics (speakers & potientiometer), you probably wont need to secure the LED's but you still can.
Try to make a housing for your Arduino, keeping everything compact and secure. You can design an elaborate 3D model to 3D print or you can use stuff from around the house. I chose to make an impromptu housing with a plastic card deck case, cutting holes for all the wire entry points and putting the MicroSD module in there as well. It would be smart to put your battery pack on the outside so it will be easy to replace them later on. Adding a clip onto the housing so you can wear it on your belt is also possible, otherwise you can simply keep it in your pocket.
Organize the Wires
This part is a little tedious but very necessary, sorting all the wires to their seperate shoes. This will make the wires easier to find & secure and harder to break. Just make sure they're the right length.
It would also help to mark which wire belongs to which side, i've marked mine at the top and at the bottom. The wires connecting to the Arduino directly will still be fragile so use caution when handling it.
Lastly you could cover the wires in some tape to conceal them, but seeing as you're already going to be wearing them inside your pants this part isn't really necessary.
The Best Part: Customize!
This is the most fun part of the whole project, actually making the shoes look cool!
Firstly you should cover up any hole around the electronics that are showing, I found some black hair elastics that fit perfectly around the speakers so I simply glued them on it looks seamless. For the potentiometer you could cut a small donut (preferably out of some plastic paper), colour it black and slide it over. You will need to remove the tempo knob before doing so but this comes off very easily, just make sure you don't pull out the entire electronic! Try to cover the wires by your feet by pulling them into your pants, this isn't a necessity but it looks a lot cleaner.
Finally you could add some design on the side of the sneakers to really sell it, I chose to add sound bars on the side because the sole has some grooves carved into them already, this compliments the design very well.
Put Them On!
Now you can finally put on your sneakers!
Slide the wires through your pant legs, connect them at the bottom with the corresponding colours, and put the Arduino housing in your pocket (or clip it on your belt if you can) and you're good to go.
Depending on your tempo you can turn the knob, the light will change to your speed and you can run along little drummer boy.