6.7. Power

The 3pi+ 2040 control board includes battery terminal connections that provide access to power from the 3pi+ chassis’s four-AAA battery compartment. We recommend using rechargeable AAA NiMH cells, which results in a nominal voltage of 4.8 V (1.2 V per cell). You can also use alkaline cells, which would nominally give you 6 V.

The negative battery voltage is connected to GND. The positive battery voltage is designated VBAT. VBAT feeds into a reverse protection circuit and then a power switching circuit controlled by the on-board pushbutton. The output of the power switching circuit is designated VSW.

VSW provides power to the on-board motor voltage regulator, and that regulator’s output (VM) powers the DRV8838 motor drivers, so the motors can only operate if the batteries are installed and the power switch circuit is on.

The reverse protected and switched battery voltage on VSW can be monitored through a voltage divider that is connected to GP26. The divider outputs a voltage that is equal to 1/11 of the battery voltage. The 3pi+ 2040 Robot Libraries and Example Code provide functions that can be used to determine the battery voltage from this reading. GP26 is also used to control the line sensor infrared emitters (see Section 6.5); the low divider ratio ensures that the emitters are effectively off even while the pin is being used as an input to measure the battery voltage.

Power switch circuit

The 3pi+ 2040 control board uses the patented latching circuit from the Pololu pushbutton power switch, which provides a solid-state power switch for your robot controlled with the on-board pushbutton. By default, this pushbutton can be used to toggle power: one push turns on power and another turns it off. Alternatively, a separate pushbutton can be connected to the PWRA and PWRB pins and used instead. Multiple pushbuttons can be wired in parallel for multiple control points, and each of the parallel pushbuttons, including the one on the board itself, will be able to turn the switch on or off. The latching circuit performs some button debouncing, but pushbuttons with excessive bouncing (several ms) might not function well with it.

Alternatively, to disable the pushbutton, you can cut the button jumper labeled Btn Jmp; this allows you to connect a slide or toggle switch to control the board’s power instead. The switch should be wired such that it connects the SW pin to GND when it is closed, and a set of three through-holes along the left edge of the board provide a convenient place to do so (the third hole is not connected to anything but helps accommodate 3-pin switches).

The power switch circuit also offers several alternate pushbutton connection options that result in push-on-only or push-off-only operation, and additional inputs enable further power control options like allowing your robot to turn off its own power. These advanced control options are available through the button connection pins and four control inputs:

PIN Description
PWRA Connect through momentary switch to pin “PWRB” for standard push-on/push-off operation. Connect through momentary switch to ground for on-only operation.
PWRB Connect through momentary switch to pin “PWRA” for standard push-on/push-off operation.
ON A high pulse (> 1 V) on this pin turns on the switch circuit. This pin only functions when pushbutton operation is enabled (i.e. the button jumper has not been cut).
OFF A high pulse (> 1 V) on this pin turns off the switch circuit (e.g. allowing a powered device to shut off its own power). This pin only functions when pushbutton operation is enabled.
CTRL With pushbutton operation enabled, this pin directly determines the state of the switch circuit. A high pulse (> 1 V) on this pin turns on the switch; a low pulse (e.g. driving the pin low with a microcontroller output line or pushing a button connected from this pin to ground) turns the switch off. Leave this pin disconnected or floating when not trying to set the switch state. Note that this pin should not be driven high at the same time the “OFF” pin is driven high.
SW With pushbutton operation disabled (button jumper cut), this pin controls the state of the switch circuit: driving it low turns the switch on, while letting it float turns the switch off. Connect through slide or toggle switch to ground for on/off operation. Leave this pin disconnected or floating for proper pushbutton operation. We recommend only ever driving this pin low or leaving it floating; this pin should never be driven high while the slide switch is in the “On” position.

Motor voltage regulator

VSW supplies power to a regulator that provides 8 V for the 3pi+’s DRV8838 motor drivers. This regulated motor voltage helps keep the performance of the motors consistent as the batteries discharge and their voltage drops. However, the condition of the batteries can still have an impact on motor performance in some situations; see Section 6.3 for more details.

The 3pi+’s motor voltage regulator is designed to cut out at a higher voltage than its 3.3 V logic voltage regulator circuit. This way, if there is a significant transient drop in battery voltage due to the motors drawing a large amount of current, the motor voltage regulator will turn off and ensure that the battery voltage does not continue to fall. (Otherwise, the battery voltage could drop low enough to disable the logic regulator and cause the RP2040 to reset.)

3.3 V logic power circuit

The 3pi+ 2040’s logic power can come from either its batteries or its USB connection. When VSW is available, it powers the logic boost regulator, whose output is designated VBST and is normally 8.3 V. This output is not directly user-accessible, but both VBST and the 5 V USB bus voltage VBUS are connected through diodes to a supply called VB/VU (in other words, VB/VU is the result of ORing VBST and VBUS together).

VB/VU provides power for the logic buck regulator, which converts it into the 3.3 V logic voltage (designated 3V3) that supplies the control board’s logic circuitry, including the RP2040, sensors, RGB LEDs, and buzzer. The rest of the 3.3 V regulator’s achievable output current can be used to power other devices; under typical conditions, up to 1.5 A of current is available from 3V3 when the 3pi+ is running on battery power.

Since VBST (when present) is normally higher than VBUS, the 3pi+ will prefer to draw logic power from its batteries over USB when both are present, but it will still receive logic power from USB even when the power switch circuit is off. This can be useful if you want to upload or test a program without drawing power from the batteries and without operating the motors. It is safe to have USB connected and battery power switched on at the same time.

Topology of the 3pi+ 2040 Control Board power circuits.

Power distribution

  • VBAT is connected to the battery contact labeled BAT+ and provides a direct connection to the battery supply.
  • VSW is the battery voltage after reverse-voltage protection and the power switch circuit.
  • VM is the output of the on-board 8 V motor voltage regulator.
  • VBST is the output of the on-board 8.3 V logic boost regulator. (This output is not user-accessible.)
  • VB/VU is the input for the 3.3 V logic buck regulator; it normally comes from VBST through a diode, but it can come from 5 V USB power (VBUS) if VBST is not present or too low.
  • 3V3 is the output of the 3.3 V logic buck regulator.

See Section 6.8 for a diagram of the board’s power access points.

Related Products

3pi+ 2040 Robot - Standard Edition (30:1 MP Motors), Assembled
3pi+ 2040 Robot - Turtle Edition (75:1 LP Motors), Assembled
3pi+ 2040 Robot - Hyper Edition (15:1 HPCB Motors), Assembled
3pi+ 2040 Robot Kit with 30:1 MP Motors (Standard Edition Kit)
3pi+ 2040 Robot Kit with 75:1 LP Motors (Turtle Edition Kit)
3pi+ 2040 Robot Kit with 15:1 HPCB Motors (Hyper Edition Kit)
3pi+ 2040 Control Board
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors