Kitty Candy Cannon
myminifactory
An Introduction to My Arduino Project: A Cat Toy Cannon I'm a beginner at both CAD design and programming with the Arduino platform. This project was created for me to learn more about these two areas. It's probably faster (and definitely cheaper) to simply give your cat a treat, but I wanted to take on this challenge. As you can see in the videos below, Harry is just as excited as I am to finally see this project come together. Cats are amazing animals! Test Firing 1 Test Firing 2 Instructions for Building the Project There's an attached PDF with build instructions, and I tried including zipped files with the FreeCAD documents but wasn't able to upload them. You can find the source CAD files on Thingiverse if you want to access them. The Cannon The cannon has a magazine that holds 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 its original position. Printed Parts All STL files 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 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 file, so you'll only need to add a brim for that part. Hardware Needed What you'll need besides the printed parts are: * Arduino + wires * Motor/Servo shield * Breadboard * Lego 8881 battery box * Lego 88003 L-motor * Lego 8886 extension wire (for not cutting the original wire) * 2 x micro servos (800g) * 1 x standard servo (>4kg) * 4 x AA battery holder * Wire for servos * Rubber band (for the magazine) * 2 x 4mm nuts & bolts (for the cannon hinge) * 10 x AA batteries * Glue Arduino Code #include <Button.h> #include <Servo.h> unsigned int buttonPin = 13; Button startStop(buttonPin); unsigned int motorPwm = 3; unsigned int motorDirection = 2; // Servo settings Servo vertical; unsigned int verticalPrevious; unsigned int verticalServoPin = 6; unsigned int verticalMin = 10; unsigned int verticalMax = 35; Servo horizontal; unsigned int horizontalPrevious; unsigned int horizontalServoPin = 5; unsigned int horizontalReset = 90; unsigned int horizontalMin = 10; unsigned int horizontalMax = 90; Servo reload; unsigned int reloadServoPin = 9; unsigned int reloadStart = 47; unsigned int reloadEnd = 5; void setup() { startStop.begin(); pinMode(motorPwm, OUTPUT); pinMode(motorDirection, OUTPUT); // Attach and move servos to starting position horizontalPrevious = horizontalReset; verticalPrevious = verticalMin; vertical.attach(verticalServoPin); moveServo(vertical, verticalMin, verticalMin, 15); horizontal.attach(horizontalServoPin); moveServo(horizontal, horizontalPrevious, horizontalPrevious, 15); reload.attach(reloadServoPin); moveServo(reload, reloadStart, reloadEnd, 5); } void loop() { // Check if the button is pressed if (startStop.isPressed()) { // Reload the cannon and fire it reloadCannon(); fireCannon(); // Reset the servos to their starting positions resetServos(); } } void reloadCannon() { moveServo(reload, reloadStart, reloadEnd, 5); delay(1500); moveServo(reload, reloadEnd, reloadStart, 10); } void fireCannon() { // Run motor to pull spring back and fire digitalWrite(motorDirection, LOW); analogWrite(motorPwm, 255); // Approximately one revolution of the trigger wheel delay(4100); analogWrite(motorPwm, 0); } void resetServos() { moveServo(vertical, verticalPrevious, verticalMin, 15); moveServo(horizontal, horizontalPrevious, horizontalReset, 15); }
With this file you will be able to print Kitty Candy Cannon with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Kitty Candy Cannon.