Parking Sensor With Pinoo

by pinoorobotics in Circuits > Arduino

222 Views, 0 Favorites, 0 Comments

Parking Sensor With Pinoo

Pinoo ile Park Sensörü - 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

Benefits:

• 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.

Supplies

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.

Project Preparation

2.JPG
1.JPG
5.JPG
6.JPG
7.JPG
8.JPG
9.JPG
10.JPG
3.JPG
14.JPG
16.JPG

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.

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

Adsız.png
Adsız2.png
Adsız3.png
Adsız4.png
Adsız5.png
Adsız6.png

  • In the coding part; To start the application, we get the code when clicking the Green Flag from the Events menu.
  • 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.
  • We click on the green flag and observe the change in values by moving our hand closer to the sensor and away.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • Right click on the code and click the Upload to Arduino option. (We work with arduino as a card.)
  • In the window that opens, we click the Upload to Arduino button again.
  • We are waiting while our codes are being loaded to the card. After saying the installation is finished, we click on the close button.
  • 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

37.PNG
38.PNG

  • 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.