Skip to content

Introduction

Hookup Guide

Introduction

  • SparkFun Thing Plus - RP2350
    SKU: WRL-25134


    Product Thumbnail

  • The SparkFun Thing Plus - RP2350 is a dynamic and powerful wireless development platform in the Thing Plus form factor. Built around the RP2350 microcontroller from the Raspberry Pi Foundation, this board includes their radio module for single-band 2.4 GHz WiFi 4 (802.11n) and Bluetooth® 5.2 along with common hardware components found on all Thing Plus Boards. This includes on-board Lithium Ion (LiPo) battery charging and fuel gauge circuits, µSD card socket, Qwiic connector, and the Thing Plus pinout allowing use of the Thing Plus - RP2350 in a wide variety of both local and remote applications.

    The Raspberry Pi Radio Module (RM2) operates over an SPI interface, and we've designed this board to use the same pins for the radio module as official Raspberry Pi boards, making it easy to use the radio module without having to adjust anything from those development boards. The RP2350 Thing Plus includes two expanded memory options: 16MB of external Flash and 8MB PSRAM connected to the RP2350's QSPI controller. This Thing Plus board works with C/C++ using the Pico SDK, MicroPython, CircuitPython, and Arduino development environments.

    Purchase from SparkFun

Required Materials

To follow along with this guide you will need at least one USB-C cable to connect the Thing Plus to your computer:

You may also want to get a Qwiic cable or kit to connect the Thing Plus - RP2350 to other Qwiic devices:

Optional Materials

The Thing Plus - RP2350 includes a 2-pin JST connector and integrated charging circuit for an attached single-cell LiPo battery. Below are a few options we recommend for battery-powered applications:

WARNING: LiPo Battery Connector Polarity (v10 Only)

The LiPo battery connector on v10 (DD-27675), of the Thing Plus - RP2350 is reversed from SparkFun's normal 2-pin JST battery connection. If you are using this board with a battery, follow the silkscreen markings on the board for correct polarity. This means v10 is incompatible with all single-cell LiPo batteries SparkFun carries.

The updated version, v11 (WRL-25134), fixes this issue.

If you prefer a soldered connection or want to modify the solder jumpers on this board, you may need some of the products listed below:

Suggested Reading

We designed this board for integration into SparkFun's Qwiic connect system. Click on the banner below to learn more about the SparkFun Qwiic Connect System.

Before getting started with this Hookup Guide, you may want to read through the tutorials below if you are not familiar with the concepts covered in them or want a refresher. If you are using either of the Qwiic Shields linked above, we recommend reading through their respective Hookup Guides before continuing with this tutorial:

Hardware Overview

Let's take a closer look at the RP2350 and other hardware components on this Thing Plus board.

RP2350 Microcontroller

The RP2350 from Raspberry Pi packs a whole lot of computing punch in a tiny package. The RP2350 is a unique dual-core microcontroller that has four internal processors (two Arm Cortex-M33 and two Hazard3 RISC-V processors @150 MHz), though you can only select any two of these four to run at the same time.

Photo highlighting RP2350 processor

This internal configuration allows users to customize the chip to use a pair their preferred architecture (ARM or Hazard3) or to use one of each! The RP2350 includes 520kB of on-chip SRAM in ten independent banks, 8kB of one-time-programmable (OTP) storage and this board also includes PSRAM connected to the chip's QSPI bus. The RP2350 also has a bevy of security features including optional boot signing with protected OTP storage for the boot decryption key, global bus filtering (based on either Arm or RISC-V security and privilege levels) and more.

The Thing Plus - RP2350 uses the "A" version of the microcontroller which has 30 5V-tolerant GPIO with 4 analog inputs and also includes the following peripheral options:

  • 2x UART
  • 2x SPI
  • 2x I2C
  • 24 PWM
  • USB 1.1 Controller
  • 12 PIO State Machines
  • 1x High-Speed Transmit (HSTX) Peripheral for DVI/DSI support

For complete information on the RP2350, refer to the datasheet.

Memory

W25Q128 Flash

The W25Q128 Flash IC adds 16MB of storage space on the Thing Plus. This connects to the RP2350 over QSPI.

Photo highlighting Flash IC

PSRAM

The board also includes an 8MB PSRAM IC for dynamic storage. This also connects to the RP2350 over QSPI. PSRAM support is included in the SparkFun MicroPython "early release" firmware found later in this guide and on the product page, but is not natively supported in the Pico SDK as of release. Refer to the Arducam Demo section of this guide for information on how to enable and set up PSRAM using the Pico SDK.

For a complete overview of the PSRAM IC, refer to the datasheet.

µSD Card Slot

The board has a µSD card slot that connects to the RP2350's SPI bus for even more storage. Make sure the SPI are LOW when the µSD card is unpowered. Setting these pins HIGH can damage the GPIO pins. The connector is a fricton-fit connector so no "clicking" and "unclicking" is necessary. Just plug it in nice and snug.

Photo highlighting microSD card slot

Raspberry Pi RM2 Radio Module

The Raspberry Pi RM2 (radio module 2) is built around the same chipset as the previous Raspberry Pi radio module found on boards like the Pico W. The module features both WiFi 4 (802.11n) 2.4GHz and Bluetooth 5.2 with support for Low Energy (Central and Peripheral) and Classic.

Photo highlighting the RM2

The RM2 communicates with the RP2350 over SPI and we've designed this board to use the same pins for the radio module as official Raspberry Pi boards (Pico W and Pico 2 W), making it easy to use the radio module without having to adjust anything from those development boards. The Thing Plus routes the module's GPIO0 pin to a blue STAT LED to allow users to create a visual indicator of the status of the module. We added this STAT LED connected to the same pin used on the Pico W to make code for that compatible with the Thing Plus - RP2350.

Power Components

The Thing Plus - RP2350 includes several options for powering including USB-C, LiPo battery with on-board battery charging and monitoring circuits as well as direct power inputs.

Photo highlighting USB-C & JST LiPo connectors.

USB-C Connector

The USB-C connector on the board acts as the primary serial interface for the RP2350 as well as a power input. The 5V USB input voltage is regulated down to 3.3V through a voltage regulator with a max current of 500mA@3.3V.

2-Pin JST Connector, Battery Charger, & Fuel Gauge

WARNING: LiPo Battery Connector Polarity (v10 Only)

The LiPo battery connector on v10 (DD-27675) of the Thing Plus - RP2350 is reversed from SparkFun's normal 2-pin JST battery connection. If you are using this board with a battery, follow the silkscreen markings on the board for correct polarity. This means v10 is incompatible with all single-cell LiPo batteries SparkFun carries.

The updated version, v11 (WRL-25134), fixes this issue.

Want some LiPo battery care tips?

Check out our Single Cell LiPo Battery Care tutorial for some helpful tips on handling and caring for them.

Tutorial's thumbnail
Single Cell LiPo Battery Care

The board has a 2-pin JST connector to connect a single-cell Lithium Ion (LiPo) battery for battery-powered applications. It also has an MCP73831 battery charger to charge an attached battery and a MAX17048 fuel gauge to monitor battery voltage levels. The charge rate is set to 214mA@3.3V. The MCP73831 receives power from the V_USB line so it only is powered when 5V is provided either over USB or the V_USB PTH pin. If applying voltage directly to the V_USB pin make sure it does not exceed 5.5V.

The MAX17048's I2C lines are pulled up to 3.3V_P to allow for customizable power options. Read on below for more information about peripheral power.

Peripheral Power Control

The board includes a second RT9080 3.3V regulator to control power to the peripheral 3.3V (3.3V_P) rail. This is powered on by default with some options for user control to help conserve power. The RT9080's EN (Enable) pin is tied to GPIO13 so users can drive it LOW in their code to disable this line. It also is tied to the main 3.3V rail through the LP solder jumper so it defaults to powered on. If this solder jumper is opened, it defaults to off when the RP2350 is power-cycled though users can drive the GPIO13 pin HIGH in their code to enable the 3.3V_P rail.

Pinout & Qwiic Connector

Thing Plus boards break out a large number of GPIO and interface pins to a pair of 0.1"-spaced plated through-hole (PTH) headers and also has a Qwiic connector for easy integration into SparkFun's Qwiic ecosystem.

Qwiic Connector

The Qwiic connector is tied to GPIO6 (SDA) and GPIO7 (SCL) pins on the RP2350. The Qwiic connector provides connections for SDA, SCL, 3.3V, and Ground. Note, the Qwiic connector power and I2C pins are tied to 3.3V_P and are powered by default but if the peripheral power control circuit is adjusted as covered above, it will not function properly without enabling 3.3V_P through code.

Photo highlighting Qwiic connector.

PTH Headers

The Thing Plus's pair of PTH headers break out a selection of 21 GPIO pins from the RP2350 along with PTH connections to USB voltage (5V), regulated 3.3V, battery voltage, RP2350 reset signal, and the voltage regulator Enable pin. The board also has a "central" row of three 0.1"-spaced headers connected to the RP2350's internal Serial Wire Debug multi-drop bus.

Photo highlighting PTH pins

The pinout includes connections to UART, I2C, SPI, 13 GPIO (3 of analog-capable pins) and the WS2812's DATA OUT pin.

Buttons

There are two buttons on the board labeled RESET and BOOT. The RESET button is tied to the RP2350's RUN pin and resets the IC when pressed. The BOOT button puts the RP2350 into bootloader mode when held down during power on or reset. Read on to the UF2 Bootloader section of this guide for more information on using the bootloader.

Photo highlighting RESET & BOOT buttons

LEDs

The Thing Plus - RP2350 includes three labeled LEDs; PWR, CHG and STAT as well as a WS2812 RGB LED.

Photo highlighting the four LEDs on the board.

The red PWR LED indicates when the 3.3V rail is powered. The yellow CHG LED indicates when the charge circuit is powered with 5V from either the USB-C connector or the V_USB PTH pin. The blue STAT LED is tied to the RM2 radio module GPIO0 to be used for indicating when the module is transmiting/receiving data. The WS2812 RGB LED's DATA IN pin is tied to the RP2350 GPIO14 pin. The RGB LED's DATA OUT pin is routed to the FREEBIE PTH (labeled LED on the board) if users want to daisy-chain more LEDs to the board.

Jumpers

Never modified a jumper before?

Check out our Jumper Pads and PCB Traces tutorial for a quick introduction!

Tutorial's thumbnail
How to Work with Jumper Pads and PCB Traces

This Thing Plus has four solder jumpers labeled PWR, I2C, LP, and SHLD.

Photo highlighting solder jumpers.

The PWR jumper completes the Power LED circuit and is CLOSED by default. Open the solder jumper by severing the trace in between the two pads to disable the Power LED if needed.

The I2C jumper pulls the I2C lines (SDA/SCL) to 3.3V through a pair of 2.2kΩ resistors. This three-way jumper is CLOSED by default. Open the solder jumper to disable the pullup resistors on the I2C bus if needed.

The LP jumper controls whether the peripheral power regulator is always on or toggleable with an I/O pin (RP2350 GPIO13). This jumper is CLOSED by default so all peripherals (Qwiic connector, µSD slot and RGB LED) are always powered on. Opening this jumper requires setting GPIO13 HIGH to enable peripheral power.

The SHLD jumper connects the USB-C connector's shield pin to the board's ground plane. This jumper is CLOSED by default. Open it to isolate the shield pin from the board.

Board Dimensions

This board matches the Thing Plus footprint and measures 2.3" x 0.9" (58.42mm x 22.86mm) and includes four mounting holes that fit a 4-40 screw. Note, the RM2 antenna comes very close to the "top" two mounting holes so take care when securing anything to these holes to avoid damaging the radio's antenna.

Photo highlighting solder jumpers.

Need more measurements?

For more information about the board's dimensions, users can download the Eagle files for the board. These files can be opened in Eagle and additional measurements can be made with the dimensions tool.

Eagle - Free Download!

Eagle is a CAD program for electronics that is free to use for hobbyists and students. However, it does require an account registration to utilize the software.

Download from
Autodesk primary logo

📏 Dimensions Tool

This video from Autodesk demonstrates how to utilize the dimensions tool in Eagle, to include additional measurements:

Hardware Assembly

Qwiic Assembly

Basic assembly of the Thing Plus - RP2350 just requires plugging the board in over USB-C to upload firmware and/or start programming with it. SparkFun offers a variety of Qwiic breakout boards with Python libraries like the AS6212 Temperature Sensor Breakout connected to the board in the photo below:

Photo of basic Qwiic assembly with AS6212 temperature sensor.

Soldered Assembly

New to soldering?

If you have never soldered before or need a quick refresher, check out our How to Solder: Through-Hole Soldering guide.

Tutorial's thumbnail
How to Solder: Through-Hole Soldering

Users looking to start prototyping with the Thing Plus plugged into a breadboard should solder a pair of male or stackable headers.

Photo demonstrating soldering headers to the Thing Plus - RP2350.

UF2 Bootloader

The Thing Plus - RP2350 uses a UF2 bootloader for easy flashing/uploading of code to the board. The UF2 bootloader causes the board to show up on your computer as a USB storage device and does not require any drivers for Windows, Mac OSX, and Linux! This bootloader is used for uploading in both the Pico SDK and MicroPython development environments so let's take a brief look at how to enter bootload mode.

What is UF2?

UF2 stands for USB Flashing Format, which was developed by Microsoft for PXT (now known as MakeCode) for flashing microcontrollers over the Mass Storage Class (MSC), just like a removable flash drive. The file format is unique, so unfortunately, you cannot simply drag and drop a compiled binary or hex file onto the board. Instead, the format of the file has extra information to tell the processor where the data goes, in addition to the data itself. For more information about UF2, you can read more from the MakeCode blog, as well as the UF2 file format specification.

Entering the Bootloader

Putting the Thing Plus - RP2350 into bootloader mode only requires a couple of presses of the BOOT and RESET buttons. Start by pressing and holding the BOOT button down:

Pressing the BOOT button.

Next, press and release the RESET button while still holding down the BOOT button:

Photo highlighting RP2350.

Finally, release the BOOT button and the board should be in bootloader mode and appear on your computer as a USB storage device called "RP2350".

Pico SDK Setup

Raspberry Pi Pico SDK

The Pico C SDK is a C/C++ development kit for Raspberry Pi microcontrollers including the RP2350. Click on the links below for complete documentation on installing and using the SDK.

Pico C SDK Documentation

Pico C SDK GitHub Repository

Thing Plus - RP2350 Board Definition

When using the Pico SDK, make sure to use v2.1 or later and select sparkfun_thingplus_rp2350 for the board. We recommend using Microsoft VS Code with the Pico SDK Extension.

MicroPython Setup

Setup

MicroPython is an application of the Python 3 language that runs on microcontrollers like the Thing Plus - RP2350 that allows you to easily interact with the board directly over a USB serial interface through either a command line interface or your preferred Python IDE such as Thonny. We'll do a quick overview of how to download MicroPython firmware on to the Thing Plus - RP2350 but for a complete overview of using MicroPython with this and other RP2350 boards, head over to Raspberry Pi's documentation by clicking the button below:

Raspberry Pi MicroPython Docs

UF2 Firmware

As of this writing, we're waiting on the next release of MicroPython to include UF2 files for the Thing Plus - RP2350 so to get users started before then, we have Beta releases of MicroPython firmware available here or by clicking the button below:

SparkFun MicroPython Beta Releases

Simply download the latest release and then put the Thing Plus - RP2350 into UF2 bootloader mode and open the location the board appeared as a USB storage device (it should appear as "RP2350"). Next, simply drag and drop the UF2 file into the RP2350 folder and the board should reboot. After the board reboots, open up your preferred MicroPython IDE (or command line interface) and you can start interacting with your Thing Plus. Read on to the MicroPython examples section for a few quick examples to make sure everything is working properly.

CircuitPython Setup

Setup

The Thing Plus - RP2350 is included in the latest release of CircuitPython. If you've never used CircuitPython before, take a read through their tutorial here or click the button below:

Welcome to CircuitPython

Thing Plus - RP2350 Firmware

Download the latest firmware for the Thing Plus - RP2350 from the CircuitPython downloads page and search for "Thing Plus RP2350".

Arduino Setup

Attention

If this is your first time using Arduino, please read through our tutorial on installing the Arduino IDE. If you have not installed an Arduino library before, we recommend you check out our installation guide.

Arduino-Pico Boards

The SparkFun Thing Plus - RP2350 is supported on the Arduino IDE in the Arduino-Pico boards package. To install the package, open the Preferences menu by navigating to File > Preferences. Look at the bottom of the Preferences menu for "Additional boards manager URLS" and then copy this JSON link into that field:

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

Click "OK" to close this menu then navigate to the Boards Manager tool and search for "pico" and download the latest release of "Raspberry Pi Pico" (4.2.1 or later).

Screenshot of board manager tool searching for pico.

For more information on using the Arduino-Pico boards package, check out their documentation page.

MicroPython Examples

Verify MicroPython Firmware & Hardware

First, to make sure everything is running properly, use the sys module to verify the firmware version and machine/board running. Open your preferred interface and enter the following prompts and you should see something similar to the printout below:

import sys
sys.implementation
(name='micropython', version=(1, 24, 0, 'preview'), _machine='SparkFun Thing Plus RP2350 with RP2350', _mpy=7942)

Verify Memory (Internal and PSRAM)

Next, we can verify the total free memory on the Thing Plus which includes the built-in memory on the RP2350 as well as the 8MB PSRAM. We'll use the gc module for this so type in the prompt below and you should see a response close to the value below:

import gc
gc.mem_free()
8640352

WS2812 LED Control

Now let's make sure we can properly control the WS2812 LED on the Thing Plus using the machine and neopixel classes. The WS2812 Data In pin connects to I/O 14 but we've defined this pin as "NEOPIXEL" which takes care of assigning the pin and defining it as an output. Next, we'll set the color to red and finally write the color values to the LED. The code below goes through all these steps so try copying it on your machine and you should see the WS2812 LED turn red.

import machine, neopixel
pin = machine.Pin("NEOPIXEL")
led = neopixel.NeoPixel(pin, 1)
led[0] = (255, 0, 0)
led.write()

Try playing around with other values between 0 and 255 for the three colors (R, G, B) and then writing the changes to switch the LED's displayed color.

Network Test

Finally, let's run an example to test connecting the Thing Plus - RP2350 to a WiFi network, then access an API and print out the data returned. This example polls a database maintained here that lists the number and names of astronauts currently on the ISS and then prints them out. The code also includes some helpful RGB status colors to indicate when the board is connecting to WiFi (RED), downloading data (BLUE), and on success (GREEN).

  • Photo showing WS2812 set to RED. LED set to RED while connecting to WiFi.

  • Photo showing WS2812 set to BLUE. LED set to BLUE while downloading.

  • Photo showing WS2812 set to GREEN. LED set to GREEN indicating download success.

Before running the example, adjust the template values in the example called WIFI_NETWORK and WIFI_PASSWORD with your WiFi network ID and password.

import network
import urequests
import time
import neopixel
import machine

# Set up the NeoPixel LED
pin = machine.Pin("NEOPIXEL")
led = neopixel.NeoPixel(pin, 1)

# Set the LED to red while connecting to WiFi
led[0] = (255, 0, 0)
led.write()

# Connect to a WiFi network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('WIFI_NETWORK', 'WIFI_PASSWORD')

# Wait for the connection to complete
print("Waiting for connection...")
while not wlan.isconnected():
    time.sleep(1)
    print('.', sep='', end='', )
print('Connected!')

# Set the LED to blue while downloading data
led[0] = (0, 0, 255)
led.write()

# Download the list of astronauts currently in space
print('Downloading list of astronauts currently in space...')
astronauts = urequests.get("https://corquaid.github.io/international-space-station-APIs/JSON/people-in-space.json").json()

# Print the number of astronauts and their names
number = astronauts['number']
print('There are', number, 'astronauts in space.')
for i in range(number):
    print(i+1, astronauts['people'][i]['name'])

# Set the LED to green to indicate success
led[0] = (0, 255, 0)
led.write()

Arduino Examples

Vision Demo Assembly:

This Vision Demo lets you build an all-in-one image capture and display assembly run completely on the RP2350. We created this project to showcase the raw processing power and data transmission speeds of the RP2350 in a local environment. This project connects the waveshare OV5640 Camera Board along with a 2" LCD (coming soon to SparkFun!) to the RP2350 over SPI and the RP2350's HSTX-capable pins. The example takes a live video feed from the OV5460 and displays it with nearly no image lag at about 40fps. While this demo is only a local image, with some code modifications you could theoretically take the images and stream them over WiFi or Bluetooth to create a true IoT camera.

Hardware Assembly

Soldering

Before wiring anything up, make sure to solder headers (or wires if you prefer) to both the Thing Plus and the LCD board.

Photo demonstrating soldering headers to Thing Plus.

Display Wiring

The display used in this example connects over SPI along with a few other connections for power (VCC & GND), reset . The table below outlines the connections between the display and Thing Plus when read from Left to Right on the display.

Display Pin Thing Plus Pin Notes
GND GND Any ground pin
VCC 3V3 Power with 3.3V only
SCL* 19 Clock signal
SDA* 18 Data In. Called "Din" in example code.
RES 3V3 Reset pin. Pulled HIGH to 3.3V
DC* 17 SPI display data/command select pin.
CS* 16 SPI Chip select.
BLK NC Backlight pin.

The photos below show the wiring before and after seating the LCD on the breadboard:

LCD wiring without display connected.

If you're following this wiring to the letter, take note of the orange jumper wire netting the display's Reset pin to VCC/3.3V. Also note to align the Backlight pin with pin 30 on the breadboard and everything else will match up.

LCD wired and connected.

Camera Wiring

The camera wiring gets a bit more compliated than the display is it requires power and data signals as well as image processing signals that must be connected to sequential pins. Due to the design of the Thing Plus, this wiring may seem a bit confusing when looking at the board but if you refer to the schematic you can match up GPIO pins 0 through 7 to their respective labels on the board. The table below outlines these pin connections along with the rest required to wire the camera breakout to the Thing Plus:

Camera Pin Thing Plus Pin Label Notes
3.3V 3V3 3.3V only
GND GND Any Ground pin
SIOC 21 Clock signal. Paired with data to any I2C pin pair
SIOD 20 Data signal. Paired with data to any I2C pin pair
VSYNC A1/27 Can be any GPIO pin
HREF A2/28 Can be any GPIO pin
PCLK A0/26 Can be any GPIO pin
XCLK 11 Can be any GPIO pin
D9 SCL/7 Must be sequential GPIO pins
D8 SDA/6 Must be sequential GPIO pins
D7 5 Must be sequential GPIO pins
D6 POCI/4 Must be sequential GPIO pins
D5 PICO/3 Must be sequential GPIO pins
D4 SCK/4 Must be sequential GPIO pins
D3 RX/3 Must be sequential GPIO pins
D2 TX/2 Must be sequential GPIO pins
RST - Not connected
PWDN - Not connected

We made an ad-hoc wiring "harness" for the camera board by soldering wires to a couple of trimmed female headers so please excuse the wiring mess in the photos below show. The photos below show the wiring for the camera with and without the camera board connected to our harness. Users can try and recreate this or if you're making a more permanent installation you can solder wires directly between all three boards. Alternatively, you could use some jumper wires (perhaps either male/female or female/female).

Photo showing wiring without the camera board plugged in.

Photo showing wiring with camera board plugged in.

Threshold Pin

The code also includes a thresholding pin set to GPIO22 on the Thing Plus. Connect this pin to ground using a jumper wire. The threshold pin is configured as an input with pull-up so it starts as disabled (22 connected to GND) and can be enabled by disconnecting the wire from ground. The images above and below show this connection using an Orange jumper wire.

Completed Assembly

Make sure everything is wired correctly and your completed assembly might look something like the photo below:

Completed vision demo assembly.

Vision Demo Code:

Software Requirements

This example is written for Arduino and requires the IDE, the Thing Plus - RP2350 board definition included in the Arduino Pico boards package as well as the SparkFun iCap OV5640 and SparkFun HSTX ST7789 Arduino libraries. Make sure you've gone through the boards package installation instructions in the Arduino Setup section of this guide and then follow the instructions below to install the required libraries.

Required Libraries

The example requires the SparkFun ImageCapture and RP2 HSTX ST7789 Arduino Libraries. You can install them through the Library Manager in the Arduino IDE by searching for "SparkFun ImageCapture" and "SparkFun RP2 HSTX ST7789" and install the latest version. Alternatively, you can download a ZIP of each library to manually install them by clicking the buttons below:

SparkFun ImageCapture Arduino Library (ZIP)

SparkFun RP2 HSTX ST7789 Arduino Library (ZIP)

With the libraries installed, let's move on to uploading the code.

Vision Demo Example Code

The example code for this demo can be found in the Thing Plus - RP2350 GitHub Repository in the "Examples/Vision_Demo" folder. You can find it from the link above or download a ZIP of the entire repository by clicking the button below:

Thing Plus - RP2350 GitHub Repo (ZIP)

Open up the example in Arduino or open a blank sketch and copy the code below:

Vision Demo
#include "SparkFun_iCap_OV5640.h"
#include "SparkFun_RP2_HSTX_ST7789_Arduino_Library.h"

// Configuration for the display
RP2_HSTX_ST7789_Config displayConfig = {
    .pinDin  =   18, // Must support HSTX (GPIO 12-19 on RP2350)
    .pinSck  =   19, // Must support HSTX (GPIO 12-19 on RP2350)
    .pinCs   =   16, // Must support HSTX (GPIO 12-19 on RP2350)
    .pinDc   =   17, // Must support HSTX (GPIO 12-19 on RP2350)
    .pinRst  =   -1, // Any GPIO pin, or -1 if not connected
    .pinBl   =   -1, // Any GPIO pin, or -1 if not connected
    .width   =  320, // Display width
    .height  =  240, // Display height
    .rawMode = true, // Whether to use raw mode
};

// Set up arch and pins structures for Pico RP2040.
iCap_arch arch =
{
    .pio = pio0, // Can be pio0, pio1, or pio2 on the RP2350
    .bswap = false // Whether to swap the camera data bytes
};

// Pins for the OV5640 camera
OV5640_pins pins =
{
    .enable = -1, // Any GPIO pin, or -1 if not connected
    .reset  = -1, // Any GPIO pin, or -1 if not connected
    .xclk   = 11, // Any GPIO pin
    .pclk   = 26, // Any GPIO pin
    .vsync  = 27, // Any GPIO pin
    .hsync  = 28, // Any GPIO pin
    .data   = {0, 1, 2, 3, 4, 5, 6, 7}, // Any GPIO pins, must be sequential!
    .sda    = 20, // Any I2C pin pair
    .scl    = 21  // Any I2C pin pair
};

// Create an instance of the camera
SparkFun_iCap_OV5640 cam(pins, &arch, Wire1);

// Create an instance of the display
RP2_HSTX_ST7789 display;

// Threshold pin
int thresholdPin = 22;

void setup() {
    Serial.begin(115200);
    Serial.println("Hello! Camera Test.");

    // Begin camera with QVGA resolution (320x240) and RGB565 color (16-bit)
    iCap_status status = cam.begin(OV5640_SIZE_QVGA, ICAP_COLOR_RGB565);
    while(status != ICAP_STATUS_OK)
    {
        Serial.println("Camera not found, please check wiring!");
        delay(1000);
    }

    // Initialize the display
    display.begin(displayConfig);

    // Set the threshold pin as an input with pull-up
    pinMode(thresholdPin, INPUT_PULLUP);
}

void loop()
{
    // Record the current time
    uint32_t t0 = micros();

    // Get the camera buffer
    uint16_t* buffer = cam.getBuffer();

    // Check whether thresholding is requested
    bool threshold = digitalRead(thresholdPin) != 0;

    // Send the command to start a new frame
    display.startNewFrameRaw();

    // Loop through all pixels in the frame buffer
    for (int y = 0; y < displayConfig.width; ++y)
    {
        for (int x = 0; x < displayConfig.height; ++x)
        {
            // Get the pixel value from the camera buffer
            int rgb = buffer[x * displayConfig.width + y];

            // Check whether thresholding is requested
            if(threshold)
            {
                // Extract the red, green, and blue components (RGB565)
                int r = (rgb >> 11) & 0x1f;
                int g = (rgb >> 5) & 0x3f;
                int b = rgb & 0x1f;

                // Calculate the sum of the components. Only use 5 bits of green
                // to match red and blue
                int sum = r + (g>>1) + b;

                // With 5 bits per channel, the maximum sum is 96, so we'll use
                // half of that as the threshold
                if(sum >= 48)
                {
                    // We're above the threshold, so set the pixel to white
                    rgb = 0xffff;
                }
                else
                {
                    // We're below the threshold, so set the pixel to black
                    rgb = 0x0000;
                }
            }

            // Send this pixel to the display
            display.putPixelRaw(rgb);
        }
    }

    // Record the current time
    uint32_t t1 = micros();

    // Print FPS of the display
    float fps = 1e6 / (t1 - t0);
    Serial.printf("Display FPS: %.2f\n", fps);
}

Select the board (SparkFun Thing Plus - RP2350) and port and click the "Upload" button. Once the code finishes uploading, you should see the screen turn on and start displaying a live feed from the camera.

Photo showing the display running and seeing a curious owl.

If the screen remains black, press the Reset button on the Thing Plus and it should start up after that. If you do not see anything, open the Serial Monitor in Arduino with the baud set to 115200, reset the board again and check to see if the camera connection error message prints. If it does, double check the wiring to make sure everything is connected properly.

Troubleshooting

LiPo Battery Connector Polarity (v10 only)

The LiPo battery connector on v10 (DD-27675) of the Thing Plus - RP2350 is reversed from SparkFun's normal 2-pin JST battery connection. If you are using this board with a battery, follow the silkscreen markings on the board for correct polarity. This means v10 is incompatible with all single-cell LiPo batteries SparkFun carries.

The updated version, v11 (WRL-25134), fixes this issue.

General Troubleshooting Help

Info

Not working as expected and need help?

If you need technical assistance and more information on a product that is not working as you expected, we recommend heading on over to the SparkFun Technical Assistance page for some initial troubleshooting.

SparkFun Technical Assistance Page

If you can't find what you need there, you'll need a Forum Account to search product forums and post questions.

Resources:

Resources

For more resources related to the , check out the links listed here: