Servo Motors (SG90 / MG995)

A Servo Motor is a self-contained closed-loop actuator incorporating a DC motor, reduction gearbox, potentiometer position sensor, and control circuit board.

Actuators8 blocksMicroPythonC++
Servo Motor

At a glance

Pins and properties exactly as the circuit editor and simulator define this part. The text below explains how to use them.

Pinout

Pinout of the Servo Motor, drawn as in the circuit editor. Select a label to see that pin in the table below.

Pins

Pins of this part
PinLabelType
SIGSIGSignal in
VCC5VPower in
GNDGNDGround

Properties

What you can change in the Property Inspector.

Properties of this part
PropertyRange or choicesDefault
Angle0 to 180 °90 °

A Servo Motor is a self-contained closed-loop actuator incorporating a DC motor, reduction gearbox, potentiometer position sensor, and control circuit board. It moves its output shaft to a precise angle based on incoming control pulses.


1. Hardware Specifications & Servo Types

  • Operating Voltage: 4.8V to 6.0V.
  • Control Signal: 50 Hz PWM frame (20 ms20\,\text{ms} total period).
  • Servo Variants:
    • Standard 180° Servo (SG90, MG995, MG996R): Output horn rotates between 0° and 180°. This is what this component and topic cover.
    • Continuous Rotation 360° Servo: A genuinely separate simulated component (servo_continuous, not covered by this topic) — potentiometer feedback is disconnected on the real hardware, and pulse width controls rotation speed/direction instead of a fixed angle.
  • Pin Configuration:
    • GND (Brown / Black): Ground.
    • VCC (Red): 5V Power.
    • SIG (Orange / Yellow): PWM Signal input pin.

2. How it Works (Pulse Width Modulation & 50Hz Timings)

Standard RC servos decode high pulse durations (ThighT_{high}) within a 20ms frame. This component simulates the same pulse-width range the real Arduino Servo.h library defaults to (544–2400µs), not the simplified 1.0–2.0ms figure some tutorials use:

  • Thigh=544 μs→0∘T_{high} = 544\,\mu s \rightarrow 0^\circ angle.
  • Thigh=1472 μs→90∘T_{high} = 1472\,\mu s \rightarrow 90^\circ angle (neutral / center).
  • Thigh=2400 μs→180∘T_{high} = 2400\,\mu s \rightarrow 180^\circ angle.

Angle∘=Thigh−544 μs2400 μs−544 μs×180∘\text{Angle}^\circ = \frac{T_{high} - 544\,\mu s}{2400\,\mu s - 544\,\mu s} \times 180^\circ


3. Component Properties (Property Inspector)

  • Shaft Angle (angle): Position of servo horn in degrees.
    • Default: 90 °
    • Range: 0 ° to 180 °

[!NOTE] There's no "Continuous Mode" property on this component — 360° continuous-rotation servos are a completely separate simulated part (servo_continuous), not a toggle on this one. Its own Blockly blocks (Section 4) live in this same extension, but drive that other component.


4. Supported Blockly Blocks

Drawing the blocks…

5. Simulator Behavior

  • Interactive Horn Rotation: The servo horn rotates smoothly on the canvas to match the written angle, decoded from the real duty-cycle-averaged SIG voltage the SPICE solver computes.
  • On-Canvas Readout: Shows the current angle (e.g. 90°) as a text overlay while powered.
  • Fault Detection: VCC present but below 4.5V raises a LOW VCC fault; current draw above 1.5A trips an OVERCURRENT fault ("check for mechanical stall or short").
Servo Motors (SG90 / MG995) — OMS Parts