Shadow Boxing Partner

Problem

I have just started practicing boxing a few weeks ago and every week we work on a new drill. During class I can work with a partner and get familiar with the hits and rhythm of the drill. After I am familiar with drill, I will have to react to the movement made by my partner and execute the drill accordingly. When I shadow-box in home and without a partner, however, there is no hint or reminder on the next hit as I try to get familiar with the drill again. In addition, shadow-boxing also lacks the reacting aspect of s?m.parring. Therefore, a device that acts as the shadow boxing partner is designed.

Solution

The design of the devices

The device is made up by six speakers that sticks to the wall. Each square in the diagram above represents a speaker. The diagram shows the default arrangement of the speakers. The number written near the speakers¬† represents the number for the hit the speakers are responsible for. For example, when a jab needs to be thrown, the speaker on the top left-corner will play the sound effect because the number of jab is 1. The middle speakers are responsible to upper cut to chin and body shots to the middle. The device will connect to phone, and the sound effect player by the speakers depending on what drill is being practiced. The one of the navy drills, for example, includes a left hook (3), a straight punch (2), and then a left hook (3). The speaker that is responsible for left hook will play the sound effect for left hook, and the speaker responsible for straight punch will play the sound effect for straight punch. The sound effects of each type of punches are recorded from actual punches. They might not be that distinct comparing to each other but the position of the speaker already gives a big hint on the next hit and the user should at least know what hits are included in the drill.¬†When the user gets comfortable with the drill, the device can be switched to difficult mode. Only the first punch or the “hit” from the partner is given and the user has to react to it. The user can also change the drill through the smart phone.

Proof of Logic

The demo of the device

Because of the lack of materials, I cannot make the full device with 6 speakers. Instead, I will use speaker, solenoid, and vibration motor to stimulate the sound effects for hook, straight punch/ jab, and body shoots. The first button on the right hand side is to switch between drills and the second button is to switch between normal mode and difficult mode.

Code:

//libary
#include "pitches.h"


//Defining the pins
#define solenoide 12
#define motor 13
#define speaker 7

#define drill_pin 3
#define hint_pin 2

//Global varibales
//For interrupt
const bool isInterrupt = true;
int drill;
int drill_number = 1;
bool hint_status = true;
bool solenoid = true;
int delay_in_between = 350;

//Functions
void move_solenoid() {
  if (solenoid == true) {
    digitalWrite(solenoide, HIGH);
    solenoid = false;
  }

  else {
    digitalWrite(solenoide, LOW);
    solenoid = true;
  }
}

void vibrate_motor() {
  digitalWrite(motor, HIGH);
  delay(300);
  digitalWrite(motor, LOW);
}

void DrillSwitchPressed() {
  if (digitalRead(drill_pin) == LOW) {
    drill == drill_number ? drill = 0 : drill ++;
  }
}


void HintSwitchPressed() {
  if (digitalRead(hint_pin) == LOW) {
    hint_status = !hint_status;
  }
}

//Functions for the drill
void Navy_drill(int random_numb) {
  if (hint_status == true) {
    if (random_numb == 1) {
      //NOTE_A4 is the note for hook
      tone(speaker, NOTE_A4,200);
      delay(delay_in_between);
      move_solenoid();
      delay(delay_in_between);
      tone(speaker, NOTE_A4,200);
     
      
    }

    if (random_numb == 2) {
      move_solenoid();
      delay(delay_in_between);
      tone(speaker, NOTE_A4,200);
      delay(delay_in_between);
      move_solenoid();
    }

    if (random_numb == 3) {
      //Upper cut
      vibrate_motor();
      delay(delay_in_between);
      move_solenoid();
      delay(delay_in_between);
      //NOTE_A4 is the note for hook
      tone(speaker, NOTE_A4,200);
      
    }

    if (random_numb == 4) {
      //Upper cut
      //tone(speaker, NOTE_C4);
      //delay(200);
      //tone(speaker, NOTE_D4);
      //delay(100);
      //tone(speaker, NOTE_E4, 100);
      vibrate_motor();
      delay(delay_in_between);
      //hook
      tone(speaker, NOTE_A4, 200);
      delay(delay_in_between);
      move_solenoid();
    }
  }

  else {
    if (random_numb == 1) {
      //NOTE_A4 is the note for hook
      tone(speaker, NOTE_A4, 200);
      
    }

    if (random_numb == 2) {
      //NOTE_A4 is the note for hook
      tone(speaker, NOTE_A4, 200);
    }

    if (random_numb == 3) {
      //Body shot coming in
      vibrate_motor();
    }

    if (random_numb == 4) {
      //Body shot coming in
      vibrate_motor();
    }
  }   
}


void Dodge_drill(int random_numb) {
  if (hint_status == true) {
    if (random_numb == 1) {
      //NOTE_A4 is the note for hook
      tone(speaker, NOTE_A4,200);
      delay(delay_in_between);
      move_solenoid();
    }

    if (random_numb == 2) {
      tone(speaker, NOTE_A4,200);
      delay(delay_in_between);
      move_solenoid();
      
    }
  }

  else {
    delay(random(0,2000));
    if (random_numb == 1) {
      //NOTE_A4 is the note for hook
      tone(speaker, NOTE_A4, 200);
      
    }

    if (random_numb == 2) {
      //NOTE_A4 is the note for hook
      tone(speaker, NOTE_A4, 200);
    }
  }   
}
void setup() {
  // Setup the pin modes
  pinMode(solenoide, OUTPUT);
  pinMode(motor, OUTPUT);

  //When the buttons are pushed, digitalRead shows 0

  pinMode(drill_pin, INPUT_PULLUP);
  pinMode(hint_pin, INPUT_PULLUP);


  //Initiate the serial monitor
  Serial.begin(9600);


  // attach the interrupt pin to a method
  if (isInterrupt) {
    attachInterrupt (digitalPinToInterrupt(drill_pin), DrillSwitchPressed, FALLING);
    attachInterrupt (digitalPinToInterrupt(hint_pin), HintSwitchPressed, FALLING);
  }



 
  //vibrate_motor();
  //tone(speaker, NOTE_C4);
  //delay(200);
  //tone(speaker, NOTE_D4);
  //delay(100);
  //tone(speaker, NOTE_E4, 100);
}






void loop() {
  if (drill == 0) {
    //randomSeed(analogRead(A0));
    int random_numb = random(1,4);
    Navy_drill(random_numb);
    delay(3000);
  }

  if (drill == 1) {
    //randomSeed(analogRead(A0));
    int random_numb = random(1,2);
    Dodge_drill(random_numb);
    delay(4000);
  }
}

 

Author: Zerui Huo

Hi I am a junior majoring in civil engineering. I would like to do a minor in physical computing. I like playing video games.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.