DC Motor

A brushed DC motor converts electrical energy into continuous rotary motion.

DC 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 DC Motor, drawn as in the circuit editor. Select a label to see that pin in the table below.

Pins

Pins of this part
PinLabelType
M++Power in
M--Power in

Properties

What you can change in the Property Inspector.

Properties of this part
PropertyRange or choicesDefault
Winding Resistance1 to 1000 Ω4 Ω
Rated Voltage (animation only)1.5 to 24 V5 V

A brushed DC motor converts electrical energy into continuous rotary motion. Applying a voltage across its two terminals spins the shaft; reversing the polarity reverses the spin direction. In Open Maker Studio, the DC Motor is a basic electromechanical load, just like a resistor or LED is a basic electrical one.


1. Schematic Symbol

Standard schematic symbol for a DC motor — a circle with "M" inside, two terminals:

M + −

2. Hardware Specifications & Pinout

  • Operating Voltage: 1.5V to 24V, depending on the motor (this component models a small hobby/TT gear motor, 3–6V typical).
  • Pin Configuration:
    • M+ (+): Motor terminal.
    • M- (-): Motor terminal.
  • A bare DC motor has no polarity requirement the way a diode does — swapping M+/M- just reverses spin direction, it doesn't damage the motor.

[!IMPORTANT] A microcontroller GPIO pin cannot directly drive a motor — it can't safely supply the current a motor draws. Real projects always need a driver in between (a single transistor for simple on/off control, or an H-bridge driver chip like an L298N/L9110/DRV8833 for PWM speed + direction control). The Blockly blocks in Section 5 below assume that driver is already there — they generate PWM/digital signals for a driver stage to act on, not motor-rated current itself.


3. How it Works (Winding Resistance Model)

  • This component is modeled as winding resistance only — a fixed resistor between M+ and M-. There is no simulated back-EMF (the voltage a spinning motor generates that opposes its own current) and no mechanical load — so the applied voltage always equals current × resistance, the same as a plain resistor:
    I=VRwindingI = \dfrac{V}{R_{winding}}
  • Because there's no back-EMF opposing it, the simulated current is always what a locked/stalled real motor would draw at that voltage — the component's own description calls this out explicitly: "Stall current = V ÷ Winding Resistance."
  • Speed animation is a visual approximation only: it's calculated as the applied voltage's fraction of the Rated Voltage property, not a real simulated RPM.

4. Component Properties (Property Inspector)

  • Winding Resistance (resistance): The motor's coil resistance — lower values draw more current at the same voltage.
    • Default: 4 Ω (real datasheet value: Adafruit "TT Motor," 1.5A stall at 6V → 6V ÷ 1.5A = 4Ω)
    • Range: 1 Ω to 1000 Ω
  • Rated Voltage — animation only (nominalVoltage): The voltage the spin animation treats as "100% speed." Purely visual — it doesn't affect the SPICE current calculation at all.
    • Default: 5 V
    • Range: 1.5 V to 24 V

5. Supported Blockly Blocks

These blocks are driver-agnostic — they just generate a PWM/digital signal on one pin for an external driver stage to use. Driver-specific blocks (L298N, L9110, DRV8833 H-bridge control) aren't documented yet — see the note at the end of this page.

  • Set Motor Speed (actuator_motor_speed) Controls a single DC motor's speed via PWM (0–100%). Requires a motor driver (transistor or L9110/DRV8833) between the pin and the motor.

    • Parameters: Pin (PWM pin), Speed % (Slider 0–100, default 50).
    • C++ Code: analogWrite(3, map(constrain(50,0,100), 0, 100, 0, 255));
    • Python Code:
      motor_3 = PWM(Pin(3), freq=1000)
      motor_3.duty(int(min(100,max(0,50))/100*1023))   # ESP32/Arduino-core boards
      # Pico MicroPython uses: motor_3.duty_u16(...)
      
  • Stop Motor (actuator_motor_stop) Immediately stops the motor by setting PWM duty to 0.

    • C++ Code: analogWrite(3, 0);
    • Python Code: motor_3.duty(0)
  • Ramp Motor (actuator_motor_ramp) Gradually ramps motor speed from one percentage to another over a set duration — prevents sudden current spikes. 50 discrete PWM steps.

    • Parameters: Pin, From Speed % (default 0), To Speed % (default 100), Duration (ms, default 1000).
    • C++ Code: Step-wise analogWrite() loop over the duration.
    • Python Code: Step-wise duty()/duty_u16() loop over the duration.

6. Simulator Behavior

  • Spin Animation: The motor visually spins clockwise or counter-clockwise depending on current direction, at a speed proportional to applied voltage ÷ Rated Voltage — not a physically simulated RPM.
  • On-Canvas Readout: Shows live speed percentage and stall current in mA (e.g. "75% speed · 375 mA") while powered.
  • Fault Detection: Current exceeding 500mA trips an OVERCURRENT fault ("coil may overheat").
  • Known simplification (disclosed directly in the component's own description, not hidden): no back-EMF and no mechanical load are modeled — a real motor's current drops once it's spinning freely, but this component's current stays at the stalled/locked-rotor value for as long as voltage is applied.

[!NOTE] Motor driver chips (L298N, L9110, DRV8833, IBT-2/BTS7960) don't have dedicated simulated components yet — only this bare motor is simulated. The Blockly extension already has real, working blocks for all of these drivers (they generate correct digital/PWM control signals that this motor responds to electrically), but there's no placeable driver-chip component on the Circuit Canvas to document properly yet. Once those are built, a Chapter 6 "Motor Drivers" topic will cover them.