Legacy firmware. This guide covers the original HealthyPi 5 firmware. For new builds, use the current guide. Go to the equivalent page →

Programming

Arduino

Legacy guide — no longer updated

The HealthyPi 5 can be programmed with the Arduino IDE for both its RP2040 and ESP32 cores. The Arduino path is published primarily as a learning resource — it’s easier to read than the Zephyr code and makes the device’s signal-acquisition flow approachable for newcomers.

For ongoing development, our main work happens in Zephyr — the Arduino codebase tracks behind on new features.

The workflow at a glance

  1. Set up the RP2040 core in the Arduino IDE (unlocks USB streaming + display).
  2. Set up the ESP32 core (unlocks BLE).
  3. Pick a sketch that matches the mode you want — Base, BLE, or Display.
  4. Upload the sketch via UF2 bootloader.

1. Set up the RP2040 core

Install Earle Philhower’s arduino-pico core — it supports the Raspberry Pi Pico and a range of other RP2040 boards.

  1. In the Arduino IDE, open File → Preferences and paste this URL into Additional Board Manager URLs:

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

    Adding the arduino-pico package URL to Arduino IDE Preferences

    Already have a board URL there?

    If you’ve previously added ESP8266, stm32duino, or any other board manager URL, just append the URL above to the existing one — separate them with a comma.

  2. Open Tools → Board → Board Manager, search for Raspberry Pi Pico/RP2040 by Earle F. Philhower III, and install the latest version.

    Board Manager installing the arduino-pico core

  3. Once installed, the Raspberry Pi boards will appear under Tools → Board.

    Raspberry Pi RP2040 boards listed in the Arduino IDE Tools menu

  4. Clone or download the protocentral_healthypi_5_firmware repo and open any of the sketches inside.

  5. Install the analog front-end libraries. Open Sketch → Include Library → Manage Libraries and install:

    • Protocentral MAX30001 (by Protocentral)
    • Protocentral AFE4490 (by Protocentral)
    • Protocentral MAX30205 (by Protocentral)

    Installing the ProtoCentral sensor libraries via Manage Libraries

2. Set up the ESP32 core

For BLE you also need Espressif’s ESP32 core.

  1. Add the ESP32 board package URL to the same Additional Board Manager URLs field (separated by a comma if you already have URLs there):

     https://dl.espressif.com/dl/package_esp32_index.json
  2. Open Board Manager, search for esp32 by Espressif Systems, and install the latest version.

    Installing the ESP32 core via Board Manager

3. Pick the sketch for your mode

The firmware repo contains one sketch per operating mode. Pick the one that matches what you want HealthyPi 5 to do:

Base mode (USB streaming)

Upload only the RP2040 sketch — no ESP32 needed.

BLE mode (wireless streaming)

Upload two sketches — one to each core.

Display mode

Display mode has a few extra steps because of the TFT driver and LVGL graphics library.

  1. Install the TFT_eSPI library (by Bodmer) via Manage Libraries.

    Installing TFT_eSPI library in Arduino IDE

  2. Copy User_Setup_hpi5_2.h (from the firmware repo) into your local TFT_eSPI library folder and set it as the active display profile. See TFT_eSPI’s tips section for how to switch user-setup files.

  3. In Tools → Optimize, choose “Optimize More (-O2)” or higher — LVGL needs the optimization level to be reasonable to keep up with the refresh rate.

  4. Upload the display sketch: 2_healthypi_rp2040_display.ino

4. Upload the sketch

The HealthyPi 5 uses the UF2 bootloader — uploads happen by putting the board in mass-storage mode and dropping the file. Arduino IDE handles this automatically once it sees a RPI-RP2 drive.

Complete Kit (in enclosure)
  1. Power the device off.

  2. Hold the RP2040 boot button on the side of the kit (near the SpO₂ port).

    RP2040 boot button location on the Complete Kit
    Pressing the RP2040 boot button

  3. While still holding the button, power on the device. It mounts as RPI-RP2.

    RPI-RP2 mass storage device on the host
    HealthyPi 5 in UF2 programming mode

  4. In Arduino IDE, switch the port to UF2 Board in Tools → Port.

    Selecting UF2 Board as the Arduino port

  5. Click Upload. The board resets when the upload finishes.

Basic Kit (bare board)
  1. Connect USB-C to the host computer.

  2. Hold the Bootsel button, press and release Reset while still holding Bootsel, then release Bootsel. The board enumerates as RPI-RP2.

  3. In Arduino IDE, switch the port to UF2 Board.

    UF2 Board option in Arduino Tools menu

  4. Click Upload. The board resets when the upload finishes.

Next