Wall Alarm With Pinoo

WALL ALARM

Aim of the Project: To create an alarm system using distance sensor and buzzer module of structures such as newly built walls using Pinoo Control Card. In this way, when people get closer, the situation of damage is minimized.

Time: 2 lessons

Age Group: 9 years old and above

Main goals:

  • Learns to code the Pinoo Control Card.
  • Learns to use the distance sensor.
  • Learns to use the buzzer module.
  • Improves to the ability to establish algorithms.
  • Coding skill improves.
  • Design skills improve.

Required Materials: 

  • Mblock 3 program
  • Pinoo Control Card
  • Distance Sensor
  • Buzzer Module
  • Cables

 

Materials Required for Design: Empty cardboard box, brick figure, silicone gun and silicone.


  

Implementation of the Project:

  1. Let's start our project by designing the wall first. Let's cover our cardboard box with brick visuals with the help of silicone machine.

 

  1. After covering the box, let's place the distance sensor on the left side with the help of a silicone gun.

 

  1. Next, let's put the buzzer module on the right side.

 

  1. After placing our circuit elements, let's place our Pinoo Control Card on the back of the wall. Thus, we can connect the distance sensor and the buzzer module to our Pinoo card.

We connected the distance sensor to input number 6 and the Buzzer module to input number 4. We can connect different inputs on our Pinoo Control Card in accordance with the colors on the sensors.

  1. We have completed our design and connections now let's move on to the coding section. We will use the Mblock 3 application for coding.

 

 

  1. Let's connect our Pinoo Control Card to the computer with the connection cable and enter the Mblock3 application. Then let's pair our Pinoo Control Card with the computer. To do this, we click the serial port option on the Connect tab. Then we choose com4. (The number may differ depending on the computer and port.)

 

  1. After making the serial port connection, let's choose the card we will use from the cards tab. We work with the Arduino Nano model.

 

 

  1. After selecting our card, we click on the Pinoo option from the Extensions tab. We will write our codes with the Pinoo extension.

 

 

  1. After making our selections, finally, we complete the connection process by doing Firmware Update from the Connect option.

 

 

  1. After the update is over, we proceed to the coding stage. First of all, we get the code "Clicking the Green Flag" from the Events menu for start the application.

 

 

  1. Next, we get the code 'Say Hello' from the View menu to see the value of the Distance Sensor on the screen.

 

 

 

  1. We get the code to read the Distance Sensor's Value from the Robots menu. We select the port number to which we connect our sensor.

 

 

  1. Then we place our code, which reads the value of the distance sensor, in the code 'Say hi'. To see this value continuously, we take the code 'repeat continuously' from the control menu and place it in other codes. We see that our puppet shows the value.

 

 

  1. After completing our codes related to the Distance Sensor, let's move on to the codes of our Buzzer module, which we use to give a warning when the object approaches. First, let's get the code required for the buzzer to make a sound from the Robots menu and select the port number it is connected to. We can randomly select it by listening to the note and the range part.

 

 

  1. When our obstacle approaches our wall, buzzer will give an audible warning and will not give any warning if there is no obstacle. We take the 'if-else' code from the control menu and put into the code 'repeat continuously'.

 

 

  1. If the value of our distance sensor is less than 20 cm, that is, if the obstacle is approaching the wall, the buzzer will give an audible warning. If it is not smaller than 20 cm, buzzer should not give any warning. For this, we place the 'less than' operation in the 'if-else' code in the transactions menu. 

 

  1. Next, we enter the code that reads the distance sensor's value to the left side of the transaction and add the number 20 to the right side of the transaction.

 

 

  1. Buzzer warns when the value of the distance sensor is less than 20cm, if not, it does not warn. For this condition, we add the 'buzzer sound on and off' code to the relevant places.

 

  1. After completing our codes, we check the operation of our project by clicking the green flag.
  2. When our hand closer to the distance sensor, our puppet showed a value less than 20 and buzzer beeps.

  1. If there is no problem in the operation of our project, we need to load the codes that we have written in our card to run our project with a power supply independent of the computer. For this,firstly, we send our 'Say Hello' code to the trash. (Since the code 'Say Hello' is a code that allows our puppet to speak, this code does not work when we want to load our codes on the card.)

 

 

  1. Then, we send the 'click on the green flag' code that we used at the beginning and get the Pinoo Program code from the Robots menu.
  2.  

 

  1. Right click on this code and click on the ‘install on arduino’ option (Because, we are working with arduino board.)

 

 

  1. We wait the codes to be loaded on the card. After the installation is completed, we close the window and remove the Pinoo Control Card connection cable from the computer.

 

 

  1. Finally, with the help of 9v battery and battery cap, we plug the power supply into our Pinoo Control card.