Smart Cabinet with Pinoo

Purpose of the Project: To create a smart cabinet system with light sensor (LDR) and servo motor using Pinoo control card.

Duration: 2 lessons

Age Group: 9 years and older

Pinoo Set: Basic Set, invention set, maker set and full set.

Benefits:

  • Learns to code Pinoo control board.
  • Learns to code the light sensor (LDR).
  • Learns to encode the servo motor.
  • Algorithm building skill develops.
  • Coding skill improves.

 

Materials to be Used:

Mblock 3 program, Pinoo Control Card, Light sensor, Servo motor and impeller , connection cable

 

 

Materials Required for Design: Small box, colored cardboard, scissors, silicone gun, paint, chenille, rope

  

 

                   

Project Preparation:

 

We drill a servo-motor sized hole in the top cover of the box and insert the motor.

 

 

We drill a hole as the size of the light sensor in the side of the box and fix the light sensor in the hole.

     

We place the Pinoo board inside the box and drill a hole in the box for the connection cable.

   

We place the Pinoo board inside the box and drill a hole in the box for the connection cable.

 

To divide the circle into two equal parts, we glue the rectangular part as a wall.

 

We fix the propeller of the servo motor in the middle of the lower part of the circle.

 

We fix the propeller of the servo motor in the middle of the lower part of the circle.

 

 

We design and cut outfits from colored cardboard. We have prepared four outfits for this project.

We make hangers on clothes with rope. For this, we silicone the two ends of the rope on the clothes.

 

 

We connect the cabinet and the box by attaching the propeller to the servo motor.

 

 

We decorate the box and the cabinet as we wish and hang the clothes on the hanger. We set a clothing point on the front of the box. You can put a mark or stick a shape to indicate here. We made a determination with the butterfly shape here.

 

Let's make our connections. We open the cover of the box and connect our light sensor to the red input number 8 from the input (purple) corresponding to the label on the servo motor with connection cable.

 

We have completed our connections, now let's move on to the coding part. We will use the Mblock-3 application for this.

 

 

Let's connect our Pinoo control card to the computer with the help of the connection cable and enter the Mblock3 application. Then, let's introduce our Pinoo Control Card to the computer. To do this, we first click on the serial port option from the Connect tab. Then we select COM3. (The number may differ according to the computer and the port.)

  

After making the serial port connection, let's select the card we will use from the cards tab. We are working with Arduino Nano model.

 

 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" in the search engine and click download to the result. It has been installed on our computer.

 

Come to the extensions tab again and click the Pinoo option. We will write our codes with the Pinoo extension.

  

In the coding part; To start the application, we get the code when the Green Flag is clicked from the Events menu.

 

We will get help from variables in order to learn the value read by the light sensor. We create a variable named light in the Data & Block tab.

 

We need to specify that the light variable we have created is equal to the value read by the light sensor. We take the get light block from the data block tab and place the code block related to the light sensor in the value (0) part from the Robots tab.

 

*** Do not forget to change the pin number. We made the sensor connection to the Pinoo8 input.

 

In order to repeat the value reading process continuously, we take the code block from the control tab with continuous repetition and place our codes in it.

In the upper left corner, we can observe the values ​​of the light. You leave the light sensor with your hand in the light and dark place and observe the values ​​it receives and take notes.

  

Let's set the threshold value of the sensor as 30 for night time (You can change this threshold value as you wish according to your project) and create the necessary conditions. If the light is less than 30, take the If block and operations tab from the Control tab to create the statement we form our statement.

 

If the condition is fulfilled, that is, we want the servo motor to rotate at 0 degrees (our cabinet). From the Robots tab, we take the code block related to the servo motor and change the pin: Pinoo2 angle value to 0.

Since we want this process to be constantly controlled, we place all blocks in the repeat block.

 

We do the same for the daytime situation. This time, we set the threshold value as 900. If the read value, that is, the light is greater than 900, we want the servo motor to rotate (our cabinet) at 180 degrees.

 

After completing our codes, we check the operation of our project by clicking the green flag. We cover the sensor with our hands and create a dark environment (when it is night). The servo motor should be returning to the clothing point with night clothes.

 

 

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 it with a power source independent of the computer.

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

 

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

 

We are waiting for the codes to be uploaded to the card. After the installation is complete, we close the window.

 

 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 input to the on position.

 

 

With Pinoo sets, children can make hundreds of projects with materials they can easily find in their homes.