Arduino Uno Servo Motor Swing Set :o

by zosgood in Circuits > Arduino

576 Views, 1 Favorites, 0 Comments

Arduino Uno Servo Motor Swing Set :o

IMG_0336.jpg
IMG_0342.jpg

This is a plan for a very low-fi servo motor swing set I created - after some troubleshooting I was able to make this in only a few hours at home - and you can too!

My goal for this silly little project was to create a single swing for a black walnut I had; I sewed feet for the walnut and set it up so that the feet would kick dirt on the base (because why not)

This doesn't have to be your goal, but placing a small heavy object in the swing will give it better momentum

{ I was giggling the entire time I was building this, I hope it makes y'all smile too :) }


Supplies

IMG_0347.jpg
  • > 16 gauge bailing wire (or equivalent)
  • thin wire or chain
  • crochet hook (optional)
  • wooden plank
  • scrap of thick fabric
  • pliers
  • wire cutters
  • power drill + drill bits
  • Arduino Uno starter kit
  • computer

Constructing the Swing Set Legs

IMG_0348.jpg
IMG_0349.jpg

To create a simple, sturdy frame, begin by twisting together two long strands of bailing wire (or whatever thick wire you have) using your power drill:

Measure out two long wire strands, about 5 or 6 feet long each

Bend each of the strands in half around the leg of a chair, or another stable pole nearby

Place the two ends of the wire into the power drill, as you would a drill bit, and tighten so the wire is secure

Use the drill to twist the wire together until a tight coil is achieved

Use your wire snips to cut the wire from its connection to the chair leg, and remove the other end from the drill

Trim the excess wire from each end of your two pieces, and make sure they are both the same length

Bend each piece in half so that they look like tall, upside-down V's

Preparing the Base

IMG_0350.jpg

Mark off the points where you will insert the swing set legs into the base using a pencil:

I suggest spacing the legs on each side twice as far apart as their distance from each other width-wise

(see drawing above, writing it out is confusing :/ )

Use a drill bit close to the diameter of your wire twists to drill four holes where you marked

Place the ends of each of the two leg sets into the holes - they should rest at about the same height and stand upright

Constructing the Small Swing Set Parts

IMG_0351.jpg

Using the width between the two sets of legs you've constructed, use your pliers to bend the parts shown above out of small pieces of bailing wire

Also, use the small wire to create chain pieces for the swing, or use pre-made chain (I crocheted a thin wire to make the chains)

Cut a small piece of thick fabric for the seat (I sewed the edges of mine using a waxed book binding thread, but I don't think it matters if you do this or not) fold each end over, and attach with a staple or sew the flaps to create a passage for the small wire parts

Put It All Together!

IMG_0337.jpg
IMG_0352.jpg

Attach the parts as demonstrated in the image

Coding + Setting Up the Servo Motor

2043-44.png
IMG_0338.jpg

Set up your Arduino using the diagram above

In the Arduino application, copy and paste the following code into your workspace:

-----------------------------------------------------------------------------------------------------------------------------------

#include <Servo.h>

Servo myservo;// define servo variable name

void setup()

{

myservo.attach(9);// select servo pin(9 or 10)

}

void loop()

{

myservo.write(120);// set rotation angle of the motor

delay(500);

myservo.write(180);

delay(500);

}

-----------------------------------------------------------------------------------------------------------------------------------

Run the program and adjust as needed

Place the servo motor on the holster you created, and attach the arm to the wire hinge at the top of the set (as shown in the above image)

Troubleshooting the Servo Motor Arm

Before you secure the motor arm to the wire frame, you'll have to make sure that it is moving in the right way

If the arm is attached at the wrong angle, the swing will not work

Attach + reattach the arm until it is moving back and forth at the correct angle before securing it to the swing set

All Done !!

After finagling the motor arm and making sure everything is secure, your project should be ready!

Happy swinging !!