OC
OceanRemote
Low-code IoT platform
← Back to Tutorials
← Previous Next →

Tutorial 07: Setting Up Raspberry Pi Pico W in Arduino IDE

📖 What You'll Learn in This Tutorial:
  • ✓ Adding Raspberry Pi Pico W support to Arduino IDE
  • ✓ Understanding the RP2040 chip and Pico W capabilities
  • ✓ Installing the required board package
  • ✓ Configuring board settings for Pico W
  • ✓ Entering BOOTSEL mode for uploading
  • ✓ Troubleshooting common Pico W issues

Introduction to the Raspberry Pi Pico W

The Raspberry Pi Pico W is the official microcontroller board from the Raspberry Pi Foundation, featuring their in-house RP2040 chip. Released in 2022, it brought WiFi capabilities to the popular Pico platform, making it an excellent choice for IoT projects.

🏆 Why Choose Pico W over ESP8266/ESP32?
Feature Pico W ESP8266 ESP32
Processor Dual-core 133 MHz Single-core 80/160 MHz Dual-core 240 MHz
RAM 264 KB 80 KB 520 KB
Flash 2 MB (external) 4 MB (external) 4-16 MB
ADC Resolution 12-bit (4 channels) 10-bit (1 channel) 12-bit (18 channels)
Price $6-8 $3-5 $8-12
Ease of Use Excellent Good Good

Pico W vs Regular Pico

  • Raspberry Pi Pico - Original version. No WiFi or Bluetooth. Requires Ethernet shield for internet.
  • Raspberry Pi Pico W - Adds WiFi (2.4 GHz 802.11n). Same form factor, same pinout. The "W" stands for Wireless.
⚠️ Important:

Make sure you have the Pico W (with WiFi), not the regular Pico. The regular Pico cannot connect to OceanRemote without additional hardware.

Step 1: Add Raspberry Pi Pico W to Arduino IDE

The Pico W uses a different core than ESP boards. Here's how to add it:

  1. Open Arduino IDE
  2. Go to File → Preferences (Windows/Linux) or Arduino IDE → Settings (Mac)
  3. In the "Additional Boards Manager URLs" field, add the Pico URL:
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

If you already have ESP8266/ESP32 URLs, separate them with commas:

https://raw.githubusercontent.com/esp8266/Arduino/master/package_esp8266com_index.json,https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
  1. Click OK
  2. Go to Tools → Board → Boards Manager
  3. Search for "pico" or "rp2040"
  4. Find "Raspberry Pi Pico/RP2040 by Earle F. Philhower" and click Install
  5. Wait for installation to complete (2-3 minutes)
💡 Alternative Core:

There's also an official "Arduino Mbed OS RP2040" core. OceanRemote works with both, but the Earle Philhower core is recommended for better compatibility and features.

Step 2: Selecting Your Board

After installation, select your board:

  1. Go to Tools → Board → Raspberry Pi RP2040 Boards
  2. Select "Raspberry Pi Pico W"
⚠️ Important:

Select "Raspberry Pi Pico W" specifically, not "Raspberry Pi Pico". The non-W version doesn't have WiFi hardware.

Step 3: Configuring Board Settings

Once you've selected your board, configure these settings:

  • Flash Size: 2MB (no FS) or 2MB (FS:1MB) - OceanRemote firmware uses about 400KB, so either works
  • CPU Speed: 133 MHz (default, stable)
  • Optimize: Small (-Os) (Standard) - Reduces code size
  • RTTI: Disabled (saves memory)
  • Stack Protection: Disabled
  • C++ Exceptions: Disabled (saves memory)
  • Debug Port: Disabled
  • Debug Level: None
  • USB Stack: Adafruit TinyUSB (recommended)
  • IP/Bluetooth Stack: IPv4 Only
  • Upload Method: Default (UF2)
  • Port: Pico W doesn't use a COM port like ESP boards. Instead, you'll put it in BOOTSEL mode (see below).
🔧 Memory Note:

The Pico W has 2MB of flash. OceanRemote firmware uses about 400KB, leaving plenty of space for future updates.

Step 4: Installing Required Libraries for Pico W

OceanRemote firmware requires these libraries for Pico W:

  1. Go to Sketch → Include Library → Manage Libraries
  2. Search for and install each library:
  • ArduinoJson by Benoit Blanchon (version 6.x) - Required for all devices
  • DHT sensor library by Adafruit - Required only if using DHT22 sensor
  • Adafruit Unified Sensor - Dependency for DHT library
  • OneWire by Jim Studt - Required only if using DS18B20 sensor
  • DallasTemperature by Miles Burton - Required only if using DS18B20 sensor
📚 Library Notes:

The Pico W core includes built-in support for WiFi and HTTP client. No additional network libraries needed.

Step 5: Entering BOOTSEL Mode (How to Upload)

The Pico W doesn't have an auto-reset circuit like ESP boards. You need to manually enter BOOTSEL mode:

  1. Disconnect the USB cable from your Pico W
  2. Press and HOLD the BOOTSEL button (white button on the board)
  3. While holding BOOTSEL, connect the USB cable to your computer
  4. Release the BOOTSEL button after 2 seconds
  5. A drive called "RPI-RP2" should appear on your computer
  6. In Arduino IDE, click Upload
  7. Arduino will compile and copy the UF2 file to the Pico W
  8. The Pico W will automatically reset and run your code
💡 Pro Tip:

You don't need to select a COM port for Pico W. The upload happens via file copy (UF2) over USB mass storage.

Step 6: Testing Your Pico W

Before flashing OceanRemote firmware, test your setup with a simple blink sketch:

// Pico W Blink Test
// The built-in LED is on pin 25 (LED_BUILTIN)

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
  Serial.println("Pico W is alive!");
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // LED ON
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);    // LED OFF
  delay(1000);
}
  1. Copy the code above into Arduino IDE
  2. Select your board (Tools → Board → Raspberry Pi RP2040 Boards → Raspberry Pi Pico W)
  3. Put your Pico W in BOOTSEL mode (hold BOOTSEL, connect USB, release)
  4. Click Verify (checkmark) to compile
  5. Click Upload (right arrow)
  6. Open Serial Monitor (Tools → Serial Monitor) at 115200 baud
  7. You should see "Pico W is alive!" and the LED blinking
⚠️ Troubleshooting Pico W Upload Issues:
  • "No board selected" - Make sure you selected "Raspberry Pi Pico W" from the board menu
  • "RPI-RP2" drive not appearing - Try a different USB cable (some are charge-only). Hold BOOTSEL longer before connecting USB.
  • Upload stuck at "Looking for drive" - Manually copy the UF2 file from the Arduino temp folder to the RPI-RP2 drive
  • Serial Monitor not working - After upload, the Pico W resets. Close and reopen Serial Monitor or press the RUN button (RST).
  • Board not recognized at all - Install the Pico W driver (Windows only). On Mac/Linux, no driver needed.

Pico W Pin Reference for OceanRemote

When generating firmware, OceanRemote uses these default pin mappings for Pico W:

Relay GPIO Pin Physical Pin #
Relay 1 GPIO16 Pin 21
Relay 2 GPIO17 Pin 22
Relay 3 GPIO18 Pin 24
Relay 4 GPIO19 Pin 25
Relay 5 GPIO20 Pin 26
Sensor (DHT/DS18B20) GPIO15 Pin 20
NTC Thermistor (ADC) GPIO26 (ADC0) Pin 31
🔌 Pico W Pin Notes:
  • GPIO16-20 - Safe for relay control, no boot constraints
  • GPIO26-28 - Analog input pins only (12-bit ADC)
  • GPIO0-1 - Used for UART (avoid if using Serial)
  • GPIO2-15 - Available for other uses
  • GPIO23-25 - Used for WiFi control (avoid using)

Pico W Special Features

  • Programmable I/O (PIO) - Can create custom interfaces (NeoPixels, SD cards, etc.)
  • 12-bit ADC - Better analog reading than ESP8266 (10-bit) and comparable to ESP32
  • Dual-core - Can run WiFi on one core, application on the other
  • USB Mass Storage - Upload code by copying UF2 files (no drivers needed)
  • Low Power - Can run on two AA batteries
💡 When to Use Pico W vs ESP32:
  • Use Pico W for: Projects needing good ADC accuracy, Python support, or official Raspberry Pi ecosystem
  • Use ESP32 for: Projects needing Bluetooth, more RAM, or lower cost per unit
  • Use ESP8266 for: Simple, low-cost projects where ADC quality isn't critical

Next Steps

Now that your Pico W is ready, continue with:

  • Tutorial 08: Installing Required Libraries (detailed)
  • Tutorial 09: Configuring Board Settings (detailed)
  • Tutorial 13: Raspberry Pi Pico W Pinout and Wiring Guide
  • Tutorial 15: Flashing Firmware to Your Device
🎯 You're Ready!

Your Raspberry Pi Pico W is now configured. Return to Tutorial 02 to generate and flash your first OceanRemote firmware!