Adafruit has released three RP2040 boards so far. We’ve already tested the Feather RP2040 and that board has become our favorite RP2040 board for many reasons. Adafruit’s second board, the ItstBitsy RP2040, is next up for our review, but we couldn’t wait to get our hands on Adafruit’s smallest RP2040 board, the QT Py 2040.
We already have the previous version, based on a SAMD21 chip. Comparing the two side by side, we can’t see much difference as both have the same GPIO pinout and identical size and Stemma QT connector. The only physical differences are an extra button and switching chips.
The QT Py RP2040 adds an extra analog pin, bringing the total to four, and it has a built-in NeoPixel RGB LED that is used as a status indicator and to alert us to problems in our code. But with such a small board, some sacrifices had to be made, most notably the reduced number of GPIO pins. Are the scale and GPIO pins worth paying more than double ($9.95 vs $4) the price of a Raspberry Pi Pico?
Adafruit QT Py RP2040 Hardware Specifications
|RP2040 SoC||ARM Cortex M0+ operates at a maximum of 133 Mhz|
|Flash storage||8MB QSPIA|
|GPIO||13 GPIO pins. 7 x Digital I/O, 4 x Analog 12-bit ADC, 2 x I2C (including Stemma QT), SPI, UART, Programmable IO, 1 x NeoPixel|
|USB port||USB C|
|Dimensions||0.86 x 0.7 in (22 x 18 mm)|
Design of the Adafruit QT Py RP2040
Adafruit’s QT Py RP2040 is much smaller than the Pico, about a third the size. It has castellations that can be used to mount the board to a PCB, but like Pimoroni’s Tiny 2040, the RP2040 SoC is located on the bottom of the board, meaning a cutout has to be made in the PCB for flush mounting.
You may think the Adafruit QT Py RP2040 looks familiar, and you’re right. The QT Py RP2040 bears a passing resemblance to Tiny 2040. Both are very close in size, but their GPIO layout is much different. The QT Py RP2040 has the same GPIO pinout as the previous SAMD21 power QT Py meaning this could be a project upgrade.
On top of the QT Py RP2040 are two buttons, power up and reset. The addition of a reset button is a nice feature as it saves wear and tear on the USB-C port. The strongest addition to the QT Py RP2040 is the Stemma QT connector located opposite the USB C port.
Stemma QT is Adafruit’s connector, introduced in 2018. In reality, it is a 3 or 4 pin JST PH connector which has a coded interface and thus can only be connected one way. Typical Stemma QT devices are sensors/inputs that use the I2C protocol for communication. Installing a Stemma QT component only requires the cable and nothing more. We don’t need to use pull-up resistors for the I2C SDA/SCL connections; everything just works. Stemma QT devices can be chained together to create elaborate, yet simple electronic projects. SparkFun’s Qwiic ecosystem of boards uses the same connector, so many of those may also be compatible with the Adafruit QT Py RP2040.
Using the Adafruit QT Py RP2040
At the heart of the QT Py RP2040 is Raspberry Pi’s “Pi Silicon” RP2040 SoC and that means we can write code for the QT Py RP2040 in MicroPython, CircuitPython, C/C++ and soon via the new Arduino Core. But most of us will code in CircuitPython, Adafruit’s own version of MicroPython that supports an extensive library of add-ons through a downloadable library of drivers.
Writing code in CircuitPython is much the same as Python, the only difference is that we save the project as code.py on the QT Py RP2040 and it will start automatically when the board is powered on. We installed the latest version of CircuitPython and performed some common tasks. Flashing LEDs and using buttons as inputs were no challenge. We then connected a NeoPixel ring to the board and installed the neopixel.mpy library. In a few minutes of coding, we had a multicolored NeoPixel ring that lit up our couch.
To test the Stemma QT connection, we used an MPR121 12-point gator clip breakout that creates 12 capacitive touch inputs. We installed the required libraries and then wrote our code, but then we saw errors that prevented us from continuing. Not to get beat, we connected the MPR121 to the board’s I2C pins and everything worked.
After a short chat with Adafruit, we discovered that the Stemma QT connection is on a secondary port, requiring our code to be modified to use board.SDA1 and board.SCL1† With that change, our code worked.
CircuitPython is simply the most effective way to work with the RP2040. We have the simplicity of Python and a huge amount of support in the form of documentation and code libraries for add-ons.
Usage scenarios for the Adafruit QT Py RP2040
The size and capabilities of the QT Py RP2040 tend to embed the board into a project. If space is at a premium, but you need the power of the RP2040, this is the board for you. We can also see that the QT Py RP2040 controls many USB HID devices such as stream decks, hotkeys and MIDI control.
The power of the RP2040 in a smaller package and the added flexibility of the Stemma QT interface. There is nothing not to like here. If you don’t need the Stemma QT interface, then Pimoroni’s Tiny 2040 might be for you. But the QT Py 2040 from Adafruit is a fantastic board for Pico projects. The only RP2040 board that can beat it is Adafruit’s Feather RP2040, a bigger board with more features and a price that’s $2 higher.