 Hello everyone! In this video, we are going to learn all about servo motor, how it works, how to interface it with prototyping boards like evive and Arduino and how to program it in pictoblocks. Finally, we'll have a look at what one does we can create using it. Let's begin by understanding what a servo motor is and how it works. A servo motor or simply a servo is a device that is used to rotate or push parts of a machine to which it is connected with precision. Unlike DC motors, they generally rotate to a particular angle and then stops. If you pull apart a servo motor, you'll find a DC motor, a potentiometer, a gear strain that is a series of gears that are interconnected, a control circuit, it controls how much the servo should rotate or move depending upon the input it receives. Now that we know how the servo motor works, let's have a look at how to interface it with evive and see it in action. You can directly connect and control two servo motors at a time with evive as it has two dedicated servo motor channels S1 and S2. Let's connect our servo motor to servo channel one that is S1. Make sure that the brown wire is inserted in the leftmost pin. Attach the servo horn on the servo head. Now that we have connected the servo motor to evive, let's control it using evive's firmware. Switch evive on, then from its menu select controls, next select servos, finally navigate to servo one. You'll observe that the value of the current angle of servo motor is displayed on evive's screen. You can control the angle using the potentiometer knob. Now let's program our servo motor and pick the blocks. It is a graphical programming software based on scratch blocks. You can download it from the link given in the description box below. Before doing anything else, connect evive to your computer using a USB cable. Next open pick the blocks, then click on the board button and select evive from the drop down. Now from the dialog box that appears, choose the appropriate serial port. Before writing the script, make sure that the firmware is uploaded. If not, upload it using the upload firmware button. We will write a script to set the servo angle to the value entered by the user. First, we will ask the user to enter the desired value of the servo angle. After the user enters the value, the servo motor connected to servo channel one should rotate to that angle. Next, we will make Toby speak out the angle value. Script continues the, we'll use the forever block. Now we'll place a when flag clicked head block above the forever block. It will ensure that the script runs when the green flag is clicked. Now we'll check whether the servo motor is running perfectly fine or not by running the script. Thing is perfectly fine. Let's write a script to control the servo motor without having evive connected to the computer. For that, we'll have to work in the upload mode. To make a script to run the servo motor in to and fro motion, that is from zero degrees to 180 and then back to zero. Let's first create two variables to store values of the angle and a factor. Then the initial value of angle is zero and factor is five. Whatever we write next should repeat continuously, hence we'll add the forever block. Next, let's set the servo angle. The angle should change every time by a factor of five. But our servo motor has minimum and maximum values which are zero and 180 respectively. As soon as it reaches the extreme values, the factor will get multiplied by minus one. Next, let's add a weight block for smooth functioning of the servo motor. Place the when evive starts up head block above the entire script to execute the program. Finally, upload the code using the upload button. Now that you know how to work with servo motor, there are a number of projects you can create using it. Like the Angry Bird themed intrusion detection system, smart trash bin, automatic door, oscillating electric table fan and much more. That's it for this video. If you liked it, give it a thumbs up and share it with your friends. For more such educational content, subscribe to STEMpedia and follow us on Facebook, Instagram and Twitter. Bye bye.