Motor Drivers
de:volt models four driver chips that let a low-current logic output switch a high-current load: the ULN2003A and ULN2803A Darlington sink arrays, and the L293D and TB6612FNG dual H-bridges. The sink arrays are one-directional low-side switches; the H-bridges drive a load in both directions. All four carry internal clamp diodes so inductive loads (motors, relays, solenoids) need no external flyback diode in the simulator.
Sink array vs. H-bridge
| Family | Topology | Direction | Use it for |
|---|---|---|---|
| ULN2003A / ULN2803A | Open-collector Darlington (low-side sink) | One way (on/off) | Relays, solenoids, unipolar steppers, LED banks |
| L293D / TB6612FNG | Full H-bridge | Forward / reverse | Bidirectional DC motors, bipolar steppers |
A sink array can only pull its output toward GND — current must flow from a supply, through the load, into OUT. An H-bridge can push current either way through the load, so it can spin a DC motor in both directions.
ULN2003A / ULN2803A — Darlington sink arrays
The ULN2003A is a 7-channel array (DIP-16); the ULN2803A is the same part with 8 channels (DIP-18). Each channel takes a logic input and sinks up to 500 mA through an open-collector NPN Darlington pair, rated to 50 V off-state.
Pinout (ULN2003A)
| Pin | Label | Description |
|---|---|---|
| in1–in7 | IN1–IN7 | Logic inputs (TTL/CMOS, Vih ≥ 2.5 V, Vil ≤ 1.5 V) |
| out1–out7 | OUT1–OUT7 | Open-collector outputs (sink only) |
| gnd | GND | Circuit ground |
| com | COM | Common diode cathode — tie to the load supply rail |
The ULN2803A adds in8/out8 for an eighth channel; everything else is identical per channel. Inputs sit on the left, outputs on the right in reversed order (OUT7→OUT1), with GND and COM at the bottom corners.
How it switches
There is no VCC pin. The chip is purely a bank of switches referenced to GND. A HIGH input turns its Darlington on, pulling the matching OUT pin down toward GND and sinking current from the load. A LOW input leaves OUT open (high impedance), so the load sees no path to ground and is off.
Because the output is open-collector, the load supplies the high state: wire one side of the load to your supply rail and the other side to OUT.
| IN | OUT | Load |
|---|---|---|
| HIGH | Pulled to ~GND | ON (current sinks through the channel) |
| LOW | Open / high-Z | OFF |
In the engine the on-state Vce(sat) is modelled as R_on = 5 Ω (about a 1 V drop at 200 mA), so expect a small voltage left across the channel when it conducts.
Flyback handling
Each output has an internal catch diode whose cathode goes to the COM pin. Tie COM to the load’s positive supply rail and those diodes clamp the inductive kickback when a relay or motor coil switches off — no external flyback diode required. Leave COM unconnected and inductive spikes are unsuppressed. In de:volt v1 the clamp diodes are flagged diagnostically rather than stamped as engine elements, so a missing COM connection surfaces as a static-check finding.
L293D / TB6612FNG — dual H-bridges
Both chips contain two H-bridge channels and run two separate supply rails: a logic VCC for the control side and a motor VM rail for the output stage. Keeping the rails separate means a noisy motor supply does not disturb the logic.
| Spec | L293D | TB6612FNG |
|---|---|---|
| Logic supply | VCC1 4.5–7 V | VCC 2.7–5.5 V (3.3 V nominal) |
| Motor supply | VCC2 / VM up to 36 V | VM 2.5–13.5 V |
| Current per channel | 0.6 A continuous / 1.2 A peak | 1.2 A continuous / 3.2 A peak |
| Enable | EN12, EN34 (per pair) | STBY (shared) + PWMA / PWMB |
L293D pinout
| Pin | Label | Description |
|---|---|---|
| en12 / en34 | EN12 / EN34 | Enable for channel pair 1+2 / 3+4 |
| in1–in4 | IN1–IN4 | Direction inputs |
| out1–out4 | OUT1–OUT4 | Half-bridge outputs (two per motor) |
| vcc1 | VCC1 | Logic supply (4.5–7 V) |
| vcc2 | VCC2 | Motor supply (up to 36 V) |
| gnd | GND | All four GND pins tie to circuit ground |
The L293D is a quadruple half-H driver: a DC motor uses one pair (OUT1/OUT2) with IN1/IN2 setting direction and EN12 gating it. The output stage is modelled at R_on = 2 Ω per side (~1.4 V total drop at 1 A).
TB6612FNG pinout
| Pin | Label | Description |
|---|---|---|
| ain1 / ain2 | AIN1 / AIN2 | Channel A direction inputs |
| pwma | PWMA | Channel A enable / speed |
| ao1 / ao2 | AO1 / AO2 | Channel A motor outputs |
| bin1 / bin2 | BIN1 / BIN2 | Channel B direction inputs |
| pwmb | PWMB | Channel B enable / speed |
| bo1 / bo2 | BO1 / BO2 | Channel B motor outputs |
| stby | STBY | Standby — pull HIGH to enable both channels |
| vcc | VCC | Logic supply (2.7–5.5 V) |
| vm | VM | Motor supply (2.5–13.5 V) |
| gnd | GND | All GND pins tie to circuit ground |
STBY must be HIGH or both channels stay in high-Z standby regardless of the other inputs.
Truth tables
L293D, one motor on EN12 / IN1 / IN2:
| EN12 | IN1 | IN2 | Motor |
|---|---|---|---|
| HIGH | HIGH | LOW | Forward |
| HIGH | LOW | HIGH | Reverse |
| HIGH | LOW | LOW | Coast (both low) |
| LOW | × | × | Coast (disabled) |
TB6612FNG, channel A (STBY = HIGH):
| PWMA | AIN1 | AIN2 | Motor |
|---|---|---|---|
| HIGH | HIGH | LOW | Forward |
| HIGH | LOW | HIGH | Reverse |
| HIGH | HIGH | HIGH | Brake (short) |
| HIGH | LOW | LOW | Coast |
| LOW | × | × | Coast |
Note: in this model PWM is treated as a binary enable (HIGH = active, LOW = coast). Duty-cycle speed averaging is a later motor-dynamics feature, so a 50% duty input does not yet halve the speed.
Flyback handling
Both H-bridges carry internal recirculating clamp / freewheeling diodes on every output. When VM is wired, those diodes route inductive kickback from the motor windings back into the motor rail — no external flyback diode across the motor terminals. The diodes only conduct once VM is supplied, so always wire the motor rail before expecting clamping.
Example circuit
ULN2003A driving a relay coil (one channel):
Arduino D2 ─── IN1 OUT1 ─── relay coil ─── +12V
│
GND ─── GND COM ───────┘ (clamp diode to +12V)L293D driving one DC motor bidirectionally:
Arduino D9 ─── EN12 VCC1 ─── 5V (logic)
Arduino D7 ─── IN1 VCC2 ─── +9V (motor)
Arduino D8 ─── IN2
OUT1 ─── motor ─── OUT2
GND, GND, GND, GND ─── GNDDrive EN12 with a PWM pin for speed and toggle IN1/IN2 for direction. The TB6612FNG wires the same way per channel: STBY HIGH, AIN1/AIN2 for direction, PWMA for enable, AO1/AO2 to the motor.