6.2. User interface

Power switch and pushbuttons

The power switch on the rear of the Zumo 2040 main board controls power from the robot’s batteries.

The main board has four pushbuttons: a reset button on the right and three user pushbuttons located along the rear. Pressing the reset button connects the RUN pin to ground, and pressing one of the user pushbuttons pulls the associated I/O pin to ground through a resistor. The user pushbuttons, labeled A, B, and C, are on GP25, QSPI_SS_N, and GP0, respectively. Button B doubles as a BOOTSEL button to run the RP2040’s built-in USB bootloader if held on startup.

The three buttons’ I/O lines are also used for other purposes: GP0 is a display interface line, GP25 controls the yellow user LED, and QSPI_SS_N is the flash memory chip select pin (in addition to its BOOTSEL function). These uses require the pins to be driven by the RP2040, and reading QSPI_SS_N is not as straightforward as reading a normal GPIO pin. However, resistors in the button circuits ensure that the Zumo 2040 main board will not be damaged and operation will not be disrupted even if the buttons are pressed while the corresponding pins are being driven, and the functions in the Zumo 2040 Robot Libraries and Example Code take care of configuring the pins, reading and debouncing the buttons, and restoring the pins to their original states.

Indicator LEDs

The Zumo 2040 has eight indicator LEDs:

  • A yellow user LED is connected to GP25. You can drive this pin low in a user program to turn this LED on. The user LED is located near the USB connector at the rear of the board, and the Zumo 2040 libraries contain functions that make controlling it easier. The user LED shares the GP25 pin with button A.
  • Two red LEDs on the left and right edges of the board indicate when the robot’s infrared emitters are active on the corresponding side.

The remaining five LEDs are power indicators:

  • A blue power LED next to the power switch indicates when the switch is turned on and the robot is receiving power from its batteries (VSW).
  • A blue power LED under the rear left corner of the Zumo (closer to the power switch) indicates when the logic boost regulator is active and producing 8.3 V (VBST). The regulator is powered by the Zumo’s batteries, so the power switch must be turned on.
  • A blue power LED under the rear right corner of the Zumo (farther from the power switch) indicates when the Zumo’s 3.3 V logic buck regulator is receiving power (VB/VU). The input to the 3.3 V regulator can come from either the 8.3 V boost regulator or from USB, so this LED will be lit when either the power switch is turned on or when the Zumo is plugged in to USB.
  • A green power LED under the center rear edge of the main board (near the USB connector) indicates when the USB bus voltage (VBUS) is present.
  • A green power LED on the right edge near the reset button indicates when the Zumo’s logic circuit, including the microcontroller, is receiving 3.3 V power (3V3).

The left blue LED (on VSW) will become noticeably dimmer as the total battery voltage drops below about 3 V, and this can serve as an indication that a set of alkaline batteries has reached the end of its useful life. However, rechargeable batteries can be damaged by overdischarge, so we do not recommend allowing a set of four NiMH cells to discharge to this point. (A voltage divider is connected to GP26 and can be used to monitor the battery voltage; see Section 6.8 for details.)

RGB LEDs

The Zumo 2040 also features six individually-addressable RGB LEDs. Three of these are near the rear of the board by the pushbuttons, while the other three are along the front of the board. The RGB LEDs have integrated drivers compatible with the popular APA102 addressable LED, and they are chained together in alphabetical order (labeled A through F) and arranged counterclockwise on the board.

The main board uses SPI0, one of its two hardware SPI modules, on GP3 and GP6 (TX and SCK, respectively) to control the RGB LEDs. The Zumo 2040 libraries include functions that make it easier to control the RGB LEDs and use them together with the OLED display, which shares the SPI0 interface with the RGB LEDs. The display and RGB LEDs share a common pin for SPI0 TX (data), but use different pins for SPI0 SCK (clock), allowing them to be controlled separately.

The output signals from the last RGB LED are brought out to the DO (data out) and CO (clock out) pins, and you can use these pins to add more APA102-compatible RGB LEDs to the chain.

Buzzer

The buzzer included with the Zumo 2040 can be soldered into the designated through-holes and used to generate simple sounds and music (the buzzer is pre-installed on the assembled versions of the robot). By default, it is connected to GP7, which can be configured as PWM3 B to produce hardware pulse width modulation. If you alternate between driving the buzzer pin high and low at a given frequency, the buzzer will produce sound at that frequency. You can play notes and music with the buzzer using functions in the Zumo 2040 libraries. If you want to use GP7 for an alternate purpose, you can disconnect the buzzer circuit by cutting the surface-mount jumper next to the buzzer.

Display header

The Zumo 2040 main board has a 1×7 header where you can connect a graphical OLED module with a low-profile male header. The kit and assembled versions of the Zumo 2040 robot include an OLED display that has a resolution of 128×64 pixels and uses an SH1106 controller (1MB pdf), which the Zumo communicates with via its SPI0 module.

The Zumo 2040 libraries provide functions to show data on a connected display while also allowing the display interface lines to be used for other purposes (such as pushbutton inputs and RGB LED data).

Related Products

Zumo 2040 Robot Kit (No Motors)
Zumo 2040 Robot (Assembled with 50:1 HP Motors)
Zumo 2040 Robot (Assembled with 75:1 HP Motors)
Zumo 2040 Robot (Assembled with 100:1 HP Motors)
Zumo 2040 Main Board
Zumo 2040 Front Sensor Array
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors