 Hello everyone! Welcome back. In the previous video, we learned how to interface an IS sensor to Arduino Uno using Picto Blocks and wrote a script to control Uno Spin 13 LED using the sensor. Today, we are going to see how we can interface an actuator to Uno using Picto Blocks. First, let's have a look at what actuators are. An actuator is a device that produces motion. It helps other devices move and interact with their surrounding environment. The actuator takes in energy and uses it to help the device move. Servo motors and DC motors are type of electric actuators. In this video, we are going to write a script to interface a servo to Uno and control it using IS sensor. Let's begin. First, open Picto Blocks. Then connect Uno to your computer via a USB cable. Next, click on the board button in the toolbar and select its name from the drop-down menu. Then click on the connect button and select the appropriate port. Now, let's connect the servo to Uno. Connect the servo's brown wire to Uno's ground pin using a black male to male jumper cable. Next, connect the red wire to Uno's VN pin using a red male to male jumper cable. Then, connect the orange wire to Uno's PWM pin fi using a yellow male to male jumper cable. Now, let's connect the IR sensor to Uno. Connect the sensor's VCC pin to Uno's 5V pin using a red male to female jumper cable. Next, connect the sensor's ground pin to Uno's ground pin using a black male to female jumper cable. Then, connect the sensor's out pin to Uno's digital pin 2 using a green male to female jumper cable. And we are done. Time to write the script. The logic behind the script is that the servo should turn 45 degrees if the IR sensor detects an object. Otherwise, it should remain at 0 degrees. For this, we'll use the if-else block. Go to the control palette and drag and drop it in the scripting area. We are going to use the read digital sensor block to check whether the IR sensor detects an object. Drag and drop it inside the hexagonal space of the if-else block and select IR from the drop-down menu. To control the servo, we are going to use the set servo block from the actuator's palette. Drag and drop the set servo block below the if arm of the if-else block. Change the pin to 5 and set the angle to 0 degrees. Duplicate this block to turn the servo. Drag and drop it below the else arm and set the angle to 45 degrees. The weight block below this block to make the servo stable. Now, to run the script forever, drag and drop the forever block from the control palette. As you know by now, we need a head block to run any script. So, drag and drop the head block from the Arduino palette and our script is complete. Let's upload it to Uno. Switch to upload mode by toggling this button. Click on the upload code button to upload the code. And there you go. Before we call it today, here's a small task for you. Try controlling a DC motor instead of a servo motor. That's all for now. In the next video, we'll find out how we can control a servo using a smartphone. If you have any question regarding this video, let us know in the comment section below. And if you like this video, don't forget to give it a thumbs up. I'll see you in the next video. Bye-bye.