In this guide, you'll setup an HTTP (web) server with a Pico W running CircuitPython. HTTP servers are handy for creating custom web interfaces to monitor and control IoT projects.

This example sets a static IP address for the server, logs temperature readings from a DS18B20 temperature sensor, displays server information on an OLED and serves an HTML webpage with buttons that can send HTTP POST requests to toggle pins on the Pico W.

The HTML webpage is included in the code.py file as an f-string so that it can take in variables directly from code.py. The HTML code includes buttons that send POST requests for turning the Pico W onboard LED on and off and for displaying a party parrot animation on the OLED.

The OLED displays important information about the server. It tells you the connection status, the name of your SSID, the IP address and the current temperature reading from the DS18B20. It can also show the less important, but more fun, party parrot animation.

Since the Pico W is often affectionately referred to as the Pi-Cow, a bovine-themed 3D printed case is included for this project.

Prerequisite Guides

Parts

Angled shot of a green microcontroller with castellated pads.
The Raspberry Pi foundation changed single-board computing when they released the Raspberry Pi computer, now they're ready to...
Out of Stock
Fully Reversible Pink/Purple USB A to micro B Cable
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save seconds a day by...
$3.95
In Stock
Monochrome 1.3" OLED module with Adafruit logos falling like snow
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels,...
$19.95
In Stock
Waterproof 1-Wire DS18B20 Compatible Digital temperature sensor coiled around a US quarter and a resister above it.
This is a pre-wired and waterproofed (with heat shrink) version of a 1 Wire DS18B20 sensor. Handy for when you need to measure something far away, or in wet conditions. While the...
$9.95
In Stock
Angled shot of long, skinny prototyping breakout board.
Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new Adafruit PiCowbell Proto is finally in stock and ready to assist your
$1.95
In Stock
Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of...
$0.95
In Stock
1 x Socket Headers for Raspberry Pi Pico
2 x 20 pin Female Headers
1 x 0.1" male header
Break-away 0.1" 36-pin strip male header
1 x 220 ohm resistors
Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25 Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25
1 x Machine Screw and Stand-off Set – M2.5 Thread
Black Nylon Machine Screw and Stand-off Set – M2.5 Thread
1 x 5mm RGB Slow Blinking LED
Auto changing RGB LED
1 x M2 Brass Standoffs
M2 standoffs

This guide was first published on Nov 09, 2022. It was last updated on Apr 16, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.