Automatic Doghouse - Automatic Door and Heater Combined With Location Detection

Introduction: Automatic Doghouse - Automatic Door and Heater Combined With Location Detection

Hello doglover,

I assume that you have a dog you are in love with, so am I. I automized my doghouse and made a miniature version of it for my end project of my first year NMCT (

My doghouse exists of 2 parts, an area inside and an area outside. Those parts are seperated with an automatic door. When the dog moves in front of the door, the door opens immediately. Afterwards it closes automatically. This functionality works as well automatically as manually.

Further the real temperature inside is constantly measured. If the real temperature is dropping under the temperature set and the dog is inside, the heater will be enabled automatically. To determine the location of the dog, I installed a double light barrier at the door.

Next to the construction, I made a website to control the automatic doghouse that runs on the RPi. Besides the website, a MySQL database and the system code run on the RPi.

Beneath you can find a detailed explanation of how I did everything.

Have fun making this Automatic Doghouse!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: List of the Electronic Components

Below you can find a list of the different components used and their conforming datasheet. Besides you can find the electronic scheme and a bill of material.

  • RaspBerry Pi 3 with fitting adaptor and memory card (8GB) - Used for a webserver, database and voltage supply;
  • Elegoo Uno R3 Controller Board with USB Connection cable 0.4m (MicroUSB to type A) - Used to drive the different electronic parts with higher speed;
  • 2 x PIR Motion Sensor (SE062) - Used to detect movement before the door (Inside and Outside);
  • 2 x IR Break Beam Sensor - Used to determine the location of the dog (Inside and Outside);
  • Stepper Motor (28BYJ-48) - Used to move the door;
  • Stepper Motor Driver Board (ULN2003) - Used to control the stepper motor;
  • Button (+ Resistor 470 Ohm) - To detect if the door is open;
  • Temperature sensor (DS18B20) (+ Resistor 4.7k Ohm)- Used to detect the temperature outside to determine when the heater has to be enabled;
  • Red LED (+ Resistor 470 Ohm) - Used to simulate the heat lamp;
  • Alphanumeric OLED, 16 x 2 - Used to display the IP-address of the RPi;
  • Capacitor 1200µF 6.3V - To give the Alphanumeric OLED a constant display.

Step 2: Building the Frame

Cutting the construction

Take a plate of MDF with a size of 100 x 120 cm and cut out the different parts. If you want clearer pictures of the collage, you can find them in the .rar-file.

Part 1 & 2 - 28 x 20 cm

Part 3 & 4 - 40 x 20 cm

Part 5 - 40 x 60 cm

Part 6 & 7 - 50 x 4,5 cm

Part 8 & 9 - 28 x 4,5 cm

Part 10 - 50 x 30 cm

Door - Take part 3 and cut a gap of 7 x 5 cm out

Printing the 3D elements

3D-files will be uploaded soon.

Screwing the Basic Box Together

Step 1 - Screw parts 6, 7, 8 and 9 to each other.

Step 2 - Screw parts 1, 2, 3 and 4 to each other.

Step 3 - Take part 5 and attach the Arduino and RPi at the bottom of the plate.

Step 4 - Attach the construction from Step 1 to the bottom of part 5 with screws.

Step 5 - Attach the different 3D elements at the top of part 3 and 5.

Step 6 - Use a hand-drill to drill the different holes in the plank where you need to go down with your electronics.

Step 7 - Connect the electronic components to the Arduino and RPi.

Step 8 - Screw the construction from Step 7 to part 10.

Now you have your miniature doghouse.

Note: The sizes of the screws depends on the thickness of the plate of wood.

Step 3: Set Up Your Raspberry Pi 3

In the pdf below, you can find a clear explanation to set up your RPi and implement the database, webserver ...

You can also find a file with the ERD scheme.

Step 4: Create the Web Page

Download the Flask code

In the .rar-file you can find the code I made for the webpage.


Step 5: The Sensor Code

Download the sensor code
In the .rar-file you can find the code I made to drive the sensors.

Pets Challenge

Participated in the
Pets Challenge

Be the First to Share


    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Rope & String Speed Challenge

      Rope & String Speed Challenge
    • Wearables Contest

      Wearables Contest

    2 Discussions

    Great idea. You should enter this into the Pets contest.


    Reply 1 year ago

    Thanks, glad you like my project.