Table of Contents

Basic servo movement

Example Description
Learn about servo motors and interface it with Arduino , servo control with ardunio

Introduction

Understanding Servo Motors and it’s working

Servo motors are part of a closed-loop system and are comprised of several parts namely a control circuit, servo motor, shaft, potentiometer, drive gears, amplifier and either an encoder or resolver. A servo motor is a self-contained electrical device, that rotate parts of a machine with high efficiency and with great precision. The output shaft of this motor can be moved to a particular angle, position and velocity that a regular motor does not have.

circuit

 

Code

  • From event palette drag when flag clicked block
  • From arduino palette drag set servo on() to ()
  •  Add forever block and insert if else block in forever block.
  • Read the status of IR senor on pin 7 of ardino using read status of digital pin()
  • If the sensor value is HIGH  then servo must rotate 180 for 3  seconds otherwise it will remain at 90 degree

Script:

Output