top of page

Cleaning Robot

Project Purpose: To create a cleaning robot with a pinoobot and a distance sensor using the Pinoo control card.

Duration:  2 lessons

Age group:  7 years and older

Pinoo Set:  PinooBot set and full set.

Achievements:

  • Learn to code Pinoo control board

  • Learns to code the distance sensor.

  • Pinoobot meets the robot.

  • Develops algorithmic skills.

  • Coding skills develop.

 

Materials to be used:  Mblock 3 program, PinooBot Robot / Pinoo control card, distance sensor, connection cable.  

Materials Required for Design:  Dish sponge, chenille, garbage bag, magnet, silicone gun, scissors.

 

   

Project Construction:

            

  

   

We cut a medium-sized rectangular piece from the sponge and attach it to the front of the pinoobot with a chenille.

 

 

 

 

 

 

 

 

 

 

 

We stick three magnets on the bottom of the sponge.  

 

You can decorate the robot as you wish according to its role.    

             

We cut the garbage bags into small rectangular pieces and attach them by putting magnets inside. We made four, you can increase the number if you wish.

We scatter the garbage we have created in the area where we will operate our robot.

 

 

Let's make our connections. Connecting the distance sensor to the purple/green input number 6  (With your motor connections not made, let's make our connection to the white colored inputs that are special for motor connections on the Pinoo control card.)

  

 

We have completed our connections, now let's move on to the coding part. We will use the mblock-3 application for this.  Let's connect our Pinoo control card to the computer with the help of the connection cable and log in to the Mblock3 application. Then let's introduce our Pinoo Control Card to the computer. To do this, we first click on the serial port option from the Connect tab. Then we choose COM6. (The number may differ depending on the computer and the port.)  

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

 

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 write “Pinoo” in the search engine and it is enough to say download to the result. Installed on our computer.

 

We come to the extensions tab again and click on Pinoo. We will write our codes with the Pinoo extension.  

 

In the coding part; We get the code when we click on the Green Flag from the Events menu to start the application.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

We will get help from the dummy to learn the value read by the distance sensor. For this, we get the command to say hello from the view tab. Instead of hello, we get the code block related to the distance sensor in the robots tab. We change the pin input to Pinoo6, which we connect to.

Since we want the reading process to be done continuously, not once, we take all our codes into the repeat block from the control tab.  

Let's click on the green flag and observe the change of values by moving our hand closer to the sensor. Let's take note of the value read by the sensor when we bring our hand close to the robot. Here we will take as reference that it reads a value of around 10.

 

If the value read by the distance sensor is less than 10, that is, if the robot approaches an obstacle, it should turn right for 2 seconds, then move forward.  If there is no obstacle in front of the robot, that is, the value read by the sensor is greater than 10, let the robot perform forward, backward, right and left movements. Now let's turn this into code.

Here we will make use of the if block in the control tab and the small and large comparison operators in the operations tab.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Let's complete the codes that PinooBot will act according to the condition to be met.

For the sensor reading greater than 10, we get the PinooBot Direction:Forward Speed:0 code block from the Robots tab. We update the directions as forward, right, back, left, respectively, and the Speed as 255 in all of them.

Since we want this process to be checked continuously, we place all blocks in the repeat block.

We want him to do each move for a certain amount of time. For this, we take the 1 second wait code block from the control tab under each move and update the number 1 to 2.

 

 

 

 

 

 

 

 

 

 

 

 

 

For the sensor reading less than 10, we get the PinooBot Direction:Forward Speed:0 code block from the Robots tab. We update their direction as right back and the Speed as 255 in all of them. In order for it to make the right turn for 2 seconds, we take the wait 1 second command from the control tab and update the number 1 to 2.  

After completing our codes, we place the robot on the platform and click on the green flag to check the operation of our project. We place the robot in the area we have determined, it will make forward, backward, right and left movements, and while doing these movements, it will collect the garbage bags on the floor with the help of magnets. Even if the robot has approached an obstacle, it will turn right and must move forward.

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 supply independent of the computer.

For this, we used the code to click on the green flag at the beginning and the code where we had the dummy tell the sensor value.  by throwing it in the trash, we get the Pinoo Program code from the Robots menu.

 

Right click on the code and click upload to arduino. (We work with arduino as a board.)

 

We are waiting for the codes to be uploaded to the card. After the installation is complete, we close the window.

 

 

If there is no problem, we unplug our power cable from the computer. We power our Pinoo Control board with the help of 9v battery and battery cap. We also bring the on-off button, which is right next to the battery input, to the on position.

 

ARDUINO IDE CODES:

// assign motor pins

int motora1 = 5;

int motora2 = 6;

int motorb1 = 10;

int motorb2 = 11;

// assign the distance sensor pins

int echoPin = 12;

int trigPin = 13; long distance, sure;

// we assign two variables for distance measurement

void setup()

{

  // motor pins are output pins 

pinMode(to motor1, OUTPUT); 

pinMode(motor2, OUTPUT); 

pinMode(motorb1, OUTPUT); 

pinMode(motorb2, OUTPUT); 

pinMode(echoPin, INPUT);

// echo is the input pin 

pinMode(trigPin, OUTPUT);

// trig is output pin

}

void loop()

{

  // distance sensor activated 

digitalWrite(trigPin, LOW); 

delayMicroseconds(5); 

digitalWrite(trigPin, HIGH); 

delayMicroseconds(10); 

digitalWrite(trigPin, LOW); 

sure = pulseIn(echoPin, HIGH);

  distance = time / 29.1 / 2;

// measured the distance

  if (distance > 10)

{

// if the distance is greater than 10  

Further(); // goes forward  

delay(2000);  

right(); // goes right  

delay(2000);  

left(); // moves left  

delay(2000);  

back(); // goes back  

delay(2000); 

}

else if (distance < 10)

{

// if the distance is less than 10  

right(); // goes right  

delay(2000);   Further(); // goes forward 

}

}

void forward()

{

}

void back()

{

}

void sag()

{

}

void left()

{

}

1.png
1111_large.jfif
10.jpeg
11.jpeg
12.jpeg
13.jpeg
2222_large.jfif
16.jpeg
17.jpeg
seri_port_480x480.jpg
KART_480x480.jpg
pinoo_uzanti_480x480.jpg
pinooo_480x480 (2).jpg
23.PNG
24.JPG
25.JPG
26.JPG
27.JPG
28.JPG
30.JPG
29.JPG
31.JPG
32.JPG
33.jpeg
bottom of page