How to Make an Automatic Cat Toy With Arduino

Today I will tell you how to make a toy for your cat. This toy will make the bell ring, and when your cat jump on it, the arm which has the bell on it will move to a random place. And your cat will try to catch it.

Step 1: Ingredients

Let we start with make the components ready.

1x Arduino Nano(you can also use Uno, Pro Mini, Mega, Leonardo, Micro...)
2x SG90 Servo motor
1x TCRT5000 or CNY70 IR sensor
1x 7805 5V regulator
1x Breadboard, PCB or Veroboard
1x 10 kiloohm resistor

1x 220 ohm resistor

1x DC Motor

1x BD139 NPN Transistor
1x 9V 1A adapter
Tons of wire

Materials which aren't electronic:
A long cardboard tube(40cm is enough)
A Hot glue gun and a few hot glue tubes
Some cardboard
A bell
Some fake bird feather(not necessary)
A wooden plate to put it on that(you can use cardboard too)
A stick(nearly 20cm is enough)
If all materials are ready, we can start.
Note: You can use some 3D printed parts instead of cardboard to make it more durable.(if you have a 3D printer)

Step 2: Creating the Circuit

If you have all your components, you can do all the wirings.

There is the schematic in photos.

Note: I can't find TCRT5000/CNY70 and BD139 in Tinkercad Circuit Simulator. So I used a LED and LDR instead of TCRT5000/CNY70. And I used another transistor instead of BD139. If you are using BD139, be careful about C/B/E pinout of transistor.

If you had made the circuit, you will need the code.

Important: You must change the threshold value because the threshold value may change because of your cat's paws' color.

The Arduino code is here:

#include <Servo.h>
#define threshold 900   // You should change this "900" value.
Servo motor1;
Servo motor2;
byte servo1val;
byte servo2val;
void setup()
{
  pinMode(8, OUTPUT);
  motor1.attach(9);
  motor2.attach(10);
  motor1.write(90);
  motor2.write(90);
  delay(1100);
}
void loop()
{
  if(analogRead(A0)>threshold){
    digitalWrite(8, LOW);
    delay(200);
    servo1val=random(45,135);
    servo2val=random(0,180);
    motor1.write(servo1val);
    motor2.write(servo2val);
    while(motor1.read()!=servo1val);
    while(motor2.read()!=servo2val);
  }
	digitalWrite(8,HIGH);
}

Step 3: Making the Mechanic Side

There is a picture about the toy.

And there are some numbers on it.

1) A wooden or a cardboard plate

2) A cardboard roll which is nearly 40 centimeters long.

3) SG90 Servo Motor(motor2 in the code which is connected to pin 10)

4) SG90 Servo Motor(motor1 in the code which is connected to pin 9)

5) The stick(20cm is enough)

6) DC motor for vibration

This may be a little DC motor which is found in some baby toys. But put a little and light part(I recommend you to use a 1cm part of hot glue tubes) assymmetrically. This will make a vibration and ring the bell on the tip of the stick.

7) The bell. It may be a little bell which is used in cat collars.

8) It is not necessary but you can add a feather(but not a real bird feather that you have found at the street ;D)

9) The TCRT5000 or CNY70 sensor.

Note: I know I draw very very bad using the "Paint").

Step 4: Ready to Make Your Fluffy Friend Play!

This little toy will power the vibration motor so the vibration will make the bell ring. If your cat catches it with its paws, the sensor will sense that and move the arm to a random point and make the bell ring again. So your cat will try to catch it again and when it catches the bell again, this case will happen again.

I hope your fluffy friend loves it.

Have a nice day!

Share

    Recommendations

    • Frozen Treats Challenge

      Frozen Treats Challenge
    • 1 Hour Challenge

      1 Hour Challenge
    • Beauty Tips Contest

      Beauty Tips Contest

    Discussions

    0
    None
    seamster

    7 days ago

    Hello there!

    We're glad you want to share something with the Instructables community!

    And we’re here to help you out.

    In order to be published live on the site and be eligible to enter a contest, an Instructable must consist of the following things:

    - Multiple written steps showing how you made your project

    - Photos in each step

    - Only your own original images

    Check out our free online class that walks you through how to write an Instructable: https://www.instructables.com/class/How-to-Write-an-Instructable-Class/

    Beyond making your Instructable simply publishable, this guide (https://www.instructables.com/id/How-to-Create-a-Feature-Worthy-Instructable/) explains what is required to have your Instructables featured by our site editors. It’s very helpful, and definitely worth checking out.

    We would love to review your project again after you have made the necessary edits, and we will publish your project if it is eligible.

    If you have any questions, please feel free to ask right here or send us an email to service@instructables.com.

    Best,

    Instructables Community Manager