Kitty Candy Cannon

by PeterS601 in Living > Pets

747 Views, 5 Favorites, 0 Comments

Kitty Candy Cannon

f7aa595718f5d398b5f59ba1a729bcbf_preview_featured.jpg
Kitty candy cannon 2
Kitty candy cannon 1
05592e9ca23e380b1be80d888aaced96_preview_featured.jpg

Kitty candy cannon
First off, I'm a novice at both CAD and Arduino. This was a project for me to learn a little of both. It's probably faster (definately cheaper) to just throw candy to your cat. As you can see in the videos Harry is as excited as me to finally see this thing in working order. Ungrateful cat... You'll need a 3D-printer or order the parts printed to make this project.

The cannon
The cannon has a magazine holding 9 candies. When the button is pressed a servo pushes the magazine forward, dropping a candy down to the trigger. Then it moves to a random horizontal and vertical position. When in position the motor rotates the axle pushing the trigger back until it fires. After firing it goes back to it's original position.

Printed parts
All stl:s are placed in the way they need to be printed for strength, detail and so on. I've tried to minimize the need for supports but some of the parts have to have them, and a few of the taller parts need a brim to stick to the build plate. The Reloader base has supports included in the stl so you'll only have to add a brim for that part. Just break them off when you're finished printing.

Electronics Box

2be246fd9a4cc144218cab9be5b56064_preview_featured.jpg

Glue the servo holder and the axle in place. When the glue is dry, screw the servo in place. The indent with the slots are for holding the trigger button.

Base

854d1b0477393b5b9e4deca143863b25_preview_featured.jpg
18d04cabadb2db0b5745923ab121f5c4_preview_featured.jpg

Glue the servo holders and rotator in place. When the glue has dried you can screw the larger servo in place. When you put this on the axle on the electronics box you can add the wire going from the box's servo to the rotator.

Cannon

1130cbc1f504d5921b1d252fd2b57860_preview_featured.jpg
13b28cec7aeb6e4e22c9f9892d0b217c_preview_featured.jpg
af967d7d5a84b6534ee1b6329c4f090b_preview_featured.jpg

Attach the motor axle to the motor and slide it in place. Put the spring on the firing pin guide and add shims if necessary. Insert the guide in the firing pin, compress it and push it in place. Hold the trigger axle in place, add some glue and push the axle studs in. Also glue the lifter anchor in place. You'll need a piece of at least 1,5mm thick wire to attach the lifter servo to the anchor on the cannon.

Reloader

82f04b42bdefb00493d980d804b27d2b_preview_featured.jpg

Slide the magazine in place and attach a rubber band from the magazine to the reloader base. Push the magazine catch in place. The catch will keep the magazine in position when the servo moves back to reload. Insert the magazine pusher in the servo attachment and screw that onto your servo. Then screw the servo in place

Lego Wiring

3fde15cfb7a49c1ec28b5797ef29ddfa_preview_featured.jpg
  • GND: Ground wire – 0V
  • C1: Control 1 - 9V when in forward
  • C2: Control 2 – 9V when in reverse
  • 9V: Power wire – 9V always

If you've got an extension wire, just cut it in half and solder breadboard connectors to both. You'll need one for connecting the battery box, and one for the motor.

For the battery box you use the 9V (red) and GND (blue) wires, so insulate both control wires (green).

For the motor you'll use the control wires so insulate the GND (blue) and 9V (red) wires.

Arduino Wiring

1b6c1d740eace03782a097c8a60bcb2d_preview_featured.jpg

I used a motor shield so the motor goes to the shield's A1 and A2
connectors. The battery box goes both to the motor shields power input and the power rail on the breadboard to feed the servos. Make sure the motor shield jumper is set to use external power.

The 4xAA battery box goes in the arduino

Code

The only thing you'll have to modify in the code is the positions of the servos. All positions are set at the top of KittyCandyCannon.ino. The positions will need a little triming in when you attach the servo arms.

My cannon was placed on a shelf so it only shot to the left. You can alter that setting to your preference.

I hope you enjoy this little project, it was a fun construction! Sadly my cats does not care :D