Final Project

Pet S-Home

Introduction:

From generating an idea to creating a prototype that represents that basic idea, there is a road that is full of steps that headed forward and sometimes backward. And of course, a lot of challenges will arise during that trip.

 

In this page you will view every step I took, challenge I faced, modification I made during my trip of making a prototype of my final project at maker diploma - round # 16.

 


There are mainly five stages of that trip:

 

  1. Generating and identifying the idea of the project.
  2. Developing a design for:
  • The model.
  • Electronic circuit.
  • Arduino code.

 

     4.  Manufacturing.

     5. Integration and assembly.

     6. Test for validation.

 

To be honest, I didn’t go through those stages in series as you might think. In fact, sometimes I needed to jump from one stage to another forward and backward with no order. Or even go through two stages in parallel whenever needed.

 

Let’s go…


Generating and identifying the idea of the project:

At first, I thought of a pet outdoor smart house that have the following features:

 

1- its light turns on when the pet is home and turns off when it’s out.

2- it recognizes the behavior of the pet as if the pet is safe inside, playing outside, eating, or drinking. and sends that info to your smart phone.

3- it has a feeder that supplies the plates with food and water.

4- it sends your phone a warning message when the food is about to run out from the feeder.

5- it has a storage memory to record the behavior of pet with their corresponding date and time. In order to use it when you visit its vet.

 

And that should help pet owner to take care of his pet easily even when he is away from it. Especially, if he is a regular traveler or busy most of the time. He ‘ll make sure that his pet is safe, eating well, and healthy.

 

To be realistic, I won’t be able to work on all those features since I’m a newbie, so I choose only the first 2 features to be the ones applied to my model during the diploma. While the other features will be added in the future Insha’Allah after maker diploma.


Now I can I identify my project as a pet smart outdoor house that:

1- its light turns on when the pet is home and turns off when it’s out.

2- it recognizes the behavior of the pet as if the pet is safe inside, playing outside, eating, or drinking. and sends that info to your smart phone.

 And I gave it a name of (pet S-home)

To achieve this, I think I will use an Arduino, Bluetooth module, IR sensors and light bulb as the main components.

Before I move on, I would like to thank my mentor Eng. Sherif Rashwan for his great advices that helped me a lot in this stage. Also, I ‘d like to thank Eng. Sherif Mokhtar for his guidance in Cad design.


Developing a design for the electronic circuit:

I figured the components I ‘m going to use in the project to be:


To connect the circuit,

I used tinkercad.com and I draw the following circuit


Developing the Arduino code:

The Arduino code is the soul of the project. I want to write an Arduino program to do the following:

- turn the light bulb on when the cat is entering the house. And sends the statement “Cat is safe inside”.

- turn the light bulb off when the cat is exiting the house. And sends the statement “Cat is playing outside”.

- sends the statement “Cat is having nice meal” when cat is eating.

- sends the statement “Cat is drinking” when cat is drinking.

 

First, I defined Arduino pins (7,9,10,11,12) for bulb, and IR sensors.


Then,

 I defined two variables to use them later to slow down the serial writing when cat is eating or drinking 


In the setup loop:

 I defined the IR sensors as inputs to the Arduino. The bulb as Output from the Arduino. Also, I initialized the serial.


In the void loop

I used if statement to check if the cat is entering the house. So, the Arduino opens the light and sends the message via Bluetooth “Cat is safe inside” accordingly.

The condition for the statement is if (the indoor IR sensor is triggered while the outdoor IR is not ) which means the cat is completely inside.


then,

I used another if statement to check if the cat is exiting the house. So, the Arduino opens the light and sends the message via Bluetooth “Cat is playing outside” accordingly.

The condition for the statement is if (the outdoor IR sensor is triggered while the indoor IR is not ) which means the cat is completely outside.


then,

I used two if statement to send the message” Cat had a nice meal” via Bluetooth accordingly. I used the flag variable to slow down the message sending.


also,

I used two if statement to send the message” Cat drank some water” via Bluetooth accordingly. I used the flag variable to slow down the message sending.


here is the full code;

also, you can find the arduino file down below in files section


then I used tinker cad circuit to simulate the code

 I only replaced the IR sensors with PIR sensors that can be simulated. it worked well.


Developing a design for the 3d model:

In order to create a digital 3d model for the project I started with a general sketch on a piece of paper; to think of what pet S-home model should look like.


Then I concluded the following things to be considered in the design:

  • The electronic components should be fixed on the internal roof. In order to clear the pet space from any electronics or wires.
  • The plates should be removable. To easily fill them again.
  • Holes for sensors fixation and wires should exist.
  • design Joints of square profile for good assembly.
  • None of the house sides should exceed the dimensions of 30 * 50 (that is the standard size of wood plates for the laser cutting machine.
  • the base, walls, and roof will be laser cut.
  • Also, I want the electronics to be fastened to one surface only if possible. To make it easy during the assembly.
  • Plates and mountings of the IR sensors will be 3d printed.
  • Holes for electronic components fasteners are 3mm diameter.


Now I ‘m going to create 3 designs; one for the plates and another for the IR holders and the last one for the house itself and it contains:

  • Base.
  •  front.
  • Back side.
  • Left side.
  • Right.
  • Internal roof.
  • Outer roof.
  • Plate holder.
  • Plate holder supports.


Plates Design:

 

  • Using  new sketch and extrude orders I was able to build the plate and then I export it as a STL file to create the gcode for the 3D printing.


IR holders design:

-    Using sketch and extrude orders I was able to build the plate and then I export it as a STL file to create the g-code for the 3D printing.


House 3D design:

1.

I started with setting two parameters (k), and (t) for laser kerf value and thickness of wood sheets. With values of 0.1 and 3mm respectively in order to use them in dimensions.


2.

To design the house, I started with the left side wall sketch, and then extruded it.


3.

Then I drew the right-hand side wall as a copy of the left side wall at space of 400mm.


4.

I drew the back side using the projection of the left and right sides, then I extruded it.


5.

I copied the back side to create the front side as space between them of 25mm.


6.

I cut the door through the front side.


7.

I sketched the base using the projection of the four walls and then extrude it.


8.

To create the internal roof, I sketched a rectangle using the projection of the four walls and extruded it. Then, I used the four walls as tools to combine(cut) the extruded rectangle. Because I need the internal roof to be removable.


9.

For the outer roof, I constructed an offset plane to the right-side wall, and sketched on it; two rectangles, to be the thickness of the two halves of outer roof, using the projection of the triangle sides in the right-side walls.


10.

Then I extruded one of them and sketched its up and down teeth and cut them.


11.

Then, I extruded the other rectangle to create the other half of the roof. and by Using combine (cut) order I was able to create the teeth of it.


12.

For the plate holder supports I drew one and copied it to create the other two supports.


13.

Using the projection of the supports on the right-side wall I sketched and cut holes for them in it.


14.

Then I drew the holder plate, extruded it, combine (cut)it by using supports as tools.


16.

Finally, I exported each face sketch as DXF file to be ready for laser cutting machine.


Manufacturing:

I used digital manufacturing such as 3D printing and Laser cutting to create the different parts of the model


3D printing

I used the 3d printer in fab lab Egypt to produce the plates and the IR hlders. for more details of the process of producing them go to the  3D printing section


laser-cutting

I used Fab Lab Egypt Laser cutting machine to produce the base, walls, Inernal roof, outer roof, plate holder, and plte holder supports. to view the fully detailed process of manufacturing these parts Go to the Laser-Cutting section.


Integration and assembly:

during the assembly, I had a bit of a problem where the holes in the base didn't fit for the 4walls' teeth. in order to solve that problem, I redesign the base only with no use of laser kerf value to make sure it is loose. and then I used wood glue to assemble all the parts.

 

after that;

- I fastened the Arduino to the internal roof.

- I fastened the IR holders in their positions.

- I fixed the other components using double sided tape.

- I connected between the different electronic components using the circuit diagram.

- finally, I uploaded the code to the Arduino and it's time for first test.

 


Test for validation.

the following link is a video for the test. the result was amazing Alhamdulillah

https://youtu.be/v1MUnNxUVkk