AZ-Delivery MG90S Manual

AZ-Delivery MG90S Manual

Micro servomotor

Advertisement

Welcome!
Thank you for purchasing our AZ-Delivery MG90S Micro Servomotor. On the
following pages, you will be introduced to how to use and set-up this handy
device.
Have fun!

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MG90S and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for AZ-Delivery MG90S

  • Page 1 Welcome! Thank you for purchasing our AZ-Delivery MG90S Micro Servomotor. On the following pages, you will be introduced to how to use and set-up this handy device. Have fun!
  • Page 2 Areas of application These servos are used in model building projects to provide precise control movements. They are suitable for applications where precise motion controls are required. Required knowledge and skills Installation and commissioning should be carried out by people with basic knowledge of model making or manual skills. Knowledge of handling control electronics and mechanical components is required.
  • Page 4: Table Of Contents

    Table of Contents Introduction....................3 Specifications....................4 The pinout.....................5 How to set-up Arduino IDE................6 How to set-up the Raspberry Pi and Python..........10 Connecting the servo motor with Atmega328p..........11 Sketch example..................12 Connecting the module with Raspberry Pi..........14 Libraries and tools for Python..............15 Python script....................16 - 2 -...
  • Page 5: Introduction

    Introduction The MG90S is a small and light micro servo-motor that has aluminum metal gears, a coreless motor, a double ball bearing and a high power output. Servo motors can be commanded to go to a specific position and so are the...
  • Page 6: Specifications

    Specifications Operating voltage 4.8V-6V Operating current (Idle) 10mA (typical) Operating current (movement) 100-250mA Operating current (stall) 700mA Operating speed 0.1s/60° (4.8V), 0.08s/60° (6V) Stall torque 1.8kgf·cm (4.8V), 2.2 kgf·cm (6V) Dead band width 5µs Maximum angle of rotation 90° Weight 13.4g Cable length 175 mm...
  • Page 7: The Pinout

    The pinout The MG90S Micro Servomotor has three pins. The pinout is shown on the following image: - 5 -...
  • Page 8: How To Set-Up Arduino Ide

    How to set-up Arduino IDE If the Arduino IDE is not installed, follow the link and download the installation file for the operating system of choice. The Arduino IDE version used for this eBook is 1.8.13. For Windows users, double click on the downloaded .exe file and follow the instructions in the installation window.
  • Page 9 For Linux users, download a file with the extension .tar.xz, which has to be extracted. When it is extracted, go to the extracted directory and open the terminal in that directory. Two .sh scripts have to be executed, the first called arduino-linux-setup.sh and the second called install.sh.
  • Page 10 Almost all operating systems come with a text editor preinstalled (for example, Windows comes with Notepad, Linux Ubuntu comes with Gedit, Linux Raspbian comes with Leafpad, etc.). All of these text editors are perfectly fine for the purpose of the eBook. Next thing is to check if your PC can detect an Atmega328p board.
  • Page 11 If the Arduino IDE is used on Windows, port names are as follows: For Linux users, for example port name is /dev/ttyUSBx, where x represents integer number between 0 and 9. - 9 -...
  • Page 12: How To Set-Up The Raspberry Pi And Python

    How to set-up the Raspberry Pi and Python For the Raspberry Pi, first the operating system has to be installed, then everything has to be set-up so that it can be used in the Headless mode. The Headless mode enables remote connection to the Raspberry Pi, without the need for a PC screen Monitor, mouse or keyboard.
  • Page 13: Connecting The Servo Motor With Atmega328P

    Connecting the servo motor with Atmega328p Connect the servo motor with the Atmega328p as shown on the following image: Motor pin Mc pin Wire color Black wire Red wire Orange wire Potentiometer pin Mc pin Red wire P2 (Center pin) Blue wire Black wire - 11 -...
  • Page 14 Use a potentiometer on pin A0 to command a servo attached to pin 3 to move to a specific position. The Servo MIN_VALUE and MAX_VALUE in the sketch can be adjusted to avoid hitting the servo stops. - 12 -...
  • Page 15: Sketch Example

    Sketch example #include "Servo.h" #define SERVO_PIN 3 #define POT_PIN A0 #define MIN_VALUE 0 // Minimum Servo position #define MAX_VALUE 180 // Maximum Servo position Servo servo; value_pot = 0; value_servo = 0; value_servo_old = 0; void setup() servo.attach(SERVO_PIN); Serial.begin (9600); void loop() value_pot = analogRead(POT_PIN);...
  • Page 16 Upload the sketch to the Atmega328p and run the Serial Monitor (Tools > Serial Monitor). The result should look like as on the following image: - 14 -...
  • Page 17: Connecting The Module With Raspberry Pi

    Connecting the module with Raspberry Pi Connect the module with the Raspberry Pi as shown on the following image: Module pin Raspberry Pi pin Physical pin Wire color Red wire GPIO2 Orange wire Black wire - 15 -...
  • Page 18: Libraries And Tools For Python

    Libraries and tools for Python To use the module with the Raspberry Pi, the library RPi.GPIO has to be installed. If the library is already installed, running the installation command only updates the library to a newer version. To install the library, open the terminal and run the following commands, one by one: sudo apt-get update &&...
  • Page 19: Python Script

    GPIO.setmode(GPIO.BCM) GPIO.setup(servo_pin,GPIO.OUT) GPIO.PWM(servo_pin,50) # 50 Hz (20 ms PWM period) pwm.start(7) # start PWM by rotating to 90 degrees print('MG90S Micro Servo-motor script') print('[Press Ctrl + C to end the script!]\n') try: while True: pwm.ChangeDutyCycle(2.0) print('Rotating to 0 degrees') time.sleep(2)
  • Page 20 Save the script by the name mg90s.py. To run the script open the terminal in the directory where the script is saved and run the following command: python3 mg90s.py The result should look like as on the following image: To stop the script press ‘CTRL + C’ on the keyboard.
  • Page 21 Internet. If you are looking for the high quality microelectronics and accessories, AZ-Delivery Vertriebs GmbH is the right company to get them from. You will be provided with numerous application examples, full installation guides, eBooks, libraries and assistance from our technical experts.

Table of Contents

Save PDF