Introduction: Interactive Dancing Socks
Pascal Ziegler, Maike Maas
for the course "Physical Computing" at the chair of Prof. Dr. Jürgen Steimle, Saarland University.
In this project we introduce interactive dancing socks which can aid dancing pairs to learn choreography in an simple and intuitive manner. We equipped the socks with pressure sensors and vibration motors to monitor and guide the feet movement of the pair dancers. These are controlled by a master application running on an Android phone. The steps are indicated by vibration signals at specific positions of the foot, at the heel for a forward step, etc. When a user makes a mistake or gets out of sync, negative feedback is provided. We shortly evaluated the number of haptic signals and their corresponding intensity that can be distinguished by foot and processed by the brain. This led us to the decision to use 5 vibration motors. It is possible to dance in the socks for several minutes without making a mistake.
Our goal is to increase the quality of dancing lessons in general. In dancing classes, students learn many new steps in a short period of time. Often it is hard for them to translate the theoretical movement into dancing steps synchronized to music and rhythm. Unfortunately, dancing teachers don’t have the time or students not the money for 1-to-1 supervision, especially concerning repetitive instructions, which can result in frustration of both sides. We hope to help pair dancing students learn easier, less frustrating, funnier and reduce the workload for teachers.
The project was part of the course "Physical Computing" at Saarland University, taught by Prof. Dr. Jürgen Steimle (Lecture page).
List of Materials
- Arduino Nano (2x)
- Pair of woolen socks
- Pair of tight socks
- 9V battery and connection with switch (2x)
- Sewing materials
- Wire and soldering materials
- Android phone with Bluetooth
- FSR Sensor (2x) (https://www.sparkfun.com/products/9375)
- Bluetooth module (HC-05) (2x)
- Soldering Plate
- Resistors: 10 kΩ (2x), 1 kΩ (10x)
- Vibration motors (10x) (https://www.sparkfun.com/products/8449)
- 1N4001 diode (10x)
- 0.1 µf ceramic capacitor (10x)
- 2N2222 transistor (10x)
- Mini USB cable for programming
Step 1: Prepare the Socks
As the tight socks will be worn above the woolen ones, make sure they match tightly. This is important as they make sure the user can feel the vibration feedback delivered by the vibration motors.
Step 2: Composition and Soldering
The soldering plan is shown in the images. The power supply is connected to Vin and the ground pin beside.
For the HC-05, we use software serial library to make pin D10 & D11 as Tx & Rx instead of using the default Rx and Tx. So connect RXD to D11 and TXD to D12, connect VCC to 5V and GND to ground.
To connect the FSR, we use a pull-down resistor. If the resistance of the FSR decreases, the total resistance of the FSR and the pulldown resistor decreases from about 100KΩto 10 kΩ. That means that the current flowing through both resistors increases which in turn causes the voltage across the fixed 10 kΩ resistor to increase. We connect the FSR to A0.
We need to connect a diode (a 1N4001) reverse biased in parallel to the motor because the diode acts as a surge protector against voltage spikes that the motor may produce. Otherwise, voltage spikes, produced by the motor as it rotates, could easily destroy the Arduino. The 0.1uF capacitor also absorbs voltage spikes produced when the contacts, connecting electric current to the motor windings, open and close. We use a transistor (a 2N2222) to provide current amplification and to make up for the weak current output of the most microcontrollers. In order that not too much current can flow from the output of the transistor, we place a 1 kΩ resistor in series with the base of the transistor. Otherwise, too much current could damage the motor.
Make sure the cables connecting the motors, the FSR, and the bluetooth module are long enough to reach the part of your prototype you want to install them at the end. We wore the soldering plate plus the bluetooth modules at the angles and chose the length of the cables accordingly and it worked out fine.
If your result looks like the two pictures above you're ready for the next step.
Step 3: Rename Bluetooth Modules
To distinguish the two bluetooth modules, you will need to rename one of them. We followed the instructions by by Martyn Currey:
It makes sense to name one "DancingShoeLEFT" and the other one "DancingShoeRIGHT".
Step 4: Programming the Arduino
We tested the FSR to find out how much force a step of an average adult has. Then we set the threshold for the Arduino code to 200. This is represented as the constant "STEPVALUE". Depending on your personal weight and the used FSR, it may happen that this value is not suitable for you and you should consider playing around with this value.
We define pins 3-7 as output for the motors, where we define 3 as the motor on the left side, 4 as the motor on the right side, 5 as the motor on the top, 6 as the motor at the front and 7 as the motor at the back. The rxPin and txPin are used for the bluetooth connection. The fsrPin is set to A0 and used for the connection with the FSR.
At the beginning of the program, the bluetooth connection is initialized. The main loop then checks whether the foot is currently stepped or not. Then, it checks whether there is some input available from the bluetooth connection and whether the foot was stepped or not. Possible received data from the android app is ”3”, ”4”, ”5”, ”6” or ”7” for the corresponding motors. The while loop ensures that the motor is vibrating as long as the constant "WAITINGTIME". This indicates to the user that he or she has to move the foot in the appropriate direction. If you increase this value the signals may become more distinguishable but just slower dancing is possible. If ”a” is sent over the connection then the topPin is enabled and after the waitingtime, it is disabled again. This special command is used for counting in four steps before starting the dance. If the foot was not stepped correctly in time, an error function is called which sends an error over the bluetooth connection and sets the vibration motors on pinTop and pinFront to high, waits for three times the waitingtime and set both pins to low again. This indicates the error to the user.
Upload the code via mini USB to both Arduinos. you can test if everything works fine by sending the corresponding values over the serial monitor of your Arduino programming platform after you connected your PC to one of the Bluetooth modules.
Step 5: The Android App
The Android application is written in java with Android Studio and is based on two pages. On the first page, the user can choose the both bluetooth modules to connect with. In our case, HC-05 is the left one and ArduinoBT1 is the right one. After the two connections are selected the app establishes a connection automatically making use of the Android Bluetooth library and switches to the second page. The four buttons in the middle of the second page activate the different dancing programs. The first one is a debugging program to test the functionality of the motors. If you successfully installed the app you can test the whole system with that one. The second program is the Disco Fox basic step. The third program is the Waltz basic step and the last program is a simple walk program. The lower three round buttons are for adjusting. The left one changes between guided mode and freestyle mode, a mode where no direction is given. The right button changes between a male and a female user and the middle one is used to tap the speed, which is presented above it. The disconnect button stops the connection to the bluetooth modules and the stop button stops the current program. When a program is started the app sends one signal per step time to the corresponding shoe via bluetooth starting with four steps in place to help the user get in the rhythm. If the user does not react correctly to this sent command the corresponding shoe will send an error to the app (again via bluetooth) and the program will reset to the next tact. Again the program starts with four steps in place before starting the actual dance.
Step 6: Sewing
Now that everything works on the technical side it is time to bring the electronics into the socks. For that, you need to sew the five motors and the FSR into the woolen socks at the corresponding places. The picture shows how it should look. The fifth motor is at the heel of the sock and the FSR is underneath.
We found out, that the best place for the front motor is the big toe, so you have to distinguish between left and right to sew the motor at the right position.
Make sure everything is sewed as tight as possible to make the system as robust as possible.
Step 7: Usage
To use the socks put them on and attach the loose parts (soldering plate, power supply, and bluetooth module) to your ankles. We put them into the wrinkles of our jeans but you can use tape for that too. We encourage you to build you own case for everything. After that pull the tight socks over the woolen ones and make sure every motor sits tight and you don't bend the FSR. Connect your phone with the two bluetooth modules, start the app, select the two modules and have fun playing around.
We have a be nice policy.
Please be positive and constructive.