Parking Sensor With Pinoo
Purpose of the Project: To create a parking sensor project with buzzer module, led module and distance sensor using the Pinoo Control Card.
Duration: 2 lessons
Age Group: 9 years and older
Pinoo Set: Basic,Invention,Maker,Full Set
• Learns to code Pinoo control card
• Learns to code the distance sensor.
• Learns to code the buzzer module.
• Learns to code the LED module.
• Improves the skill of setting up algorithms.
• Improves coding skill.
• Understands the logic of parking sensors.
Materials to be Used: Mblock 3 program, Pinoo control card, distance sensor, buzzer module, led module, connection cable
Materials Required for Design: Car and wall made of legos, scissors, silicone gun and silicone, grass, black cardboard, double-sided tape, box
NOTE: You can make a car from consumables instead of Lego or you can use a toy car.
1. We mount the distance sensor at the rear of the car with the help of a silicon gun.
2. We stick the double-sided tape on the back of the distance sensor.
3. Then we stick the buzzer module on the double-sided tape.
4. We stick double-sided tape on the cable entry part of the distance sensor.
5. Then we mount the led module on the double sided tape.
6. We cover the car and decorate it a little so that the design is beautiful. We are careful not to destroy the led completely.
7. We make our connections. We connect the distance sensor to the purple / green input number 5 with a jumper wire. We connect the buzzer module to the door number 3 and the led module to the purple input number 4.
8. We take the box.
9. We stick the black cardboard on the box with the help of a silicon gun. Thus, we prepare the road.
10. We stick grass on both sides of the road with the help of a silicone gun.
11. We mount the wall we built at the end of the road with the help of a silicone gun.
12. We mount the Pinoo control board on the side of the box with the help of a silicon gun.
13. We have completed our connections and design, now we move on to the coding part. We will use mblock-3 application for this.
14. We connect our Pinoo Control Card to the computer with the help of a connection cable and enter 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 COM3. (The number may differ depending on the computer and the port.)
15. After making the serial port connection, we select the card to be used from the Cards tab. We are working with Arduino Nano model.
16. 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.
17. We come to the ‘’Extensions’’ tab again and click the Pinoo option. We will write our codes with the Pinoo extension.
18. In the coding part; To start the application, we get the code when clicking the Green Flag from the Events menu.
19. We will get help from the dummy to learn the value read by the distance sensor. For this, we get the "say hello" command from the view tab. Instead of the word Hello, we get the code block for the distance sensor from the robots tab. We change the pin input to Pinoo5 that we connect.
Since we want it to do the reading process continuously, not once, we take all our codes into the continuous repeat block from the control tab.
20. We click on the green flag and observe the change in values by moving our hand closer to the sensor and away.
21. When the Spacebar is pressed from the Events menu, we get 2 from the code. Then we click on the small triangle next to the space text and change one of them to down arrow and the other to up arrow. We get the led module code from the Robots tab and change the pin part to pinoo 4. On the up arrow key, the led will turn on, on the down arrow key we will turn the led off. We control the LED module by pressing the buttons.
22. When another space key is pressed, we receive the command. We take our buzzer module code from the Robots tab and change the pin part to Pinoo 3. We choose the note part we want. We activate the buzzer module by pressing the spacebar.
In order to make a parking sensor, we will code the different distances measured by the distance sensor. LED module and buzzer module will work differently at every distance. Now let's put this into code that we wrote.
23. First of all, we will code the situations where the value measured by the distance sensor is between 10 and 15. For this, we get the command if it is from the control menu. We take and nest the comparison marks from the operations and, smaller, greater than, and nested. Then we code it as bigger than 10 and smaller than 15.
24. If the value measured by the distance sensor is between 10 and 15, buzzer module let the binary be active and the led module burn, then let the buzzer module be passive and the led module go off. To put it on hold, we get the ‘’wait 1 second’’ code from the ‘’control’’ tab and change the number 1.
25. Then, if the value measured by the distance sensor is between 5 and 10, we code the buzzer module and led module as active and passive with 0.2 second intervals continuously.
26. If the value measured by the distance sensor is between 0 and 5, we code the led module and buzzer module to be active continuously.
27. Then, when the distance sensor is equal to 0 and greater than 15, we code the buzzer and led modules to be passive continuously.
NOTE: The distance sensor can measure up to a maximum of 4 meters. It cannot measure beyond 4 meters and shows the value 0. We also code the case where it is equal to 0 so that there is no logic error in coding.
After completing our codes, we check the operation of our project by clicking the green flag.
29. 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 the code that we made the puppet tell the sensor value and get the Pinoo Program code from the Robots menu.
30. Right click on the code and click the Upload to Arduino option. (We work with arduino as a card.)
31. In the window that opens, we click the Upload to Arduino button again.
32. We are waiting while our codes are being loaded to the card. After saying the installation is finished, we click on the close button.
33. 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.
Working Status of the Project:
When there is no obstacle in front of the distance sensor, the buzzer module and led module are passive.
When there is an obstacle in front of the distance sensor, the buzzer module and led module are active.