PCBHub
November 24, 202543 min read 1 views

Raspberry Pi Pico W - Binary Clock / Weather Monitor : 7 Steps (with Pictures) - Instructables

pcbhub
pcbhub
Author
Raspberry Pi Pico W - Binary Clock / Weather Monitor : 7 Steps (with Pictures) - Instructables

Introduction: Raspberry Pi Pico W - Binary Clock / Weather Monitor

In this project, we’ll build a Binary Clock and Weather Monitor using the Raspberry Pi Pico W. It displays the time in binary using LEDs and also pulls the current weather data from the internet — all powered by a tiny microcontroller!

We’ll build this in two stages:

  1. Breadboard Prototype – testing the binary clock and weather display using an OLED screen and LEDs.
  2. Custom PCB + 3D Printed Case – taking the prototype and turning it into a clean, final build.

To get time and weather information, we’ll use the WorldTime API and OpenWeather API, which the Pico W will access over Wi-Fi.

By the end, you'll have a working IoT desk clock that shows time in binary and live weather info — and a professional-looking PCB version you can proudly display!

Supplies

Parts List

Electronics

  1. Raspberry Pi Pico W — 1
  2. Micro USB Cable — 1
  3. SSD1306 OLED Display — 1

LED & Resistors

  1. Red LEDs — 8
  2. Blue LEDs — 5
  3. 330Ω Resistors — 8
  4. 1kΩ Resistors — 5

Prototyping

  1. Breadboard — 1
  2. Jumper Wires — Several

Step 1: Schematic Diagram

Article visual

The Fritzing diagram above shows the wiring layout. Since space on the breadboard is limited, we will only display the hours and minutes in binary for this prototype.

⚠️ Important: When connecting the OLED display, double-check the pin order. Some SSD1306 modules have the VCC and GND pins reversed, so verifying the labels on your specific module will prevent damage to the display or the Pico.

Step 2: Prototype

Article visual

Before building the final PCB version, we first create a working prototype on a breadboard. This lets us test the Raspberry Pi Pico W, the LEDs, buttons, and OLED display, and make sure the code connects to Wi-Fi and updates the time and weather correctly. Once everything is working here, we'll move on to the custom PCB and enclosure.

Step 3: Code

You’ll need four files for this project:

  1. config.json – Stores your private information such as Wi-Fi credentials, API key, and your city and country code.
  2. ssd1306.py – Library used for controlling the SSD1306 OLED display.
  3. urequests.py – Enables the Pico W to connect to the internet and retrieve data via API requests.
  4. main.py – The main program that runs automatically when the Pico is powered on.


You can download all the files using the link below, or copy the code directly from this page. Code


🛠 Setting Up Your config.json

Before running the clock, you need to tell your Raspberry Pi Pico W three things:

Your Wi-Fi name

Your Wi-Fi password

Your API keys (for time & weather updates)


This information goes inside a file called config.json.

Create it in the same folder as your Python script, then copy-paste & edit this template:


{

"ssid": "YOUR_WIFI_NAME",

"ssid_password": "YOUR_WIFI_PASSWORD",


"weather_api_key": "YOUR_OPENWEATHER_API_KEY",

"city": "YOUR_CITY",

"country_code": "YOUR_COUNTRY_CODE",


"date_time_api": "YOUR_IPGEOLOCATION_API_KEY",

"time_zone": "Your/TimeZone"

}


📌 What Each Field Means

ssid - Your Wi-Fi network name

ssid_password- Your Wi-Fi password

weather_api_key - API key from OpenWeatherMap (used to get current weather)

city - Your city name (exact spelling)

country_code - 2-letter country code (e.g., US, CN, UK)

date_time_api - API key from ipgeolocation.io (used to set real-time clock)

time_zone - Your local timezone (Example: Asia/Shanghai, America/New_York)


🌤 Getting Your Free API Keys

1️⃣ OpenWeather API Key

Sign up here (free):

Copy your API key into weather_api_key.


2️⃣ Time & Time-Zone API Key

Sign up here:

🔗 https://ipgeolocation.io/signup.html

Copy your key into date_time_api.

Step 4: PCB Design - JLCPCB

Article visual

The PCB was designed using EasyEDA, a free and user-friendly web-based tool that supports circuit design, simulation, and PCB layout. I like the look of having the electronics exposed, so I have placed the resistors on the top face of the PCB.

This design includes several key features:

  1. Two Push Buttons: These two push buttons will be used to display different data on the OLED display
  2. Mounting Holes: The PCB is equipped with four 3mm mounting holes, making it easy to secure within an enclosure.
  3. Power input Terminal: This will allow to connect 5V through DC plug or calbe depending on your needs.

The PCB was ordered through JLCPCB. They offer great PCBs at a low cost and have promotions and coupons available throughout the year. You can sign up using here, or using the following link:

https://jlcpcb.com/?from=Nerd that will support me as a creator to keep making content that is accessible and open source at no charge to you.

Step 5: Enclosure Design

Article visual

This enclosure was created in Fusion 360 and is designed to display the PCB at an ideal viewing angle.

Download STL file here: download.

Step 6: YouTube Video

If you made it this far and would like to see a video of this project you can watch the video above.

Step 7: Conclusion

This project has successfully demonstrated how a compact design using the Raspberry Pi Pico W, a simple LED array, an SSD1306 OLED screen, and cloud-based weather and time APIs can deliver both a binary-style time display and live local weather data.


Next Version: Planning the WS2812B Upgrade

Looking ahead, the next iteration will replace the static single-colour LEDs with addressable WS2812B strips or LEDs. Here are some of the improvements planned:

  1. Color & animation: With WS2812B LEDs, each “bit” of the binary time display can be coloured and animated (e.g., a fade-in/fade-out when the bit changes) to make the display more dynamic and visually engaging.
  2. Simplified wiring: Addressable LEDs require only one data line (plus power and ground) for many LEDs, simplifying the PCB layout and wiring compared to individual LED pins.
  3. Expanded weather visualisation: Colour coding or animations could represent weather states (e.g., blue fade for rain/humidity, yellow for sunshine, red for higher temperature) to go beyond raw numeric display.
  4. Refined case design: With the visual emphasis shifting to the LED panel, the enclosure can be redesigned in Fusion 360 to showcase the LED panel prominently, perhaps with diffused acrylic for smooth light diffusion.

Enjoyed this article?

Support the author by leaving a like.