Sh*tty Golf Robot
If you are looking to put balls in holes, this is definitely not the place for you (don't worry this instructable is safe for children). This crappy golf robot is very simple, very fun, and almost never works!!!!! It simply hits a ball in the general direction of a hole and has probably a 1 in 10 shot of going in. This is one of the many reasons why you will probably not read past the title page of this instructable.
Items You Need
This is quite an easy project and luckily it requires very little materials. You'll need
- scissors
-tape
-an Arduino uno
-wires (1 female-female also)
- a force sensing resistor
- a hot glue gun (or any kind of glue)
-some tinfoil
-a servo motor
-a resistor
-a marble
Wiring
This wiring is very simple and just follow the fritzing Image I have above but if for some reason you are just a little bit slow or you are too lazy to look at a picture, I'll explain what to do.
-First to hook up the servo motor attach the yellow cord to pin number 13, attach the red cord to 5V, and attach the brown wire to GND.
-Next plug one side of the force sensing resistor to GND and the other side to a resistor that connects to A0. Make sure that the resistor is in place or else the force sensing resistor will be too sensitive.
Simple as that
Coding
Now this is the most difficult part of the entire project. The coding. I know. Coding makes me feel like drinking a canister of bleach too but don't worry. Thanks to your OG Quinn, I have done the coding for you. Now all you have to do is copy the code below, and print it into Arduino. Simple.
<p>#include <servo.h><br>Servo myservo; int pos = 0; void setup() { pinMode(0,INPUT); myservo.attach(13); Serial.begin(9600); }</servo.h></p><p>void loop() { int x= analogRead(0); Serial.println(x); if(x==0) { for(pos = 180; pos > 0; pos -= 180) { myservo.write(pos); delay(1000); } for(pos = 0; pos<=180; pos+=180) { myservo.write(pos); delay(1000); } } }</p><strong></strong><u></u><sub></sub><sup></sup><del></del>
The Actual Making Part
To actually make this mini golf robot, you have to get a cardboard box (small or big doesn't matter) and make some kind of cardboard walls around the box area on three sides of it. The empty side will be where you are shooting the ball from. On the side without walls, tape or glue the servo motor to the side of a wall on the left or right side so that when it is at 90 degrees, it just brushes the bottom. Then glue tinfoil onto your servo motor so that it resembles a golf put (or honestly just make sure it can hit a marble). Then once you have the servo motor on the walls, glue down your force sensing resistor right underneath the servo motor. That way, the servo motor is brushing right over the force sensing resistor. Then, the fun part is gauging out a hole exactly where you want your ball to go in. Then what I did, is bent some cardboard that directed the ball to roll out every time it went in the hole. After this, take your marble, and place it on the force sensing resistor (if it doesn't stay, use a small folded piece of paper). Then the force sensing resistor will hit the marble and if a miracle happens, it will go into the hole.
Congrats
Good job. You completed this project. Now that you have this incredible robot that hits a golf ball somewhere near a hole, you can have countless hours of fun!