Small SG90 micro servo for hobby projects and small robots, with 180-degree rotation and 3-pin connection.
SKU: OT450-C91 Article number: AA020 EAN: 4504087796505 Location: C09.01
Alternative
Servo MG90S Micro Metal Gears 180 Degrees
€ 6,50
View this alternative
How to connect the Servo SG90 Micro 180 degrees to an Arduino UNO or ESP32, with an example sketch you can upload straight away.
This project demonstrates how to control an SG90 micro servo using an Arduino Uno. The sketch sweeps the servo arm smoothly back and forth from 0 to 180 degrees. Open the Serial Monitor at 115200 baud to observe the current servo angle.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : SG90 Micro Servo Sweep Demo
* Board : Arduino UNO (arduino:avr:uno)
* Parts : Servo SG90
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <Servo.h>
const int SERVO_PIN = 9;
Servo myServo;
void setup() {
Serial.begin(115200);
myServo.attach(SERVO_PIN);
Serial.println(F("SG90 Servo Sweep Demo Started"));
}
void loop() {
// Sweep from 0 to 180 degrees
for (int pos = 0; pos <= 180; pos += 1) {
myServo.write(pos);
delay(15);
}
Serial.println(F("Reached 180 degrees"));
delay(500);
// Sweep back from 180 to 0 degrees
for (int pos = 180; pos >= 0; pos -= 1) {
myServo.write(pos);
delay(15);
}
Serial.println(F("Reached 0 degrees"));
delay(500);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project sweeps an SG90 micro servo back and forth across 180 degrees. The servo is powered from the ESP32 VIN pin (5V from USB) and controlled using a PWM signal generated with the ESP32Servo library. Open the Serial Monitor to observe the current angle as it sweeps.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : SG90 Servo Sweep with ESP32
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : Servo SG90
* Libraries : ESP32Servo 3.1.3
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <ESP32Servo.h>
const int SERVO_PIN = 18; // GPIO 18 connected to servo PWM pin
Servo myServo;
void setup() {
Serial.begin(115200);
Serial.println("ESP32 SG90 Servo Sweep Demo");
// Allow allocation of all timers for ESP32Servo
ESP32PWM::allocateTimer(0);
ESP32PWM::allocateTimer(1);
ESP32PWM::allocateTimer(2);
ESP32PWM::allocateTimer(3);
myServo.setPeriodHertz(50); // Standard 50 Hz servo
myServo.attach(SERVO_PIN, 500, 2400); // Standard pulse width limits for SG90
}
void loop() {
// Sweep from 0 to 180 degrees
for (int pos = 0; pos <= 180; pos += 5) {
myServo.write(pos);
Serial.print("Position: ");
Serial.println(pos);
delay(20);
}
delay(500);
// Sweep back from 180 to 0 degrees
for (int pos = 180; pos >= 0; pos -= 5) {
myServo.write(pos);
Serial.print("Position: ");
Serial.println(pos);
delay(20);
}
delay(500);
}
Required libraries: ESP32Servo 3.1.3
Wiring diagram and example code generated by Codey.online — https://www.codey.online
The SG90 Micro Servo is a high-quality, small servo that is perfect for use in hobby projects and small robots. With a compact size of just 23 x 12.2 x 29 mm and a weight of only 9 grams, this servo is ideal for use in small spaces where other servos do not fit.
View the SG90 wiring diagram and example code for Arduino.
The SG90 Micro Servo has a torque of 1.5 kg/cm and can be connected to a voltage of 4.8-6V. It is also equipped with a 3-pin connector, making it easy to connect to your microcontroller or development board.
This servo has a rotation range of 180 degrees and can be positioned accurately at any angle between 0 and 180 degrees. It also has a fast response time of just 0.1 seconds, making it ideal for applications where speed is important.
| Dimensions | approx. 22.2 x 11.8 x 31 mm |
|---|---|
| Connection | 3-pin connector |
| Weight | 9g |
| Operating voltage | 4.8V-6V |
| Suitable for | Arduino |
| Operating temperature | -30 / + 60 degrees Celsius |
| Speed | 0.10 sec / 60 degrees |
| Maximum force | 1.8 kg/cm |
| PWM Frequency | 50hz (20ms) |
| Torque | 1.5-1.7 kg/cm (4.8V-6V) |
| Rotation range | approx. 180 degrees |
| No-load speed | 0.12 sec / 60 degrees (4.8 V) |
Great products
works well
Great 9g servo for a low price.
Works perfectly as expected
Servo SG90 Micro 180 degrees