Auto Lock with Pinoo

 

 

Purpose of the Project: Creating an automatic lock project with the PIR (motion) sensor and servo motor module using the Pinoo control card.

Duration: 2 lessons

Age Group: 7 years old and above

Set Used: Pinoo Maker Set, Invent Set, Full Set.

Achievements:

-Learns to code the Pinoo control board.

-Learns to code Pır (motion) sensor.

-Learns to code the servo motor module.

-Algorithm building skill develops.

-Coding skill improves.

Design skill improves.

 

Materials to be used: Mblock 3 program, Pinoo control card, pır (motion) sensor, servo motor module, connection cables

 

Materials Required for Design: Decota, colored evas, scissors, pencil, knife, screwdriver, ruler, silicon gun and silicon, aluminum wire, thin copper wire, lock

 

 

Project Preparation:

 

  1. First of all, we will create the door of the house. For this, we draw a 15x15cm square on the decorate using a ruler and pencil. We cut the square with the help of a knife.

 

 

 

  1. We adjust the location of the lock on the piece we cut and draw the door according to the position we set.

     

  1. We cut the door we have drawn with the help of a knife.

 

  1. We drill two holes in the door and the wall, one under the other, in the same alignment.

     

 

 

 

  1. We cover the door and the wall with eva.

 

 

 

 

 

  1. We connect the door and the wall by passing thin copper wire through the holes.

 

 

  1. For the side walls of the house, using a ruler and pencil, we draw two 12x15cm rectangles on the deco. We cut the rectangles we have drawn with the help of a curved knife.

 

  1. With the help of a silicon gun, we assemble the front and side walls of the house to each other as shown in the figure.

                

 

 

 

  1. We cover the interior of the house with evas.

 

 

 

  1. Using a ruler and pencil, we draw the roof in accordance with the dimensions of the house. We cut the roof we have drawn with the help of a curved blade.

                 

   

  1. We cover the front and back of the roof with eva. Then we mount it to the house with the help of a silicone gun.

 

 

  1. We complete the roof with evas.

         

 

 

  1. With the help of a silicone gun, we mount the lock on the door as shown in the figure.

 

 

 

  1. With the help of a screwdriver, we mount the propeller to the servo motor module.

 

  1. We fill one end of the aluminum wire to the propeller of the servo motor module as shown in the figure.

 

  1. We fill the other end of the aluminum wire into the lock when the door is locked. We assemble the servo motor module with the help of a silicon gun as shown in the figure.

 

               Note: The angle of the servo motor module will be 180 when the door is locked. For this     reason, before mounting, let's make the angle 180 degrees.

   

 

  1. We connect the servo motor module in a way that corresponds to Brown cable-GND, Red cable-5V, Orange cable-D0.

 

  1. We mount the Pır (motion) sensor on the wall above the door with the help of a silicon gun as shown in the figure.

 

  1. For the bottom of the house, using a ruler and pencil, we draw a 15x15cm square on the decorate. We cut the square that we have drawn with the help of the curved knife.

 

  1. We assemble the base and the house with the help of a silicon gun.

 

  1. We decorate the house as we wish.

 

22. We make doorknobs from decota to be able to open and close the door comfortably.

 

23. We connect the servo motor module and motion sensor to the Pinoo control card with the help of a connection cable.

We connect the servo motor module to the purple input number 3.

We connect the Pır (motion) sensor to the purple input number 2.

 

  1. We have completed the connections and the design, now we go to the coding part. We will use Mblock-3 application for this.

 

 

  1. We connect our Pinoo control card to the computer with the help of a connection cable and log into the Mblock3 application. Then we introduce our Pinoo control card to the computer. For this, we first click on the serial port option from the Connect tab. Then we choose COM5. (The number may differ depending on the computer and the port.)

 

 

  1. After making the serial port connection, we select the card we will use from the Cards tab. We are working with Arduino Nano model.

 

  1. In order to add the Pinoo extension to our computer, we click on the manage extensions option from the Extensions tab. In the window that opens, we type "Pinoo" into the search engine and simply say download to the result. It was installed on our computer.

 

 

  1. We come to the Extensions tab again and click on the Pinoo option. We will write our codes with the Pinoo extension.     
  2. We come to the Connect again tab and click on the Firmware Update option. After saying that the installation is finished, we click on the Close button.

 

 

  1. In the coding part; To start the application, we get the code when the Green Flag is clicked from the Events menu.
  2. We get help from the puppet to learn the value read by the motion detection sensor. For this, we get the "say hello" command from the view tab. Instead of saying Hello, we get the code block for the motion detection sensor from the robots tab. We change the pin input to Pinoo2 with which we connect.

 

 

  1. We click on the green flag and try the project. If there is no problem in the operation of our project, we need to load the codes we have written into our card in order to run our project with a power source independent of the computer.

      

 

 

  1. To adjust the angles of the servo motor module, we say that it is 90 degrees when the up arrow key is pressed, 180 degrees when the down arrow key is pressed. By clicking the keys, we look at the angles of the servo motor module.

 

 

  1. When the green flag is clicked again from the Events tab, we get the code. Then, when the green flag is clicked, we make 90 degrees so that the door is open.

 

 

 

  1. Repeat continuously from the control menu and if not, we get the code.

 

 

  1. We get the equal operation from the transactions menu. If the value read by the motion sensor is equal to 1, we write the code.

 

 

  1. If the value measured by the motion detection sensor is equal to 1, we wait 10 seconds and make the degree 180. Thus, if the sensor detects motion, it will wait 10 seconds and lock the door.

 

 

 

  1. If the value measured by the motion detection sensor is not equal to 1, we write the code, let it be 90 degrees. Thus, if there is no movement, the door will be unlocked.

 

 

  1. We click on the green flag and try the project. If there is no problem in the operation of our project, we need to load the codes we have written into our card in order to run our project with a power source independent of the computer.

For this, we throw away the "Click on the green flag" code we used at the beginning and get the Pinoo Program code from the Robots menu.

 

 

 

  1. Right click on the code and click the Upload to Arduino option. (We work with Arduino as a card.)

 

 

 

  1. In the window that opens, we click the Upload to Arduino button again.

 

 

 

 

  1. We are waiting while our codes are being loaded to the card. After saying the installation is finished, we click on the close button.

 

 

 

  1. If there is no problem, we disconnect our power cable from the computer. We power our Pinoo Control board with the help of a 9v battery and a battery cap. We also turn the on / off button right next to the battery inlet to the on position.

 

 

  1. Working Status of the Project:

If the motion detector sensor reads the value 1, that is, if one of them goes out, it will wait 10 seconds and the door will be locked.

 

If the motion detector sensor reads 0, that is, if nobody comes out, the door will remain open.

 

 

 

WITH PINOO SETS, CHILDREN CAN DO HUNDREDS OF PROJECTS WITH MATERIALS WHICH THEY CAN COMFORTABLY FIND AT HOME.