To connect a DC motor to an Arduino Uno R3, you cannot wire it directly to the microcontroller's GPIO pins. The ATmega328P chip has a strict 20mA safe continuous current limit per pin (40mA absolute max), while even a small 12V DC gearmotor typically draws 300mA to 2A under load. Attempting a direct connection will instantly trigger the Arduino's internal thermal shutdown or permanently destroy the silicon. The solution is to use an intermediary motor driver like the L298N dual H-bridge module (typically $4 to $6 USD). The Arduino's 5V logic pins command the driver's inputs, while a separate, higher-current external power supply feeds the driver's power terminals to spin the motor.

Decoding the Wiring Diagram Symbols

Before tracing the physical wires, you must understand the standard schematic symbols used in motor control diagrams. Misinterpreting these symbols is a primary cause of wiring faults on the bench.

  • VCC / GND (Power Rails): Represented by parallel horizontal lines of decreasing length (VCC) and a standard earth/chassis ground symbol (three descending horizontal lines or a downward arrow). In motor diagrams, these denote the high-current external supply, not the Arduino's 5V rail.
  • The H-Bridge Block: Drawn as a large rectangle containing four internal switch symbols arranged in an 'H' pattern. This represents the L298N's internal Bipolar Junction Transistors (BJTs) that route current in either direction across the motor terminals.
  • Flyback Diodes: Depicted as triangles with a perpendicular line at the cathode, placed in reverse-parallel across the motor terminals. On the L298N module, these are surface-mount components already integrated into the PCB to clamp inductive voltage spikes (back-EMF) when the motor stops.
  • PWM Wave Symbol: A square wave graphic next to an Enable (ENA/ENB) pin indicates that this specific input requires a Pulse Width Modulation signal from the Arduino to control motor speed, rather than a simple HIGH/LOW logic state.

Node-by-Node Wiring Trace & Terminal Mapping

Below is the exact textual trace from the power source through the driver to the load, followed by the logic control path. Use 18 AWG stranded wire for the high-current paths and 22 AWG solid core for the Arduino logic connections.

Trace 1: High-Power Path (Source to Load)

  1. Node 1 (Source Positive): 12V sealed lead-acid (SLA) battery positive terminal.
  2. Node 2 (Driver VCC): Connects to the L298N '12V' screw terminal. (Note: If your supply exceeds 12V, remove the 5V-EN jumper on the L298N to protect the onboard 7805 voltage regulator).
  3. Node 3 (Driver Output): Current flows through the H-bridge and exits via the 'OUT1' and 'OUT2' screw terminals.
  4. Node 4 (Load): OUT1 connects to Motor Terminal A; OUT2 connects to Motor Terminal B. Polarity here dictates rotation direction and is swapped via software, so physical orientation does not matter initially.

Trace 2: Logic Control Path (Arduino to Driver)

  1. Node 5 (Logic Direction): Arduino Digital Pin 8 connects to L298N 'IN1' header pin. Arduino Digital Pin 9 connects to 'IN2'.
  2. Node 6 (Logic Speed): Arduino Digital Pin 10 (a hardware PWM-capable pin) connects to L298N 'ENA' header pin. Ensure the physical jumper cap on ENA is removed before connecting this wire.
CRITICAL: The Common Ground Path
You must bond the grounds. Run a wire from the 12V Battery Negative to the L298N 'GND' screw terminal. Then, run a second wire from the L298N 'GND' terminal to any Arduino Uno GND pin. Without this common ground reference, the Arduino's 5V logic signals will float relative to the L298N's internal comparators, resulting in erratic motor stuttering or complete failure to trigger the H-bridge.

Terminal & Pin Mapping Table

L298N Physical TerminalArduino Uno R3 PinWire Color (Suggested)Function & Electrical Spec
12V (Screw Terminal)N/A (External 12V Supply)Red (18 AWG)Motor Power In (Max 35V absolute, 12V nominal)
GND (Screw Terminal)GNDBlack (18 AWG)High-Current Return & Common Logic Ground
OUT1 (Screw Terminal)N/A (Motor Wire)Yellow (18 AWG)H-Bridge Channel A Output 1
OUT2 (Screw Terminal)N/A (Motor Wire)Green (18 AWG)H-Bridge Channel A Output 2
IN1 (Male Header)Digital Pin 8Orange (22 AWG)Direction Logic A (HIGH/LOW, 5V TTL)
IN2 (Male Header)Digital Pin 9Blue (22 AWG)Direction Logic B (HIGH/LOW, 5V TTL)
ENA (Male Header)Digital Pin 10 (PWM)Purple (22 AWG)Channel A Enable / Speed Control (0-5V PWM)

For deeper electrical characteristics, always refer to the STMicroelectronics L298N Datasheet, which details the internal BJT saturation voltages and logic threshold timings.

Verifying Your Connections with a Multimeter

Do not apply power to the motor until you have verified the physical layer. Set your multimeter to the correct dials and follow this sequence to prevent short circuits.

  1. Verify Common Ground (Continuity Mode): Set the meter to the continuity/diode setting (the symbol that looks like a sound wave). Place the red probe on the Arduino Uno GND pin and the black probe on the L298N GND screw terminal. The meter must beep and read less than 1.0 ohm. If it reads OL (Open Loop), your ground bond is broken.
  2. Verify Source Voltage (DC Voltage Mode): Set the meter to DC Voltage (20V range). With the external battery connected but the Arduino disconnected, probe the L298N '12V' screw terminal (red) and 'GND' (black). A healthy 12V SLA battery should read between 12.6V (fully charged) and 11.8V (nominal). If it reads below 11.5V, the battery is depleted and the L298N's internal logic may fail to switch reliably.
  3. Verify Logic Thresholds (DC Voltage Mode): Power the Arduino via USB. Upload a blank sketch that sets Pin 8 to HIGH. Probe the L298N 'IN1' header pin. The meter should read between 4.8V and 5.1V. The L298N requires a minimum of 2.3V to register a logic HIGH; anything below 2.0V will leave the H-bridge in an undefined state.
  4. Verify PWM Signal (Frequency/Duty Cycle Mode): If your meter has a frequency or duty cycle mode, probe the 'ENA' pin while running an Arduino analogWrite() fade sketch. You should see a 490 Hz frequency with a varying duty cycle. If your meter lacks this, use an oscilloscope or a cheap logic analyzer to confirm the PWM square wave is reaching the driver.

Frequently Asked Questions

Can I connect a motor directly to Arduino without a driver?

No. Beyond the current limit issue, DC motors are highly inductive loads. When you cut power to a spinning motor, the collapsing magnetic field generates a massive reverse voltage spike (back-EMF) that can exceed 50V. If wired directly to an Arduino GPIO, this spike will punch through the ATmega328P's internal protection diodes, instantly bricking the microcontroller. A driver like the L298N includes flyback diodes to safely route this spike back to the power supply rails.

Why is my L298N motor driver getting extremely hot?

The L298N uses older Bipolar Junction Transistor (BJT) technology, which suffers from a high voltage drop across the H-bridge—typically 1.8V to 2.5V depending on the current draw. If your motor pulls 2A, the L298N is dissipating roughly 4 to 5 Watts of pure heat (P = V_drop × I). The standard blue aluminum heatsink included on most modules is insufficient for continuous 2A loads. If your application requires sustained high current, upgrade to a modern MOSFET-based driver like the TI DRV8833 or Pololu TB6612FNG, which have voltage drops in the millivolt range and run cool to the touch.

How do I control motor speed and direction with this setup?

Direction is controlled by the logic states of IN1 and IN2. To spin forward, set IN1 HIGH and IN2 LOW. To spin in reverse, set IN1 LOW and IN2 HIGH. To brake, set both HIGH (shorts the motor terminals together via the H-bridge). Speed is controlled by applying a Pulse Width Modulation (PWM) signal to the ENA pin using the analogWrite(ENA_pin, value) function, where the value ranges from 0 (stopped) to 255 (full speed). Note that because of the L298N's 2V internal drop, a PWM value of 50 will not yield exactly half the RPM; you must tune the PWM values empirically based on your specific supply voltage and motor load.