6.11. Adding electronics

This section gives tips for how to expand the Zumo 2040 with additional electronics.

Free I/O pins

The pins GP28 and GP29 are free I/O pins that are not used for anything on the Zumo 2040. Both of these pins can be used as general purpose inputs, analog inputs, digital outputs, or PWM outputs.

The Zumo 2040 has several traces that you can cut to disconnect I/O pins from their on-board functions, freeing them up for other uses. There is a cuttable SMT jumper for GP7 labeled “Buzzer = 7” in the OLED display area and another for GP26 labeled “26 = BAT LEV” on the left edge of the main board. The front sensor array contains cuttable traces for the pins used by the front sensors: GP18 (J21), GP19 (J1), GP20 (J9), GP21 (J2), GP22 (J3), GP23 (J4), GP24 (J22), GP26 (J6), and GP27 (J15). The RP2040 functions available on these pins are documented in Section 6.10.

Adding an I²C device

There are two types of devices that can connect to an I²C bus: a controller is a device that initiates transfers of data, generates clock signals, and terminates transfers, while a target is a device that is addressed by a controller.

You can add I²C devices to the Zumo 2040 by connecting the SDA pin of each device to GP4 and connecting the SCL pin of each device to GP5. Both of those pins are available in several places on the expansion headers and on the I2C0 connector (see Section 6.9). These are the same pins used by the inertial sensors documented in Section 6.7, so the I²C addresses of any targets you add here must be different than the I²C addresses of the inertial sensors. The LIS3MDL uses address 30 (0b0011110) and the LSM6DSO uses address 107 (0b1101011). The GP4 and GP5 pins are each pulled up to 3.3 V with a 10 kΩ resistor.

The RP2040 acts as an I²C controller on the GP4/GP5 bus when it accesses the inertial sensors. If you are adding another I²C controller to the bus, it is probably best to avoid the complexity of a multi-controller setup and instead configure the RP2040 to be an I²C target (or not use the bus at all).

Another option is to add an I²C device by connecting its SDA pin to GP28 and connecting its SCL pin to GP29. These are free I/O pins that are not used for anything on the Zumo 2040. However, note that if you want to use hardware I2C on these pins, you would need to use the RP2040’s I2C0 module, which is the same one used for the inertial sensors on GP4 and GP5. To work around this conflict, you could use a software I²C implementation for one of the busses or consider adding code to change the I2C0 pin function selections dynamically.

Any I²C devices you add must be compatible with the 3.3 V levels used by the RP2040 or use a level shifter.

Adding a UART serial device

The RP2040’s UART0 module is available on the free I/O pins GP28 (TX) and GP29 (RX). Alternatively, if you remove the OLED display, you can use UART0 on GP0 (TX) and GP1 (RX). Any UART serial devices you add must be compatible with the 3.3 V levels used by the RP2040 or use a level shifter. The RP2040’s I/O pins are not 5 V tolerant.

Adding an SPI device

If you remove the OLED display, you can use the RP2040’s SPI0 module on pins GP0 (RX), GP1 (CSn), GP2 (SCK), and GP3 (TX). The RGB LEDs typically use SPI0, but it is possible to work around this conflict by changing the SPI0 pin function selections dynamically, and the libraries we provide for the Zumo 2040 OLED and RGB LEDs show how to do this.

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