Cheap Arduino Slingshot for Dog Treats

by m_santos in Circuits > Arduino

437 Views, 0 Favorites, 0 Comments

Cheap Arduino Slingshot for Dog Treats

IMG_20210823_225206_669_20210823225309.jpg

In this project, I will show how to do a slingshot that can throw treats for your dog at a distance or even when you are not home.

When I leave, my dog does not touch his food and I don't think he sleeps either. Probably he just keeps staring at the door. However, he gets easily distracted by flying objects (treats, balls, flies,...). I hope if a treat flies to the middle of the room when I am not home, he will investigate it.

I also wanted to do a small project using only the electronics from my Arduino starter kit and mostly objects I already have at home. I have been discouraged by the lack of useful projects using only the starter kit before and wanted to give my contribution.

Meanwhile its also nice that I can participate in the Make it Fly Challenge.

Supplies

Screenshot 2021-08-23 at 15.35.01.png
IMG_20210823_154512.jpg

The following are the supplies I used, however other supplies can be used. For example, I chose a very thick wood board but in retrospect the thickness could be much less. As a result, other components such as screws could also be smaller.

Electronics:

1x Arduino Mega 2560 R3

1x Stepper Motor 28byj-48

1x ULN2003 Stepper Motor Driver Module

1x 9V 1A Adapter

1x Power Supply Module

1x Breadboard

2x M-M wires

6x F-M wires

Other components:

1x Wood Board (30x40x1.6 cm)

1x Elastic Hairband (~0.5 cm of thickness and ~5 cm of diameter, corresponding to 15 cm of length when cut)

2x Screws (40 mm of length and 4.5 mm of diameter)

2x Steel hooks (16 mm of length and 3 mm of diameter)

1x Sewing thread

1x Cardboard roll from dog poop bags

Tools:

Scissors

Pliers

Pencil

Measuring tape (optional)

Hammer (optional)

Attaching Components to the Wood Board

IMG_20210823_155809.jpg
IMG_20210823_161239.jpg
IMG_20210821_185411_767_20210823152450-1.jpg
IMG_20210823_160929-1.jpg
IMG_20210823_161024.jpg

In this step I will provide some measurements, just so it is easier to copy what I have done. However, this is not a project where you need to be very precise and it can be done without measuring tape (I didn't used it).

  1. Start by nailing a steel hook to the wood board 5 cm from the top edge and 4 cm from the side edge. The hook should face the top edge of the wood board. Ideally, you should use a hammer and then pliers, however I just (carefully) hit the hook with the pliers to make an hole and then used the pliers to screw the hook into the hole. The 5 cm from the top are enough to place a treat and the 4 cm from the side will put the elastic at the middle of my wood board.
  2. Cut the hairband with the scissors. Tie the elastic to the hook you just nailed. If you do a simple knot, like I did, be careful to turn the tip of the knot upside. That way, when you pull the elastic, the ties will not became undone.
  3. Extend the elastic horizontally and use a pencil to mark its length on the board. Nail the other steel hook in that position and tie the elastic to the hook like before.
  4. Place the stepper motor 3 cm away from the bottom edge of the wood board, centered with the elastic.
  5. The stepper motor has two holes on the sides. Put a screw inside each each hole and nail the screws to the wood board as you did before with the hooks. Be careful to not damage the stepper motor and try to keep the screws (and therefore the whole motor) as straight as possible. Overall, this is not a difficult task and even if the motor is slightly tilted it should be okay.

Making the Circuit

IMG_20210823_162525.jpg
IMG_20210823_162652.jpg
IMG_20210823_163208.jpg
IMG_20210823_163803.jpg
IMG_20210823_164219.jpg

Using the ULN2003 Stepper Motor Driver Module makes the circuit very straightforward. However if you just have a L293D driver, check how to do the circuit at Adafruit Arduino Lesson 16. Stepper Motors.

  1. Place the power supply module on the edge of the breadboard. Try to connect the +/- on the Power Supply Module to the plus/ minus (+/-) in the breadboard.
  2. Power up the Arduino by connecting a GND pin to the minus (-) line and a 5V pin to the plus (+) line in the breadboard. By powering the Arduino this way, the slingshot will not need to be connected to a computer.
  3. Power up the ULN2003 driver by connecting the minus (-) and plus (+) pins to the breadboard.
  4. Connect the stepper motor interface to the ULN2003 driver.
  5. Connect the IN1, IN2, IN3 and IN4 in the ULN2003 to the D11, D10, D9, D8 PWM pins on the Arduino, respectively.
  6. Connect the battery cell (or any other equivalent power source) to the power supply module.

Putting Everything Together

IMG_20210823_193220_942_20210823210303.jpg
IMG_20210823_193244_847_20210823210300.jpg
IMG_20210823_201605_865_20210823202552.jpg
IMG_20210823_201802_643_20210823202548.jpg

The sewing thread and cardboard roll will be the link between the circuit and the elastic. I chose the cardboard roll from dog poop bags, because it's a resource I often have and the cardboard is thick.

  1. Cut the cardboard roll so that you have a 1.5 cm length roll. Cut any bits of cardboard left on the edges.
  2. Make an horizontal cut on the roll.
  3. Cut about 35 cm of sewing thread. Tie the sewing thread around the roll. Tie it as shown in the figure of this step and not tight around the roll. This way, it will be easier to change the roll when needed.
  4. Place the elastic inside the roll and squeeze it with your hands. This way it will not loosen up too soon.
  5. Wind the loosen tip of the sewing thread to the stepper motor in a clockwise motion.

Writing the Code

Screenshot 2021-08-23 at 22.11.16.png

In the code, I defined the number of steps per rotation, the velocity of the rotation, when should the stepper motor start and after how much time it should stop.

It starts 5 minutes after being turn on and the stepper stops after 1.5 minutes.

I included the delay function in the setup section because I only want it to wait one time 5 minutes.

In the loop section, I created a variable for counting the running time of the program in milliseconds and run the program in this case for 6.5 minutes. This way, The stepper motor only rotates a single time for 1.5 minutes.

1.5 minutes is more than enough for the elastic to be released.

The project is done! Have fun testing it!

Testing and (possible) Improvements

IMG_20210823_225238_081_20210823225307.jpg

For the projectile, I chose a small dog treat which happens to be one of my dog's favorite.

I performed two tests, one with the wood board in an horizontal position and another with the top edge 16 cm higher than the bottom (4 books stacked). I repeated the first test 5 times and the second 7 times. Overall, the results are consistent.

Still, since my slingshot will be on a high enough shelf, the movement upwards is irrelevant. Because of that, I improvised temporary fixes during my tests.

Horizontal test:

The treat traveled between 1.6 m and 2.4 m and skewed around 10 cm to the right. 2 out of the 5 times the treat hit the wall at 2.4 m.

In the video shown here, it traveled a distance of 2.3 m and skewed to the right 14 cm.

Vertical test:

In the first test, the treat traveled only 20 cm in the horizontal direction. This was due to the wear of the roll. I replaced it for a new one.

In the second test, the slingshot launched the treat in the opposite direction. This was because the elastic hit the treat when it was returning to its rest position and not when released. To fix it, I added a 1.8 cm notebook below the elastic and treat, as shown in the video.

5 out of 7 times the treat definitely traveled upwards and around 1.5 m in the horizontal direction (my dog kept eating the projectiles before I could take more precise measurements).

In the video shown here, it traveled upwards at least 40 cm.

What can be easily improved?

  1. Design a more permanent way than books stacked for launching treats upwards.
  2. Centering the components more precisely, avoiding skewness during launches.
  3. Power connections can be made directly, no need for a breadboard.
  4. The wood board can be larger, allowing the placement of the Arduino in it.
  5. Extra stepper motors, rolls, and threads combined with a way of dispensing treats to the wood board will allow to launch more treats.
  6. A thicker and more elastic elastic (sorry for the redundancy) will allow the launching of bigger treats and/or higher distances.