Introduction: Tea Dripping Machine With Pinoo

About: In your Pinoo coding, robotics, maker training.

Purpose of the Project: To create a tea brewing machine with a servo motor module and distance sensor using the Pinoo control card.

Duration: 2 lessons

Age Group: 9 years and older

Benefits:

• Learns to code Pinoo control card

• Learns to code the distance sensor.

• Learns to code the Servo Motor module.

• Improves the skill of setting up algorithms.

• Improves coding skill.

Supplies

Materials to be Used: Mblock 3 program, Pinoo control card, distance sensor, servo motor module, connection cable.

Materials Required for Design: 2 tongue sticks, colored cardboard, ruler, pencil, knife, silicone gun, glass, tea bag, scissors

Step 1: Project Preparation

  • Draw a 24cm long and 16cm wide rectangle on the cardboard. Then we draw another rectangle with a length of 22cm and a width of 14cm inside the rectangle we have drawn and then cut it with the help of a curved knife.
  • We draw a 22cm long and 14cm wide rectangle on a cardboard of another color. Then we draw another rectangle with a length of 20cm and a width of 12cm inside the rectangle we have drawn and then cut it with the help of a curved knife.
  • We glue the small rectangle into the larger rectangle with the aid of a silicone gun.
  • We glue 24cm long and 16cm wide cardboards to the right and left ends of the shape we created with the help of a silicone gun.
  • We mount the 16cm square cardboard below and above our design with the help of a silicon gun.
  • We form a 24 cm long and 16 cm wide rectangle from the cardboard. We determine the location of the distance sensor so that we can see the glass when we put the glass. Then, wherever you will put the distance sensor, we draw the eyes of the distance sensor with the help of a pencil.
  • NOTE: Servo motor will lower and lift the tea bag. Let's not draw the distance sensor too high so that the tea bag does not come in front of the distance sensor.
  • We cut the circles that we drew with the help of a cutter.
  • Then we mount the cardboard on the back of our design with the help of a silicone gun. So we create a box.
  • We pass the distance sensor through the circles.
  • Servo motor will lower and lift the tea bag. We adjust the location of the servo motor so that it does not coincide with the distance sensor. (Photo: 14) After setting it, we drill a hole with the help of a knife to pass the servo motor cables. NOTE: Ice cream stick will be placed at the end of the servo motor. Therefore, when determining the location of the servo motor, it must be adjusted so that it does not hit the box and enter the water. For this, be sure to look at the positions of the servo motor at 0 and 90 degrees by coding first.
  • We install the white propeller of the servo motor, which is one end. Then we stick the ice cream stick on the propeller with the help of a silicone gun.
  • NOTE: Let's adjust the length of the ice cream stick so that it does not hit the box.
  • With the help of a silicone gun, we attach the tea bag from the rope to the tip of the ice cream stick.
  • We connect the servo motor with the servo motor module in a way that corresponds to Brown cable-GND, Red cable-5V, Orange cable-D0.
  • We assemble the servo motor to the box with the help of a silicon gun.
  • We write PINOO on one ice cream stick. We write Tea Brewing Machine on the other ice cream stick and mount it on the top of the box with the help of a silicone gun.
  • We make our connections. We connect the distance sensor to the purple / green input number 5 with a jumper wire. We connect the servo motor to the purple input number 3 with the help of a connection cable.
  • We have completed our connections, now we go to the coding part. We will use mblock-3 application for this.

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

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

Step 4: Coding Part

  • 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.
  • Let's click on the green flag and observe the change of values by moving the glass closer to the sensor and away. Let's take note of the value read by the sensor when we move the glass closer to the sensor. Here, we will reference that you read a value of around 10.
  • When the Space key is pressed from the Events menu, we get two codes. 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 code block about the servo motor from the Robots tab. We change the pin input to Pinoo3 that we connect. The servo motor will go up at 0 degrees, so when the up arrow key is pressed, we make the angle 0 degrees under the command. When the down arrow key is pressed, we make the angle 90 degrees under the command. By pressing the keys, we check whether the servo motor works correctly. If the value read by the distance sensor is less than 10, that is, if the glass is close to the distance sensor, the tea bag should enter the cup (servo motor is 90 degrees) If there is no cup in front of the distance sensor, that is, if the value read by the sensor is greater than 10, then the tea bag is above (servo motor Let it be 0 degrees) stop. Now let's put this into code that we wrote.
  • Here, we will make use of small comparison operators from the control tab, ‘’if not if not’’ block, and ‘’operations’’ tab. Then we click the green flag and move the glass closer to the distance sensor to check whether the project is running.
  • Now let's improve our coding to make our project work more precisely. When we bring the cup closer to the tea brewing machine, let's make the servo motor slowly go down. For this, we need to define a variable.
  • We click on the Data & Block tab and say ‘’create a variable’’.
  • We define a variable name. Let's be careful not to use Turkish characters when defining. Then we click the OK button.
  • When we click on the green flag button, we want the tea bag to be always up and down when we approach it to the glass. For this, we come to the data & block tab and take the code to get the angle 0 and place it under the green flag command.
  • Now, when we bring the cup closer to the front of the distance sensor, we will make the servo motor gradually enter the cup. For this, we take the repeat code until it is from the control tab and if it is less than 10, we place it under the command.
  • The servo motor will gradually decrease until its degree is 90, so we take the equals process from the transactions and we take the angle from the data & block and equal the angle to 90.
  • Now we will increase the angle one by one until the angle is 90. For this, we take "increase angle 1" from "data & block" and put it into "repeat until it is done".
  • Then we insert the angle in the angle portion of the servo motor code to indicate that the angle is the angle of the servo motor. We put the servo motor code under the "increase angle 1" code.
  • Now we want the tea bag to be shaken while it is in the glass. For this, we take the repeat command 10 times from the ‘’control’’ tab and place it under the ‘’repeat’’ command until it happens.
  • We get the "servo motor" code from the robots and make the angle 45. We get "wait 1 second" from the control tab so that it can shake fast, and change 1 to 0.1. Then we take the "90 degree servo motor" code that we put in the beginning and put it into the "wait for 0.1 second" code. And again we say "wait 0.1 second". Then we put these codes in the "repeat 10 times" command.
  • After the tea is brewed, that is, after shaking it 10 times, we want the tea bag to rise. For this, we take the ‘’wait 1 second’’ command from the control tab and change it to 5. Then we take the servo motor code and make its angle 0 degrees.
  • Now, when the distance sensor sees the glass, we want it to wait for a while and then increase the angle. We place the ‘’2-second wait’’ code on the ‘’repeat code’’ until it's done.
  • 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.

Step 5: Working Status of the Project

  • Since there is no cup in front of the distance sensor, the tea bag is in the upper position.
  • Since there is a cup in front of the distance sensor, the tea bag is in the down position.