OC
OceanRemote
Low-code IoT platform
← Back to Tutorials
← Previous Next β†’

Tutorial 13: Raspberry Pi Pico W - Pinout and Wiring

πŸ“– What You'll Learn in This Tutorial:
  • βœ“ Understanding Raspberry Pi Pico W pinout
  • βœ“ Pico W vs ESP8266/ESP32 differences
  • βœ“ Wiring relays to Pico W (safe GPIO selection)
  • βœ“ Connecting DHT22, DS18B20, and NTC sensors
  • βœ“ Pico W power requirements and BOOTSEL mode

Raspberry Pi Pico W Overview

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 added WiFi capabilities (hence the "W") to the popular Pico platform, making it an excellent choice for IoT projects.

πŸ“Š Pico W vs ESP32 vs ESP8266:
Feature Pico W ESP32 ESP8266
Processor Dual-core 133 MHz Dual-core 240 MHz Single-core 80/160 MHz
RAM 264 KB 520 KB 80 KB
Flash 2 MB 4-16 MB 4 MB
ADC Resolution 12-bit (4 channels) 12-bit (18 channels) 10-bit (1 channel)
Operating Voltage 3.3V 3.3V 3.3V
Programming Arduino / MicroPython Arduino Arduino
Price $6-8 $8-12 $3-5

Pico W Pinout Diagram

                    Raspberry Pi Pico W Pinout
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚                                                             β”‚
            β”‚  GP0   ────┐  β”Œβ”€β”€β”€β”€  VBUS         β”Œβ”€β”€β”€β”                     β”‚
            β”‚  GP1   ─────  β”œβ”€β”€β”€β”€  VSYS         β”‚USBβ”‚                     β”‚
            β”‚  GND   ─────  β”œβ”€β”€β”€β”€  GND          β””β”€β”€β”€β”˜                     β”‚
            β”‚  GP2   ─────  β”œβ”€β”€β”€β”€  EN           β”Œβ”€β”€β”€β”€β”€β”                   β”‚
            β”‚  GP3   ─────  β”œβ”€β”€β”€β”€  GP26/A0      β”‚     β”‚                   β”‚
            β”‚  GP4   ─────  β”œβ”€β”€β”€β”€  GP27/A1      β”‚LED  β”‚                   β”‚
            β”‚  GP5   ─────  β”œβ”€β”€β”€β”€  GP28/A2      β”‚     β”‚                   β”‚
            β”‚  GND   ─────  β”œβ”€β”€β”€β”€  ADC_GND      β””β”€β”€β”€β”€β”€β”˜                   β”‚
            β”‚  GP6   ─────  β”œβ”€β”€β”€β”€  GP22         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
            β”‚  GP7   ─────  β”œβ”€β”€β”€β”€  GP21         β”‚   WiFi Antenna      β”‚   β”‚
            β”‚  GP8   ─────  β”œβ”€β”€β”€β”€  GP20         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
            β”‚  GP9   ─────  β”œβ”€β”€β”€β”€  GP19                                   β”‚
            β”‚  GND   ─────  β”œβ”€β”€β”€β”€  GP18                                   β”‚
            β”‚  GP10  ─────  β”œβ”€β”€β”€β”€  GP17                                   β”‚
            β”‚  GP11  ─────  β”œβ”€β”€β”€β”€  GP16                                   β”‚
            β”‚  GP12  ─────  β”œβ”€β”€β”€β”€  GP15                                   β”‚
            β”‚  GP13  ─────  β”œβ”€β”€β”€β”€  GP14                                   β”‚
            β”‚  GND   β”€β”€β”€β”€β”˜  └────  GP14                                   β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pico W Pin Functions

Pin Function OceanRemote Use Notes
GP0-GP15 Digital I/O Available for expansion 3.3V logic
GP16 Digital I/O Relay 1 βœ… Safe for relays
GP17 Digital I/O Relay 2 βœ… Safe for relays
GP18 Digital I/O Relay 3 βœ… Safe for relays
GP19 Digital I/O Relay 4 βœ… Safe for relays
GP20 Digital I/O Relay 5 βœ… Safe for relays
GP21 Digital I/O Not used Available for expansion
GP22 Digital I/O Not used Available for expansion
GP26 (A0) Analog Input (ADC0) NTC Thermistor 12-bit ADC, 0-3.3V
GP27 (A1) Analog Input (ADC1) Not used Available for expansion
GP28 (A2) Analog Input (ADC2) Not used Available for expansion
πŸ”Œ Pico W Power Pins:
  • VBUS - 5V from USB (when connected to computer)
  • VSYS - 1.8-5.5V input (main power supply)
  • 3V3 - 3.3V output (max 300mA)
  • GND - Ground (multiple pins available)
  • ADC_GND - Dedicated ground for analog inputs
⚠️ Important Pico W Pin Notes:
  • GP0-1 - Used for Serial communication (avoid if using Serial Monitor)
  • GP2-15 - All safe for digital I/O, no boot constraints like ESP8266
  • GP16-22 - All safe for digital I/O
  • GP23-25 - Used for WiFi control (do NOT use)
  • GP26-28 - Analog input only (cannot output signals)
  • GP29 - Used for VSYS measurement (do NOT use)

OceanRemote Default Pin Assignments for Pico W

OceanRemote firmware uses these GPIO pins for relays and sensors (all safe choices):

Component GPIO Physical Pin Notes
Relay 1 GP16 Pin 21 βœ… Safe
Relay 2 GP17 Pin 22 βœ… Safe
Relay 3 GP18 Pin 24 βœ… Safe
Relay 4 GP19 Pin 25 βœ… Safe
Relay 5 GP20 Pin 26 βœ… Safe
Sensor (DHT/DS18B20) GP15 Pin 20 βœ… Safe
NTC Thermistor GP26 (ADC0) Pin 31 12-bit analog input
Built-in LED GP25 N/A Controlled by WiFi stack
πŸ’‘ Pico W Advantage:

The Pico W has no boot pin constraints like ESP8266. All GPIO pins (except GP0-1 for Serial and GP23-25 for WiFi) can be safely used for relays without worrying about boot issues.

Wiring Relays to Pico W

Here's how to connect 5 relay channels to your Pico W:

Relay Pico W GPIO Physical Pin # Relay Module Connection
Relay 1 GP16 Pin 21 IN1 β†’ GP16, VCC β†’ 5V, GND β†’ GND
Relay 2 GP17 Pin 22 IN2 β†’ GP17, VCC β†’ 5V, GND β†’ GND
Relay 3 GP18 Pin 24 IN3 β†’ GP18, VCC β†’ 5V, GND β†’ GND
Relay 4 GP19 Pin 25 IN4 β†’ GP19, VCC β†’ 5V, GND β†’ GND
Relay 5 GP20 Pin 26 IN5 β†’ GP20, VCC β†’ 5V, GND β†’ GND
⚠️ Important:

Relay modules typically need 5V power. Connect relay VCC to VBUS (5V from USB) or an external 5V supply. Do NOT connect to 3.3V - relays won't work reliably.

Wiring Sensors to Pico W

DHT22 Temperature & Humidity Sensor

DHT22 Pin Connect to Pico W
VCC 3.3V or VBUS (5V)
DATA GP15 (Pin 20)
GND GND
DHT22 Wiring (Pico W):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Pico W  β”‚                    β”‚  DHT22   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   3.3V  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ VCC (1)  β”‚
β”‚   GP15  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ DATA (2) β”‚
β”‚   GND   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ GND (4)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

DS18B20 Digital Temperature Sensor

DS18B20 Pin Connect to Pico W
VDD 3.3V
DATA GP15 (Pin 20) + 4.7kΞ© pull-up to 3.3V
GND GND
⚠️ DS18B20 Pull-up Resistor Required!

A 4.7kΞ© resistor must be connected between DATA (GP15) and 3.3V. Without it, readings will fail.

DS18B20 Wiring with Pull-up (Pico W):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Pico W  β”‚                    β”‚ DS18B20  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€                    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   3.3V  β”œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ VDD (3)  β”‚
β”‚         β”‚    β”‚               β”‚          β”‚
β”‚   GP15  β”œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ DATA (2) β”‚
β”‚         β”‚    β”‚    4.7kΞ©      β”‚          β”‚
β”‚   GND   β”œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€[====]────── GND (1)  β”‚
β”‚         β”‚    β”‚               β”‚          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

NTC 10kΞ© Thermistor (Analog)

NTC Thermistor Voltage Divider (Pico W):
         3.3V
          β”‚
          β–Ό
        β”Œβ”€β”€β”€β”
        β”‚NTCβ”‚  ← 10kΞ© NTC (resistance changes with temperature)
        β””β”€β”€β”€β”˜
          β”‚
          β”œβ”€β”€β”€β”€β”€β”€β–Ί GP26 (ADC0) Pin 31  ← Voltage measured here (12-bit)
          β”‚
        β”Œβ”€β”€β”€β”
        β”‚10kβ”‚  ← Fixed 10kΞ© resistor (R_series)
        β”‚Ξ©  β”‚
        β””β”€β”€β”€β”˜
          β”‚
         GND
πŸ“Š Pico W ADC Notes:

The Pico W has 12-bit ADC (0-4095) on GP26, GP27, and GP28. This gives much better precision than ESP8266 (10-bit) and is comparable to ESP32. Use GP26 for the NTC thermistor in OceanRemote firmware.

Complete Wiring Diagram

                    COMPLETE PICO W WIRING
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚                                                             β”‚
            β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
            β”‚  β”‚ Pico W  β”‚      β”‚       5-Channel Relay Module        β”‚  β”‚
            β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€      β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
            β”‚  β”‚   USB   β”‚      β”‚  IN1 β”‚ GP16 (Pin 21)                β”‚  β”‚
            β”‚  β”‚  VBUS   β”œβ”€β”€β”€β”€β”€β”€β”€  IN2 β”‚ GP17 (Pin 22)                β”‚  β”‚
            β”‚  β”‚   GND   β”œβ”€β”€β”€β”€β”€β”€β”€  IN3 β”‚ GP18 (Pin 24)                β”‚  β”‚
            β”‚  β”‚   3.3V  β”œβ”€β”€β”€β”  β”‚  IN4 β”‚ GP19 (Pin 25)                β”‚  β”‚
            β”‚  β”‚   GP16  β”œβ”€β”€β”€β”€  β”‚  IN5 β”‚ GP20 (Pin 26)                β”‚  β”‚
            β”‚  β”‚   GP17  β”œβ”€β”€β”€β”€  β”‚  VCC β”‚ VBUS (5V)                    β”‚  β”‚
            β”‚  β”‚   GP18  β”œβ”€β”€β”€β”€  β”‚  GND β”‚ GND                           β”‚  β”‚
            β”‚  β”‚   GP19  β”œβ”€β”€β”€β”€  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
            β”‚  β”‚   GP20  β”œβ”€β”€β”€β”˜                                           β”‚
            β”‚  β”‚   GP15  β”œβ”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
            β”‚  β”‚   GP26  β”œβ”€β”€β”€β”€β”€β”€    β”‚        DHT22 Sensor         β”‚     β”‚
            β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€     β”‚
            β”‚                  └───── DATA β”‚ GP15                 β”‚     β”‚
            β”‚                       β”‚ VCC  β”‚ 3.3V                 β”‚     β”‚
            β”‚                       β”‚ GND  β”‚ GND                  β”‚     β”‚
            β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
            β”‚                                                           β”‚
            β”‚                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
            β”‚                  β”‚     NTC Thermistor          β”‚         β”‚
            β”‚                  β”‚  (Between 3.3V and GP26)    β”‚         β”‚
            β”‚                  β”‚  + 10kΞ© to GND              β”‚         β”‚
            β”‚                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Pico W Power Supply

USB Power (Recommended)

  • Connect via USB-C cable to computer or phone charger
  • Provides 5V on VBUS pin for relays
  • Pico W draws ~100mA with WiFi active
  • Phone charger (5V, 1A+) works well with relays

External Power (For Permanent Installation)

  • Connect 1.8-5.5V to VSYS pin
  • Or use VBUS for 5V (when powered externally)
  • Relays must be powered separately if using batteries
  • Total current: ~100mA (Pico W) + 70mA per active relay
⚠️ Power Warning:

The Pico W's 3.3V pin can only provide up to 300mA. Do NOT power relays from 3.3V! Use VBUS (5V from USB) or an external 5V supply for relay modules.

Uploading Code to Pico W (BOOTSEL Mode)

The Pico W uses a unique upload method:

  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, select Tools β†’ Board β†’ Raspberry Pi RP2040 Boards β†’ Raspberry Pi Pico W
  7. Select Tools β†’ Port β†’ (no port needed, UF2 upload)
  8. Click Upload - Arduino will compile and copy the UF2 file to the Pico W
  9. 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. After first upload, you may need to press the RUN button to restart.

Troubleshooting Pico W

Device Not Recognized / No "RPI-RP2" Drive

  • Try a different USB cable (many are charge-only)
  • Hold BOOTSEL button longer (5 seconds) before connecting USB
  • Try a different USB port
  • Press the RUN button after connecting

Upload Fails / Stuck at "Looking for drive"

  • Manually copy the UF2 file from Arduino temp folder to RPI-RP2 drive
  • Ensure you selected "Raspberry Pi Pico W" (not regular Pico)
  • Check that the board is in BOOTSEL mode (white LED flashing)

Serial Monitor Not Working

  • Close and reopen Serial Monitor after upload
  • Press the RUN button on the Pico W
  • Check baud rate (115200)
  • Ensure you're not using GP0/GP1 for other purposes

Relays Not Responding

  • Verify relay VCC is connected to VBUS (5V) or external 5V
  • Check relay logic (Positive vs Negative) in dashboard settings
  • Test GPIO pin with a simple blink sketch before connecting relay
  • Ensure you're not using analog-only pins (GP26-28) for relays
πŸ”§ Pico W vs Pico:

The regular Pico (without W) does NOT have WiFi. OceanRemote only works with the Pico W. The boards look identical - check for "W" on the metal shield or the WiFi antenna component.

Pico W Special Features

  • Programmable I/O (PIO) - Can create custom interfaces (NeoPixels, SD cards, etc.)
  • 12-bit ADC - Better analog reading than ESP8266, 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 for extended periods
πŸ’‘ When to Choose Pico W:
  • Choose Pico W for: Python programming (MicroPython), better ADC accuracy, official Raspberry Pi ecosystem
  • Choose ESP32 for: Bluetooth, more RAM, larger flash, more GPIO pins
  • Choose ESP8266 for: Lower cost, smaller size, simpler projects

Next Steps

Now that you understand Pico W wiring, continue with:

  • Tutorial 14: Raspberry Pi 4 / Zero 2W Setup Guide
  • Tutorial 15: Flashing Firmware to Your Device
  • Tutorial 16-20: Working with sensors (DHT22, DS18B20, NTC)
  • Return to Tutorial 02: Generate and flash your firmware!
🎯 You're Ready!

Your Raspberry Pi Pico W is now properly wired. You can now generate firmware from the OceanRemote dashboard and flash your device!