> Source: https://www.tinkered.ai/components/tb6612fng-motor-driver/raspberry-pi-pico (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/tb6612fng-motor-driver/raspberry-pi-pico. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# TB6612FNG Motor Driver with a Raspberry Pi Pico

On the Raspberry Pi Pico the TB6612FNG's VCC comes from 3V3, which puts its input threshold near 2.3 V, under the 2.62 V the RP2040 guarantees for a high; the motors take their power on VM from a separate supply. All seven control lines sit side by side on GP0 to GP6, with PWMA on GP2 and PWMB on GP5 for analogWrite().

## Wiring

| TB6612FNG Motor Driver | Raspberry Pi Pico | Note |
| --- | --- | --- |
| AIN1 | GP0 |  |
| AIN2 | GP1 |  |
| PWMA | GP2 |  |
| BIN1 | GP3 |  |
| BIN2 | GP4 |  |
| PWMB | GP5 |  |
| STBY | GP6 |  |
| VCC | 3V3 |  |
| GND_LOGIC | GND |  |
| GND_VM | GND |  |
| VM | a separate 4.5 to 13.5 V motor supply, its − to GND |  |
| A1, A2 | motor A |  |
| B1, B2 | motor B |  |

## What to know on the Raspberry Pi Pico

- Toshiba's input high level is 0.7 x VCC. With VCC on VBUS that would be about 3.5 V, more than the RP2040's guaranteed 2.62 V high at 3.3 V IOVDD; with VCC on 3V3 it drops to about 2.3 V and the Pico drives every input reliably. (Toshiba TB6612FNG datasheet, p. 5; RP2040 datasheet, section 5.5.3.4, Table 625)
- arduino-pico starts analogWrite() at 1 kHz with a range of 255, so PWMA at 200 and PWMB at 150 are about 78 % and 59 % duty. GP2 is PWM slice 1 channel A and GP5 is slice 2 channel B; analogWriteFreq(20000) before the first analogWrite() moves the PWM to 20 kHz, well within the 100 kHz the driver takes. (arduino-pico cores/rp2040/wiring_analog.cpp; RP2040 datasheet, section 2.19.2, Table 279; Toshiba TB6612FNG datasheet, p. 3)
- RP2040 pads leave reset with their pulldowns on, and the TB6612FNG has its own 200 kOhm pulldown on STBY, so GP6 keeps both bridges in standby through power on until setup() raises it. (RP2040 datasheet, section 2.19.6.3, Table 341; Toshiba TB6612FNG datasheet, p. 2)
- AIN1 and AIN2 occupy GP0 and GP1, the pins arduino-pico assigns to Serial1 unless told otherwise. The sketch opens no serial port at all, so nothing clashes; to add a UART, call Serial1.setTX() and Serial1.setRX() with other pins first. (arduino-pico variants/rpipico/pins_arduino.h)

## Code

```cpp
// TB6612FNG Motor Driver on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/tb6612fng-motor-driver/raspberry-pi-pico
// TB6612FNG dual H-bridge. Wiring above.
#define AIN1 0
#define AIN2 1
#define PWMA 2
#define BIN1 3
#define BIN2 4
#define PWMB 5
#define STBY 6

void setup() {
  pinMode(AIN1, OUTPUT); pinMode(AIN2, OUTPUT); pinMode(PWMA, OUTPUT);
  pinMode(BIN1, OUTPUT); pinMode(BIN2, OUTPUT); pinMode(PWMB, OUTPUT);
  pinMode(STBY, OUTPUT);
  digitalWrite(STBY, HIGH);            // enable both channels
}

void loop() {
  // Motor A forward, motor B reverse.
  digitalWrite(AIN1, HIGH); digitalWrite(AIN2, LOW);  analogWrite(PWMA, 200);
  digitalWrite(BIN1, LOW);  digitalWrite(BIN2, HIGH); analogWrite(PWMB, 150);
  delay(1500);

  // Reverse motor A (swap the direction inputs).
  digitalWrite(AIN1, LOW);  digitalWrite(AIN2, HIGH);
  delay(1500);

  // Standby → both motors stop.
  digitalWrite(STBY, LOW);
  delay(1000);
  digitalWrite(STBY, HIGH);
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-29.

## Questions

### Where does the motor power come from with a Pico?

From VM, a separate 4.5 to 13.5 V supply. The Pico's 3V3 pin feeds only the driver's logic, about 1.1 mA typical at 3 V (Toshiba, p. 5), and GND_VM ties the motor supply's ground to the Pico's GND.

### Why do both motors pause for a second in the sketch?

The loop pulls STBY on GP6 low for 1000 ms. In standby both bridges turn their outputs off (Toshiba, p. 4), so the motors coast, and the loop then raises STBY and starts over.

### How much motor current can the TB6612FNG handle?

Toshiba rates 1.0 A per channel with VM at 4.5 V or more, lists 1.2 A as the absolute maximum, and allows 3.2 A only as a single 10 ms pulse (p. 3). Pick motors whose running current fits, and keep stalls short.

## More

- [TB6612FNG Motor Driver reference](https://www.tinkered.ai/components/tb6612fng-motor-driver.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the TB6612FNG Motor Driver on the Raspberry Pi Pico in the browser, with this wiring and code, free: https://www.tinkered.ai/components/tb6612fng-motor-driver/raspberry-pi-pico
