Hamster Door

by k589y657 in Circuits > Arduino

17 Views, 1 Favorites, 0 Comments

Hamster Door

OIP.jpg

The idea for this project stemmed from one of our group members having a pet hamster. You may not always be home all the time and you might not be there to feed your hamster. Having a hamster door set up can allow you to pre-load your food and not worry about having to feed it during feeding time! By adding a delay to the start of your code, you can time it to only open when it's feeding time. Afterwards, the hamster door will detect whenever the hamster gets close enough and it'll open up with its meal.

Supplies

Screenshot 2025-05-05 153931.png

12in x 12in cardboard pieces (5x)

Arduino UNO (1x)

Breadboard (1x)

Male wires (5x)

Female wires (4x)

Ultrasonic distance sensor (1x)

Servo (1x)

Battery pack/4 AA batteries (1x)

Hot glue

Duct Tape

Circuit Construction

Spectacular Lappi.png
image-20250505-210331-0ea96f1e.jpeg

Supplies Needed:

  1. Female (4x) and male (5x) wires
  2. Arduino Uno
  3. Breadboard


The circuit is a relatively simple build. Using the schematic shown, the female wires directly attach to the distance sensor and to the pins shown. Use 2 male wires to have a 5v line and ground line on the breadboard. The last 3 wires should go to the servo and wired to their respective pins. After creating the circuit, mount the breadboard and Arduino to the side of a wall and manage wires by taping to the side as needed.

Door Construction

IMG_1265 (1).png

Supplies Needed:

  1. Cardboard sheets
  2. Hot glue
  3. Battery pack
  4. Servo
  5. Ultrasonic distance sensor
  6. Duct Tape

Begin by gathering your materials.

IMG_9937.jpg

With one of the cardboard sheets, cut out a 5in x 8 in hole. Hold on to cutout piece. Attach the servo with hot glue about 4 inches above what will be the bottom of your door.

IMG_9938.jpg

Hot glue cutout piece onto the servo. Leave a little gap for your door to be able to open.

IMG_9940.jpg

Mount the door sheet and another cardboard sheet onto a base cardboard sheet using hot glue. You should end up using the door you created, and two more cardboard sheets.

IMG_9941.jpg

Carefully poke holes using the ultrasonic distance sensor 4 inches above the door. You will have to adjust the angle as needed later.

IMG_9906.jpg

Mount the circuit board onto the wall. Use duct tape or hot glue to do so. Attach wires to pins as shown.

image-20250505-210331-0ea96f1e.jpeg

Mount the last 2 cardboard pieces to close off the door. Use hot glue to seal off all the pieces.

image-20250505-210219-59147331.jpeg

Adjust the sensor as needed and test for detection range. Once the ideal angle is found, duct tape the sensor in place. (Optional): Wrap box in duct tape and add a roof to cover wires.

Code and Flowchart

Screenshot 2025-05-05 154636.png

The idea of the code is simple: open and close a door after detecting a hamster. Open upon initial detection, and close upon a secondary detection. Since there's only one sensor, the code must account for the fact that the door needs to stay open while the hamster is inside the room. By writing a double detection sequence, it ensures the hamster will not get trapped inside of the room.