Do you ever want to get some target practice with your nerf guns but find that shooting still objects to be too boring as targets? If so, this project is just for you! This robot randomly moves around the room when you start it and will stop if you shoot it enough times, or if it runs out of time before then, in which case you lost.
There are some things that could be better about this project, but I did not have as much experience when I made it as I do now. Despite this, it actually still works really well with very few problems. It's also more fun to use than I would have anticipated (for some reason, most other people find it more fun to use then I do).
Watch the demonstrationHow to use itTo use this robot, you simply put it on the ground where there is some clear floor space, make sure the difficulty switch is set to what you want, turn it on, step back, and start shooting the front of it when it moves. It's that simple! It will give feedback that you hit it by beeping when hit. When you've hit it enough times based on the difficulty setting, it will make a continuous beep sound and stop. If it runs out of time before you shoot it enough times, it will stop without making any beeping sounds (you lost).
FeaturesThis robot has a simple UI of only three buttons: the main on and off switch, the three position difficulty switch for easy, medium, and hard, and the reset button. Here are the features in more detail:
Reset button and main power switchThe main power switch is simply a rocker switch that will disconnect all power to the robot when switched off. The reset button is a normally closed switch that the main power runs through, so when it is pressed, it will momentarily cut off the power from the Arduino and reset. As can be seen from the Fritzing diagram included in this tutorial, both of these buttons are connected in series on the same battery power line.
Difficulty switchThe difficulty switch is a three position switch with an on-off-on configuration where on parts of the switch connect to Arduino pins 12 and 11 with pull down 10k ohm resistors. When Arduino pin 12 is high, it puts the robot in easy mode, when Arduino pin 11 is high, it puts the robot in hard mode, and when neither pins are high (switch is in middle state), then medium difficulty is set.
How it detects hitsAs can be seen from the picture above, the front bumper that detects shots consists of EVA foam with tinfoil stuck on the adhesive back, and tin foil that is taped on the front of the robot behind the foam. These two sides act as a normally open switch because the sides with the conductive tin foil do not normally touch each other. Each side of the switch has a wire that makes contact with the tinfoil and one side of the wire leads connects to Arduino GPIO pin 2 as an interrupt pin with a pull down resistor. the other side of the switch connects to ground. When the foam of the front bumper is shot, the foam compresses and the tinfoil on the back of it touches the tinfoil on the other side, pulling the interrupt pin to ground.
Debouncing of the front bumperI have to note that there is a lot of signal denounce on the front bumper which could cause one hit to be detected as several. When I hooked up my oscilloscope to the bumper as a switch, I found that it created the WORST deboucing signal that I have ever seen! I created some filters with capacitors to clean up the signal, which helped, but the debouncing was still a problem. I ultimately decided to get rid of the noise filter and instead create a 300 millisecond delay when the bumper is hit which fixed the problem.
Power SupplyWhen I first made this robot, I tried to use commonly available batteries like AA's and 9 volts, but found that AA's did not have the right weight to power ratio and the robot moved slowly, and 9 volts worked well for awhile, but ran out of power quickly. I decided to use two 18650 batteries in series because they were powerful and light enough to allow the robot to drive fast with a long battery life.
Making the electronicsUse a breadboard or a strip board and assemble the circuit shown below. Note: do not permanently attach the motors, UI buttons, bumper wires, or buzzer until the robot is assembled.
First of all, 3d print all stl files included in this tutorial. I would suggest using PETG for strength, and a.8 mm nozzle printed with a layer height of.6 mm to print the parts faster. Now, connect both motors to the motor holder by inserting the back of the motor shaft into the large hole, and inserting an m3 screw through the top small hole and screw it in.
Use M3 screws to attach the swivel wheel on the swivel wheel base (Note: there are two sets of holes because some wheels are sized differently, so if your wheel is too large to fit in the upper holes as shown in the picture, you will have to screw them in the bottom holes. You will also have to cut off part of the steel swivel wheel plate with a hack saw for it to fit as shown in the picture).
Use M3 screws to screw the motor holder to the bottom of the robot body where the four holes line up and make sure that the motors are facing towards the back of the robot.
Now take the swivel wheel holder and glue it to the ledge with super glue that is below the ledge that circles the entire body. Make sure that the hole on the very edge of the swivel wheel holder lines up with the hole on the ledge.
Slide the electronics plate in the body of the robot and put the motor wires through the hole.
Insert the slide switch and the rocker switch and glue them. Screw the reset button (Normally closed button) from the back.
Fit the buzzer to the top.
Put the electronics on the electronics base with the Arduino USB connector facing the hole on the back of the robot and tape the battery holder in. Then attach the wires from the buttons and motors to the circuit.
Cut a piece of tinfoil to 8 x 6 7/8 inches and tape it on the front of the robot making sure that the tinfoil reaches the back of the left slot of the robot and leave about two inches spacing between the back of the right slot and the tinfoil. Note: I put small strips of foam along the top and some on the sides to prevent both sides of the bumper from making contact when not shot.
Strip the ends of the wires for the bumper by about half an inch, and insert both wires through the small holes towards the top. Bend the wires so that they touch the tinfoil.
Cut a piece of foam to be 9 1/2 x 6 and 5/8th inches.
Use a knife to cut a shallow score on the paper covering the adhesive about 1.5 inches from the side and strip off the rest of the paper leaving just the strip on the side. Then place some tinfoil on the adhesive and remove the exes.
Insert the foam into the slots on each side of the robot body. If the bumper has been put together correctly, the wire on one end should touch the tinfoil that is attached to the robot body, and the other wire should touch the tinfoil on the foam bumper. If you connect an ohm meter to both of the wires, it should give no reading until the foam bumper is pressed. If the ohm meter always gives a reading, then see where both sides of the bumper are touching, and insert some thin strips of foam between the sides to separate them.
Finally, connect the wires of the buzzer to the circuit and snap the top onto the robot.
Finishing upNow that everything is assembled and wired up, it is time to upload the code and test it out! Also, tape a paper target on the front to make it more fun to shoot. While this is optional, it would be pretty pathetic if someone went though all the trouble to make something like this and not even bother with slapping on a proper target!
Comments
Please log in or sign up to comment.