Vehicle Cleaning System with Pinoo

 

Purpose of the Project: To make a vehicle wiper project by using the Pinoo Control Card, Servo Motor and LDR module.

Duration: 2 lessons

Age Group: 7 years and older

Benefits:

• Learns to code Pinoo control card.

• Learns to use servo motor.

• Learns to use the Ldr module.

• Improves the skill of setting up algorithms.

• Improves coding skill.

 

Materials to be used: Mblock 3 program, pinoo sensor card, 2 servo motors, ldr module.

 

 

 

 

Materials Required for Design: Box and lid, colored cardboard, utility knife, sponge, toy car, silicone gun and silicone.

 

                              

            

 

Project Preparation:

 

1. For our project, let's start with designing a box.

 

Let's stick the cardboard inside the box.

 

 

Let's cover the outer part of the box with cardboard.

 

 

We cut the inner part of the box so that the ldr can enter it.

 

  

We place the Ldr sensor with silicone.

 

  

We remove the ends of the servo motors and silicon the parts we open on the sides.

(After adjusting the angles of the servo motors, we will attach the ends.)

 

 

  

We install the RJ-11 cable of the Ldr sensor.

 

  

We place the lid of the box at the bottom.

(Since we stick the LDR below, we use the cover so that it does not look crooked.)

You can paint if you want. Let's plug in all RJ-11 cables. We can plug in the connecting cable and move on to coding.

 

2.Adding Pinoo extension:

  

 

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.

 

3.Connecting the Pinoo sensor board to the computer:

  

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.

 

 

4. Coding part:

 

 

Clicking the green flag, we run it to see the light value of the environment on the screen.

First of all, we make the angle 0 on the 2 servon.

 

  

We will use one of the sponge. We cut this sponge in half as in the picture and make it thinner a little.

 

 

 

  

 

We attach the ends of the servo motor and silicon the sponges.

  

  

If the light value is less than 150, we encode the servo motors so that they move between 0-180 angles.

 

  

If the light value is greater than 150, we make the angle of the servos 0.

 

  

In order to upload our codes to the pinoo sensor card, we make the start of the event "Pinoo Program" command and delete the code we use to display the light value on the screen.

 

 

* The purpose here is to make the servos run when you put the toy car on the ldr.

 

  

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 sensor card.

 

 

We click on the "Close" button after the "Download Finished" text appears. After the loading is finished, the pinoo card and sensors are placed in the hard hat.

 

5. Working Status of the Project:

 

 

After the installation is finished, we insert the 9V battery into the pinoo board.

 

When we put the toy car, servo motors work.

 

ARDUINO IDE KODLARI:

#include <Servo.h> // servo kütüphanesini ekledik
// servo nesnelerine isim verdik
Servo servo1;
Servo servo2;

int ldr = A0; // ldr'yi A0 pinine atadık
int ldr_deger; // ldr_deger adında değişken atadk

void setup() {
  // servo motor pinlerini atadık
  servo1.attach(2);
  servo2.attach(3);

}

void loop() {
  ldr_deger = analogRead(ldr); // ldrden deger okuduk

  if (ldr_deger < 150) { // eger ldr deger 150den küçükse 
    // motorlar 0 pozisyonunda
    servo1.write(0);
    servo2.write(0);

    for (int i = 0; i <= 180; i += 1) { // motorlar 0dan 180e döner
      servo1.write(i);
      servo2.write(i);
    } for (int j = 180; j >= 0; j -= 1) { // motorlar 180den 0a döner
      servo1.write(j);
      servo2.write(j);
    }
  } else { // aksi taktirde
    // motorlar 0 pozisyonunda
    servo1.write(0);
    servo2.write(0);
  }

}