Introduction: Box(ing) Man

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

This is my Box(ing) Man project that includes a 3D animation created in SOLIDWORKS and the C++ programing with circuit connections.

Box(ing) Man is a boxer that is made of multiple boxes that will box an object when close to it. When someone or something is in Box(ing) Man's bubble of 5 inches, he becomes angry, hence the red LED, and starts to move his arm back and forth to remove what is in his face.

Step 1: Materials

Get all materials needed for the project and assembly:

-1x Arduino uno

-15x Arduino wires

-9v battery for Arduino

-Breadboard

-Red LED

-1K resistor

-Strip of tape

-3D printer

-Ultrasonic Ranging Module HC-SR04

-Microservo Sg90

-Super glue

-Drill

Step 2: 3D Printing Box(ing) Man

SOLIDWORKS was used to create a design for Box(ing) Man and entailed of 6 hollow boxes with cuts and extrusions to fit into each other along with the wiring, sensor, and servo inside. Above are pictures showing all the parts and then the assembly of how it looks all together.

Step 3: Arduino Sketch of Box(ing) Man:

As seen above, Box(ing) Man has a simple coding to turn on an LED and move a microservo from 0 to 90 degrees. With this the coding first I defined what the Ultrasonic sensor (trigpin-13 and echoPin-12) and the LED would be connected to (11) on the Arduino. Then I included the Servo library that is included in Arduino along with naming it as nservo throughout the rest of the code. After, the integers are set for the position and flip which will be used with the servo's position and rotation.

The void setup is set up to have all my pins set up as outputs and inputs along with what is the initial stance of Box(ing) Man with his arm being set in a 0 degree angle and the LED to be LOW (off).

The void loop is continuously running for Box(ing) Man with if and else statements. After setting up the distance measurement to be in inches, the delaymicroseconds reflects the trigpin to turn off and on and off again to send a wavelength after 3 seconds, and then again after 5 seconds. The distance is set up for the ultrasonic sensor to calculate how far something is from the sensor which is found by the duration multiplied by the speed of sound. Following this, the if statement reflects if the distance is less than 5 inches, then the LED will be turned on (digitalWrite(LED, HIGH) and then the servo will move the arm back and forth (flip=!flip) from 0 to 90 degrees (pos=(flip)*90). However the else statement shows that if movement is greater than 5 inches from the sensor, the LED will remain off and the servo will be at 0 degrees.

Step 4: Building/Operating Box(ing) Man

How to Build Box(ing) Man:

-Create parts of Box(ing) Man through SOLIDWORKS with extrusions and cuts to fit parts together.

-Once parts are created, start 3D printing the design.

-While parts are printing, go through Arduino control system to ensure everything works.

-When parts are all printed, then put the pieces together along with setting up the control system through the body.

-The building of Box(ing) Man entails drilling the servo into the forearm box so that it can move the arm along with drilling the servo into the shoulder arm. Everything else will be put into each other with the extrusions and cuts or be glued such as the box holding all the wiring inside.

-After the pieces are all together and the control system is set, Box(ing) Man is ready to operate seen in step 4!

Operation of Box(ing) Man: Connect Arduino Uno to power source whether it be a 9V battery or a computer to turn on the system. Once on, if object comes within 5 inches of ultrasonic sensor, Box(ing) Man will be "angry" which is reflected through the red LED on top of his head that will be turned on. As well, when the motion is detected, his right arm will start to move back and forth from 0 to 90 degrees. However, if an object is farther away than 5 centimeters, no part of Box(ing) Man will move and he will remain still.


Box(ing) Man is ready to fight and can be demonstrated in the video shown in step 4!