Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

You can control a Raspberry Pi Pico W output from a browser by connecting the board to Wi-Fi, running an Arduino-Pico WebServer, and having a route handler set the GPIO state. Open the board’s local IP address from a device on the same network. The wireless steps below require a Pico W or another Wi-Fi-capable board; the standard Raspberry Pi Pico does not have onboard Wi-Fi.

What you need before you start

  • A Raspberry Pi Pico W or another Wi-Fi-capable board supported by the Arduino-Pico core.
  • Arduino IDE with the Arduino-Pico core installed.
  • The name and password for the Wi-Fi network the board will join.
  • A GPIO output to control. The example uses the board LED; external loads need appropriate driver circuitry and wiring.

The Arduino-Pico project documents support for Pico W and other RP2040- and RP2350-based boards. Its Boards Manager installation process is sufficient for ordinary board programming. See the Arduino-Pico installation guide and supported-board project documentation.

Install Arduino-Pico and select your board

  1. In Arduino IDE, open Preferences and add the Arduino-Pico package index URL specified in the installation guide.
  2. Open Boards Manager, find the Raspberry Pi Pico/RP2040/RP2350 Arduino core, and install it.
  3. From the board selector, choose the board that matches your hardware. For the onboard Wi-Fi method in this guide, select Pico W rather than the standard Pico.

Board names and menu placement can vary by Arduino IDE version. Confirm that the selected board is the actual model you connected before compiling or uploading.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Connect the Pico W to Wi-Fi and find its IP address

The Arduino-Pico HelloServer example uses station mode: the Pico joins an existing Wi-Fi network, waits for a successful connection, and prints its local IP address. Replace the example network credentials with yours, then upload the sketch.

#1 Best Overall
Pico 2 W with Color Soldered Header Compatible with Raspberry Pi Pico 2 W
  • RPi Pico 2 W Microcontroller Board (pre-soldered header (color-coded)), Based on Official RP2350 Chip, Dual-core & Dual-architecture Design. Upgraded hardware from Pico 2 with wireless communication, onboard antenna, features 2.4GHz 802.11n WIFI and Bluetooth 5.2.
  • Adopts unique dual-core and dual-architecture design: dual-core Arm Cortex-M33 processor and dual-core Hazard3 RISC-V processor, flexible clock running up to 150 MHz.
  • Onboard Infineon CYW43439 wireless chip, supports WIFI 4 wireless and Bluetooth 5.2.
  • 520KB of SRAM, and 4MB of on-board Flash memory.
  • Castellated module allows soldering direct to carrier boards. USB 1.1 with device and host support. Low-power sleep and dormant modes. Drag-and-drop programming using mass storage over USB.
#include <WiFi.h>
#include <WebServer.h>

const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";

WebServer server(80);

void setup() {
  Serial.begin(115200);

  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }

  Serial.println(WiFi.localIP());
}

void loop() {
  server.handleClient();
}

Open the IDE’s Serial Monitor at 115200 baud after uploading. The address printed by WiFi.localIP() is the one to enter in a browser on a device connected to the same local network. The snippet shows the connection pattern; a complete sketch must also configure the output, register routes, and start the server.

Make a web route change an output

A route handler connects a requested URL to an action in the sketch. Configure the output pin before using it, register a route with server.on(), send a response with server.send(), and start the HTTP server with server.begin(). Call server.handleClient() repeatedly in loop() so incoming requests are serviced.

Rank #2
SunFounder Raspberry Pi Pico W Ultimate Starter Kit with Online Tutorials, RoHS Compliant, 450+ Items, 117 Projects, MicroPython, C/C++ (Compatible with Arduino IDE)
  • IoT Starter Kit for Beginners: The SunFounder Raspberry Pi Pico W Ultimate Starter Kit offers a rich IoT learning experience for beginners aged 8+. With 450+ components, 117 projects, and expert-led video lessons, this kit makes learning microcontroller programming and IoT engaging and accessible, RoHS Compliant
  • Expert-Guided Video Lessons: This kit includes 27 video tutorials by the renowned educator, Paul McWhorter. His engaging style simplifies complex concepts, ensuring an effective learning experience in microcontroller programming
  • Wide Range of Hardware: The kit includes a diverse array of components like sensors, actuators, LEDs, LCDs, and more, enabling you to experiment and create a variety of projects with the Raspberry Pi Pico W
  • Supports Multiple Languages: The kit offers versatility with support for three programming languages - MicroPython, C/C++, and Piper Make, providing a diverse programming learning experience
  • Dedicated Support: Benefit from our ongoing assistance, including a community forum and timely technical help for a seamless learning experience
const int outputPin = LED_BUILTIN;

void turnOn() {
  digitalWrite(outputPin, HIGH);
  server.send(200, "text/plain", "Output is on");
}

void turnOff() {
  digitalWrite(outputPin, LOW);
  server.send(200, "text/plain", "Output is off");
}

// In setup(), after Wi-Fi connects:
pinMode(outputPin, OUTPUT);
server.on("/on", turnOn);
server.on("/off", turnOff);
server.begin();

Merge the route registration and startup lines into setup(), and keep the request-servicing call in loop(). With the server running, request http://<Pico-IP>/on or http://<Pico-IP>/off, replacing <Pico-IP> with the address printed in Serial Monitor. These routes set a known state, so repeating a request does not toggle unpredictably. For a page with clickable controls, a handler can instead return HTML containing links or buttons that request the corresponding routes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The pattern follows the Arduino-Pico project’s HelloServer example and AdvancedWebServer example, which demonstrate Wi-Fi, HTTP routing, output setup, server startup, and request handling.

Rank #3
EC Buying Pi Pico W Dual-core Arm Cortex-M0+ 133MHz RPI Pico W Built-in WiFi,Supports 2.4/5 GHZ Wi-Fi 2MB BLE
  • With a large on-chip memory, symmetric dual-core processor complex, deterministic bus fabric, and rich peripheral set augmented with our unique Programmable I/O (PIO) subsystem, RP2040 provides professional users with unrivalled power and flexibility
  • RP2040 is manufactured on a modern 40nm process node, delivering high performance,low dynamic power consumption, and low leakage, with a variety of low-power modes tosupport extended-duration operation on battery power
  • Pi Pico W offers 2.4GHz 802.11 b/g/n wireless LAN support and Bluetooth5.2, with an on-board antenna, and modular compliance certification. It is able to operatein both station and access point modes. Full access to network functionality is available to both C and MicroPython developers
  • Pi Pico W pairs RP2040 with 2MB of flash memory, and a power supply chip supporting input voltages from 1.8 -5.5V. It provides 26 GPIO pins, three of which can function as analogue inputs, on 0.1"-pitch through-hole pads with castellated edges
  • A polished MicroPython port, and a UF2 bootloader inROM, it has the lowest possible barrier to entry for beginner and hobbyist users; Pi Pico W is available as an individual unit, or in 480-unit reels for automated assembly

Test the browser control on your local network

  1. Upload the complete sketch and open Serial Monitor. Wait for the Pico W to connect and print an IP address.
  2. Confirm the computer or phone you will use is connected to the same local network as the Pico W.
  3. Enter the printed address followed by /on in the browser. The output should turn on and the browser should show the handler’s response.
  4. Request /off to set the output low.

This is local-network control, not a claim that the board is reachable over the public internet. The documented example prints a local address and starts an HTTP server; it does not establish remote-internet access.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use access-point mode for a direct connection

If you do not want the Pico to join an existing Wi-Fi network, the Arduino-Pico project also demonstrates access-point mode using WIFI_AP, WiFi.softAPConfig(), WiFi.softAP(), and a WebServer. In station mode, the board joins the LAN and the browser reaches it through that network. In access-point mode, the board creates a network for the phone or computer to join directly. Choose based on how the browser device should reach the Pico and whether the project needs to interact with other devices on the LAN; the examples do not establish comparative security or performance results.

Rank #4
Freenove Raspberry Pi Pico W Board Pre-Soldered Header, Dual-core Arm Cortex-M0+ Microcontroller, Development Board, Python C Java Code, Tutorial Example Projects
  • Raspberry Pi Pico W: A tiny, fast, and versatile board built using dual-core Arm Cortex-M0+ processor with wireless LAN and Bluetooth (Comes with pinout card and stickers)
  • Detailed Tutorial: Provides step-by-step guide with MicroPython, C and Processing (Java) Code (The download link can be found on the product box) (No paper tutorial)
  • Example Projects: Each project has schematics, wiring diagrams, complete code and detailed explanations (Need extra items)
  • Easy to Use: Just connect the board to your computer (installed IDE) with the USB cable to program it
  • Get Support: Our technical support team is always ready to answer your questions

See the project’s DNSServer examples for the access-point pattern. It is an alternative network design, not a prerequisite for the station-mode approach above.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use GPIO safely with external equipment

The built-in LED is a simple way to verify that requests reach the sketch. For an external output, choose a GPIO supported by your board and configure it as OUTPUT before calling digitalWrite(). Check the board’s authoritative electrical specifications and use suitable driver circuitry for anything beyond a small indicator. The cited examples establish GPIO output use, but do not provide enough information to prescribe a universal current rating, resistor value, or driver component.

Troubleshoot connection and route problems

  • No IP address appears: Check the SSID and password, ensure the board is the Pico W or another Wi-Fi-capable model, and wait for WL_CONNECTED before reading WiFi.localIP().
  • The browser cannot reach the board: Check that the browser device and Pico are on the same network, use the current IP printed after connection, and confirm the sketch calls server.begin() and server.handleClient().
  • The page loads but the output does not change: Verify that the route path matches the requested URL, the handler is registered, and the pin is configured as an output before the route is used.
  • The selected pin does not behave as expected: Check the board’s pin mapping and wiring for the selected board. Do not assume that every Pico-family board has identical onboard output wiring.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.