Tutorial 3: A Simple Servo Motor Project Tabby Mungai, September 4, 2023September 5, 2023 For this tutorial we are going to look at a simple servo motor project. Before we delve into the project we need to get crucial insights into what is a Servo Motor? A Servo Motor refers to a motor that has the capacity to rotate with exceptional precision. Servo motors consist of the circuits that can provide feedback on the current position of the motor shaft enabling servo motors to rotate with great precision. Motors play an instrumental role in completing powerful tasks as they have the ability to convert electrical energy to mechanical energy. Servo motors and stepper motors have distinct advantages to avail common solutions to ensure motion control projects. Servo motors turn to specified positions where the servo arm has the capacity to turn 180 degrees. Servo motors were initially used in remote control to control cars, flaps on a remote control plane. Over time they have found use in robotics as servo motors tend to be lighter than stepper motor. Therefore, the light weight of the stepper motor provide robotics as well as the robotic arm more flexibility to ensure a balance when moving around. The servo motor consists of in-built motors, feedback circuit, and motor driver. Therefore, the servo requires a power line ground and control pin. Let’s get into the servo project; The project with the servo motor includes the following requirements: Materials Needed (For servo project Arduino) Servo motors Jumper wires Arduino board connected to a computer Connecting a Servo motor to the Arduino The servo motor has a female connector with three pins. The darkest or even black one is usually the ground connecting this to the ground of the Arduino’s GND. Connect the power cable that in all standards should be red to 5V on the Arduino Connect the remaining line on the servo connector to a digital in the Arduino CODE: The following code will turn a servo motor to 0 degrees, wait 1 second they turn it to 90 degrees wait on more second turn it to 180 degrees then go back: The code simply declares the servo object and then initializes the servo by using the Servo.attach()function. We shouldn’t forget to include the servo library in the servo library. In the loop() we set the servo to 0 degrees, wait then set it to 90 degree and later 180 degrees SETUP EXPLANATION The diagram below illustrates a schematic diagram for a servo project using Arduino. Servos work by receiving a position from the Arduino using one input Pin. The servo internally comprises of a motor driver and a feedback circuit to ensure the servo arm reaches the desired position Servo receive a square wave similar to PWM, each cycle in the signal lasts for 20 milliseconds and for mist of the time the value is LOW At the beginning of each cycle, the signal is HIGH for a time between 1 and 2 milliseconds. At 1 milliseconds it represents 0 degrees and at 2 milliseconds it represents 180 degrees. The values in between range from 0 to 180. This is a good and reliable method, the graphics make it a little easier to understand. Remember that using the Servo library automatically disables PWM functionality on PWM pins 9 and 10 on the Arduino UNO and similar board. To use more than one servo declare multiple servo objects Attach different pins to each one servo individually Connection-wise the grounds from the servos go to GND on the Arduino the servo power to 5V or VIN(Depending on the power input). In the end, each signal line has to be connected to a different digital pin. Contrary to popular belief Servo don’t need to be controlled by PWM pins, Any digital pin will work VIDEO: The video include project with servo motor. The video provides crucial insights into the various workings of the servo motors using different circuits including some that have a servo controller. Tutorial
Tutorial Tutorial 1: How To Light An LED August 24, 2023August 24, 2023 This is a beginner friendly tutorial aimed at introducing an individual to circuitry. Read More
Tutorial Tutorial 2: Two Alternating Blinking LEDs August 30, 2023September 5, 2023 LEDs are increasingly becoming the suitable technology of choice. The suitability of LEDs are due to their low energy consumption and longevity. Read More