Mouse Trap With Pinoo

by pinoorobotics in Circuits > Arduino

133 Views, 1 Favorites, 0 Comments

Mouse Trap With Pinoo

Pinoo ile Fare Kapanı - Mouse Trap with Pinoo

Purpose of the Project: To make a system in which the mouse will be detected and the door will be closed by using the Pinoo control card, servo motor, light sensor (LDR) and buzzer module when the mouse enters the box we made.

Duration: 2 lessons

Pinoo Set: Basic, Invention, Maker, Full Set.

Age Group: 11 years and over

Gains:

• Learns to code Pinoo control card.

• Learns to use a light sensor.

• Learns to use buzzer module.

• Learns to use servo motor.

• Improves the skill of setting up algorithms.

• Improves coding skill.

Supplies

Materials to be used: Mblock 3 program, Pinoo control card, servo motor, buzzer module, light sensor (LDR), connection cables.

Materials Required for Design: Dekota, utility knife, fine and thick wire, silicone gun and silicone.

Design

IMG_4489.JPEG
IMG_4491.JPEG
IMG_4493.JPEG
IMG_4492.JPEG
IMG_4494.JPEG
IMG_4495.JPEG
IMG_4496.JPEG
IMG_4497.JPEG

  • For our project, we start by cutting our decota first.
  • We cut our decota into pieces like in the picture.
  • Then we will use thin wire to open the door of our mousetrap. For this, we make a hole with the help of a utility knife as in the picture.
  • We attach our thin wire to the holes to ensure the movement of the door.
  • Then we make a cut for our light sensor with the help of a utility knife.
  • We fix our decota parts with the help of a silicone gun as in the picture.
  • We fix our light sensor to the cut we made on the floor.
  • We fix our buzzer module on the sidewall of our mouse trap.
  • Then we connect our thick wire to the brush of our servo motor and fix the wire that we connect the servo motor to the wall of the mousetrap. Then we make the connections on our Pinoo control card. We connect our servo motor to gate number 2, buzzer module to gate number 3, and our light sensor to gate number 7.

Adding Pinoo Extension

a2.jpg
a3.jpg

  • From the Extensions tab, we click on the "Manage Extensions" option.
  • 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.

Connecting the Pinoo Sensor Board to the Computer

a4.jpg
a5.jpg
a6.jpg
a7.jpg

  • In Mblock 3, we click on the "Connect" tab on the upper left.
  • We click on the "Serial Port" section from the window that opens and select the "COM6" option from the page that opens. NOTE: Since the port entries of each computer are different, the numbers next to the COM text may change.
  • We click on the Cards tab.
  • We select the "Arduino Nano" card option used by the Pinoo sensor card from the window that opens.
  • We click on the Extensions tab.
  • In the window that opens, we select the extension "Pinoo" of the sensor card we use.
  • We click on the Connect tab.
  • We click on "Firmware Update" from the window that opens.

Coding Part

11_0bd2f321-e6ad-482f-8a27-6972658c734d.png
12_e888bcc8-ea17-42e5-a325-e81585e248f3.png
13_a31c5e31-2022-4f31-8976-bdd66e94a24b.png
15_7467eae1-d204-4949-abae-0390a879e705.png
16_377e8667-cfa1-4de2-91d9-f0f66a995a7a.png
17_023690d1-b6b0-41d4-8ab2-001cb2f6826b.png
18_eae83ef4-7f10-4074-8c72-a30bd5ed4964.png
  • First, we place our servo motor start code under the 'When the Key is Pressed' codes to check whether our servo motor works or not. In this way, we control the working status of our servo motor.
  • When the green flag is clicked, we control our buzzer module by running it with a sound code under the code.
  • To find out whether our light sensor is working or not, we can see the values by reading our "read light sensor" code under the "Green Flag" code in the "say hello" code.
  • We start our code with the green flag code. At first, we set the angle of our servo motor to 0 degrees so that our mousetrap door remains open.
  • In the continuous repeat code, if our light sensor value is less than 200, we want our servo motor to bring its angle to 135 degrees, that is, the door is closed.
  • Then, repeat 20 times, we want our buzzer module to run in half-second intervals into our cycle and we complete our coding in this way.
  • We right click on the "Pinoo Program" command and select the "Upload to Arduino" option in the window that opens.
  • On the page that opens, we click on the "Upload to Arduino" button selected in red.
  • Our codes are uploaded to our Pinoo control card.
  • We click on the "Close" button after the "Download Finished" text appears. After the installation is finished, the battery compartment is inserted and the project is run.

Working Status of the Project

calisma.jpg

  • If the mouse enters, the light sensor will detect the mouse and our door will close.

Downloads