Programming
Arduino
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
- Set up the RP2040 core in the Arduino IDE (unlocks USB streaming + display).
- Set up the ESP32 core (unlocks BLE).
- Pick a sketch that matches the mode you want — Base, BLE, or Display.
- 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.
-
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
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.
-
Open Tools → Board → Board Manager, search for Raspberry Pi Pico/RP2040 by Earle F. Philhower III, and install the latest version.
-
Once installed, the Raspberry Pi boards will appear under Tools → Board.
-
Clone or download the protocentral_healthypi_5_firmware repo and open any of the sketches inside.
-
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)
2. Set up the ESP32 core
For BLE you also need Espressif’s ESP32 core.
-
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 -
Open Board Manager, search for esp32 by Espressif Systems, and install the latest version.
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.
- RP2040 sketch:
1_healthypi_rp2040_serial_ble_stream.ino
BLE mode (wireless streaming)
Upload two sketches — one to each core.
- RP2040 sketch:
1_healthypi_rp2040_serial_ble_stream.ino - ESP32 sketch:
healthypi_esp32c3.ino
Display mode
Display mode has a few extra steps because of the TFT driver and LVGL graphics library.
-
Install the TFT_eSPI library (by Bodmer) via Manage Libraries.
-
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. -
In Tools → Optimize, choose “Optimize More (-O2)” or higher — LVGL needs the optimization level to be reasonable to keep up with the refresh rate.
-
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)
-
Power the device off.
-
Hold the RP2040 boot button on the side of the kit (near the SpO₂ port).
-
While still holding the button, power on the device. It mounts as
RPI-RP2.
-
In Arduino IDE, switch the port to UF2 Board in Tools → Port.
-
Click Upload. The board resets when the upload finishes.
Basic Kit (bare board)
-
Connect USB-C to the host computer.
-
Hold the Bootsel button, press and release Reset while still holding Bootsel, then release Bootsel. The board enumerates as
RPI-RP2. -
In Arduino IDE, switch the port to UF2 Board.
-
Click Upload. The board resets when the upload finishes.
Next
- Test your firmware by running through one of the operating modes.
- For deeper customisation, head to Programming with Zephyr — that’s where new features land first.

