Introduction: Mr. Goalie

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)

Step 1: Download Parts

Go to: https://grabcad.com/library/embaixadinhas-wooden-t...

(If you do not already have one, you will need to create a GRABCAD account to access files.)

Click the downlaod all files button

Extract Files from the zip folder to a new folder

Step 2: Extract .rar File

Go to: https://extract.me/

Find the "STEP_Embaixadinhas.rar" file in the folder with the extracted files.

Upload and extract

Step 3: Open Assembly in Solidworks

Open SOLIDWORKS

Find and open extracted STEP file from previous step

Step 4: Save Parts

Double click individual parts of the assembly.

Right click highlighted part in assembly tree to the left.

Select invert selection.

Right click any highlighted selection.

Select suppress.

Save As part as a .sldprt file

Step 5: Repeat

Repeat STEP 5 until all parts needed for assembly have been saved.

Individual parts can also be edited.

Step 6: Assemble

Assemble parts in SOLIDWORKS and create mates to form figure in the position of a hockey goalie.

Save As ".stl" file and have it 3D printed.

Step 7: Repeat STEP 6

Repeat STEP 6 in form of a shooting hockey forward.

Step 8: Setup

Using an Arduino Uno, a breadboard, 6 push buttons and 2 servo motors complete the pictured setup.

Step 9: Commented Code

#include  //include servo library
Servo myservo; //create servo object to control servo 1
Servo servo2; //create servo object to control servo 2
int pos; //variable to store servo 1's position
int pos2; //variable to store servo 2's position
void setup(){ //setup pins
  pinMode(2,INPUT); //push-button 1: slow mode
  pinMode(3,INPUT); //push-button 2: moderate mode
  pinMode(4,INPUT); //push-button 3: fast mode
  pinMode(5,INPUT); //push-button 4: shoot
  pinMode(6,INPUT); //push-button 5: reset
  pinMode(7,INPUT); //push-button 6: stop
  digitalWrite(2,HIGH); //while the button is unpressed the state of the pin is HIGH
  digitalWrite(3,HIGH);
  digitalWrite(4,HIGH); 
  digitalWrite(5,HIGH); 
  digitalWrite(6,HIGH); 
  digitalWrite(7,HIGH); 
  myservo.attach(9); //attaches servo 1 on pin 9 to the servo object
  servo2.attach(8); //attaches servo 2 on pin 8 to the servo object
  pos = 90; //intial position for servo 1
  pos2 = 180; //intial position for servo 2
} //end setup
void loop(){ //main loop
  myservo.write(pos); //moves servo 1 to intial position
  servo2.write(pos2); //moves servo 2 to intial position
    
    if (digitalRead(2)==LOW){ //if push-button 1 is pressed
      do{
        for(pos = 5; pos <= 175; pos += 1){ //servo goes from 0 degrees to 180 degrees in steps of 1 degree
          myservo.write(pos); //tells servo to go to position in variable 'pos'
          delay(15); //time between iterations in miiliseconds 
          pos = pos; //updated position
            if (digitalRead(5)==LOW){ //if push-button 4 is pressed
              servo2.write(0); //moves servo 2 to 90 degrees
            }
            if (digitalRead(6)==LOW){ //if push-button 5 is pressed
            servo2.write(180); //moves servo 2 to intial position
            }
        }     
        for (pos = 175; pos >= 5; pos -= 1) { //servo goes from 180 degrees to 0 degrees in steps of 1 degree
          myservo.write(pos); //tells servo to go to position in variable 'pos'
          delay(15); //time between iterations in miiliseconds
          pos = pos; //updated position
          if (digitalRead(5)==LOW){ //if push-button 4 is pressed
            servo2.write(0); //moves servo 2 to 90 degrees
          }
          if (digitalRead(6)==LOW){ //if push-button 5 is pressed
            servo2.write(180); //moves servo 2 to intial position
          }
        }    
      }while(digitalRead(7)==HIGH); //if push-button 6 is pressed exits do_while loop 
    }
    if (digitalRead(3)==LOW){ //if push-button 2 is pressed
      do{
        for(pos = 5; pos <= 175; pos += 1){ //servo goes from 0 degrees to 180 degrees in steps of 1 degree
          myservo.write(pos); //tells servo to go to position in variable 'pos'
          delay(10); //time between iterations in miiliseconds 
          pos = pos; //updated position
            if (digitalRead(5)==LOW){ //if push-button 4 is pressed
              servo2.write(0); //moves servo 2 to 90 degrees
            }
            if (digitalRead(6)==LOW){ //if push-button 5 is pressed
            servo2.write(180); //moves servo 2 to intial position
            }
        }     
        for (pos = 175; pos >= 5; pos -= 1) { //servo goes from 180 degrees to 0 degrees in steps of 1 degree
          myservo.write(pos); //tells servo to go to position in variable 'pos'
          delay(10); //time between iterations in miiliseconds
          pos = pos; //updated position
          if (digitalRead(5)==LOW){ //if push-button 4 is pressed
            servo2.write(0); //moves servo 2 to 90 degrees
          }
          if (digitalRead(6)==LOW){ //if push-button 5 is pressed
            servo2.write(180); //moves servo 2 to intial position
          }
        }    
      }while(digitalRead(7)==HIGH); //if push-button 6 is pressed exits do_while loop 
    }
    if (digitalRead(4)==LOW){ //if push-button 3 is pressed
      do{
        for(pos = 5; pos <= 175; pos += 1){ //servo goes from 0 degrees to 180 degrees in steps of 1 degree
          myservo.write(pos); //tells servo to go to position in variable 'pos'
          delay(5); //time between iterations in miiliseconds 
          pos = pos; //updated position
            if (digitalRead(5)==LOW){ //if push-button 4 is pressed
              servo2.write(0); //moves servo 2 to 90 degrees
            }
            if (digitalRead(6)==LOW){ //if push-button 5 is pressed
            servo2.write(180); //moves servo 2 to intial position
            }
        }     
        for (pos = 175; pos >= 5; pos -= 1) { //servo goes from 180 degrees to 0 degrees in steps of 1 degree
          myservo.write(pos); //tells servo to go to position in variable 'pos'
          delay(5); //time between iterations in miiliseconds
          pos = pos; //updated position
          if (digitalRead(5)==LOW){ //if push-button 4 is pressed
            servo2.write(0); //moves servo 2 to 90 degrees
          }
          if (digitalRead(6)==LOW){ //if push-button 5 is pressed
            servo2.write(180); //moves servo 2 to intial position
          }
        }    
      }while(digitalRead(7)==HIGH); //if push-button 6 is pressed exits do_while loop  
    }
  }//end main loop

Step 10: Enclosure

Pick an enclosure to build your project around.

(pictured is what was used for this setup)

Step 11: Linear Gear

Attach Goalie to linear Gear

Mate linear gear to spur gear connected to servo motor

Step 12: Put Together

Drills holes in the top of the enclosure for the push buttons, the goalies track, and the forward.

Step 13:

Wire Arduino to breadboard as shown in STEP 8

Conceal all wiring and nonessential parts in enclosure

(may require soldering for wired connections to push buttons)

Project Complete