- β 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.
| 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 |
- 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
- 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 |
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 |
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 |
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
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
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:
- Disconnect the USB cable from your Pico W
- Press and HOLD the BOOTSEL button (white button on the board)
- While holding BOOTSEL, connect the USB cable to your computer
- Release the BOOTSEL button after 2 seconds
- A drive called "RPI-RP2" should appear on your computer
- In Arduino IDE, select Tools β Board β Raspberry Pi RP2040 Boards β Raspberry Pi Pico W
- Select Tools β Port β (no port needed, UF2 upload)
- Click Upload - Arduino will compile and copy the UF2 file to the Pico W
- The Pico W will automatically reset and run your code
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
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
- 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!
Your Raspberry Pi Pico W is now properly wired. You can now generate firmware from the OceanRemote dashboard and flash your device!