Weatherface
~16 m
A Raspberry Pi Pico W with a Pimoroni 1.14" LCD and four buttons. It draws a face from the room temperature, read by an Adafruit SPA06-003 sensor, and from a weather forecast fetched over Wi-Fi.
Okay so. Hear me out. π
We’re going to build a tiny gadget with a face that has feelings about the weather. Cold? It shivers. Boiling? It melts. Rain tomorrow? It’s already sulking about it.
And here’s the twist: you write the code. Not me. Not a copy-paste from the internet. You. With an AI as your lab partner, not your ghost-writer.
By the end you’ll have:
- driven a colour screen pixel by pixel
- read a real physical sensor over a real data bus
- pulled live weather from the internet for your postcode
- turned boring numbers into a face anyone gets in half a second
That last one is called data visualisation and it’s literally a job. Let’s go. π
Your kit
| Thing | What it does |
|---|---|
| Raspberry Pi Pico W | The brain. A tiny microcontroller with Wi-Fi |
| Pimoroni Pico Display Pack | 1.14" colour screen, 240 Γ 135 pixels, four buttons (A, B, X, Y) and an RGB LED |
| Pimoroni Pico Omnibus | The “motherboard”. Holds the Pico plus two add-on boards side by side |
| Adafruit SPA06-003 | Temperature (and air pressure!) sensor |
| 4 jumper wires, or a STEMMA QT-to-jumper cable | Connects the sensor |
| Micro-USB data cable | Power + code. Must be a data cable (more on this, it matters) |
| Fedora laptop with Thonny | Already installed and tested for you |
Setup β plug in and get a “hello” π
Every project has a boring bit. This is it. Do it carefully and the rest is fun.
1. Build the stack
- Look at the Pico Omnibus. It has a socket in the middle for the Pico and two “decks” either side for add-on boards.
- Push the Pico W into the middle socket. The pin labels printed on the Omnibus show which way round β the USB port on the Pico should line up with the USB outline printed on the board. Wrong way round = sad Pico.
- Push the Display Pack into one of the decks. It also has a USB outline printed on it: point it the same way as the Pico’s USB port.
- Leave the other deck empty. That’s where the sensor wires go in Step 4.
Press everything down firmly and evenly. Wobbly pins cause ghost bugs that waste whole afternoons.
2. Plug it in
Micro-USB end into the Pico, USB-A end into the laptop. That’s it. The Display Pack might stay dark for now β that’s fine, nothing has told it to light up yet.
3. Talk to it in Thonny
- Open Thonny.
- Bottom-right corner, click the interpreter name and choose
MicroPython (Raspberry Pi Pico). If there’s a choice of port, pick the
one that says
/dev/ttyACM0(or similar). - The Shell panel at the bottom should show
>>>. That’s the Pico talking to you live. Wild. - Type
print("hello")and press Enter. If it sayshelloback: you’re in. π
Now check you’ve got the right firmware. Type import picographics and press
Enter. No error? Perfect β you have Pimoroni’s MicroPython, which includes
the display and button libraries. ImportError? Jump to the debug list
below.
4. When it doesn’t work (it happens to everyone)
Work down this list. Stop when it’s fixed. Real engineers debug in order, cheapest check first.
- Swap the cable. Seriously, this is the #1 problem. Loads of micro-USB cables are charge-only β no data wires inside. If the laptop doesn’t notice the Pico at all, try a different cable before anything else.
- Is Linux seeing it? Open a terminal and type
lsusb. Look for a line with2e8ain it β that’s Raspberry Pi’s ID. Nothing? Cable or socket problem. Try another USB port. - Watch it plug in live. Run
sudo journalctl -k -f, then unplug and replug the Pico. You should see messages scroll past ending in something likettyACM0. Press Ctrl+C to stop watching. - Permission denied? Type
groups. If you don’t seedialout, ask whoever set up the laptop to runsudo usermod -aG dialout $USER, then log out and back in. - Thonny says “device is busy” or won’t connect? Close any other program that might be using the port (another Thonny window, a serial monitor). Then click the red Stop button in Thonny.
- Pico seems frozen? If old code is stuck in a loop, click into the Shell and press Ctrl+C a couple of times, then Stop.
ImportErroronpicographics, or nothing works at all? Reflash the firmware:- Unplug the Pico.
- Hold the little white BOOTSEL button on the Pico and plug it back in.
- Let go. A USB drive called
RPI-RP2appears in the file manager. - Download the Pico W build from
Pimoroni’s MicroPython releases
(the file ends in
.uf2) and drag it onto that drive. - The drive vanishes, the Pico reboots. Back to step 3 of Setup.
- Still stuck? Copy the exact error message and ask an AI (see the next section for how to ask well). Or ask a human. Both are allowed. Both are smart.
Quick screen test: Pimoroni have a set of Display Pack examples . Open one in Thonny, hit the green Run button and watch the screen light up. If it does, your hardware is 100% working and every bug from now on is in your code. That’s actually great news.
Step 1 β Two sets of eyes ποΈποΈ
Goal: draw two different pairs of eyes. Press a button, the eyes swap.
This step is less about code and more about how you work with an AI, because that skill is going to matter for literally everything you do from now on.
The golden rules of asking an AI for help
Rule 1: Give it context. The AI can’t see your desk. Tell it:
- your hardware: Pico W, Pimoroni Pico Display Pack (240 Γ 135, buttons A B X Y)
- your software: Pimoroni MicroPython firmware, the
picographicslibrary, Thonny - what you already have working
Rule 2: Ask for explanations, not code. You’re here to learn, so ask things like:
- “Explain how I could store a small pixel-art image in MicroPython and draw it scaled up on a 240 Γ 135 screen. Don’t write the code β describe the steps.”
- “What’s the difference between reading a button once and detecting a button press? Give me a hint, not the answer.”
- “What are three ways I could represent an eye as data? What are the pros and cons of each?”
Rule 3: Make it ask you questions. Try: “I’m trying to draw two sets of eyes and swap them with a button. Ask me questions one at a time to help me plan it.” This is like having a tutor who never gets bored.
Rule 4: When it breaks, paste the exact error. Not “it doesn’t work”. The real red text, plus the line it points at. Ask “what does this error mean?” before “fix it”.
Rule 5: Trust, but verify. AIs sometimes invent library functions that
don’t exist. π If it suggests something from picographics or pimoroni,
check it against the
Pimoroni examples
or the
PicoGraphics docs
.
If it’s not there, it’s probably made up.
Rule 6: One change at a time. Change one thing, run it, see what happened. Changing five things at once means you’ll never know which one broke it.
Hints for this step
- Design your eyes on paper first. Graph paper or a free pixel-art site. Keep them small β something like 16 Γ 16 pixels β and scale them up when you draw. The Pico only has a little bit of memory.
- Two moods to start: maybe happy (big round eyes) and grumpy (flat, half-closed). You’ll add more later, so make them easy to swap.
- A bitmap can just be a list of strings, where one character means “pixel on” and another means “pixel off”. Ask your AI how you’d loop over that and draw a little square for each “on” pixel.
- Buttons: the Pimoroni firmware has a
Buttonhelper. The Display Pack’s buttons are on pins 12 (A), 13 (B), 14 (X) and 15 (Y). - Only redraw when something changes. Clearing and redrawing the whole screen 100 times a second makes it flicker. Ask: “how do I only update the screen when the button state changes?”
- Save as
main.pyon the Pico and it’ll run automatically every time the Pico gets power. Save often.
β Done when: press A, eyes change. Press A again, they change back.
Step 2 β Secret triple-click mode πΉοΈ
Goal: triple-click button B to flip between TEST mode and LIVE mode. Like a hidden developer menu in a game.
- Test mode = you’re in control. You’ll fake the data to check everything works.
- Live mode = the gadget does its real job, no numbers, just vibes. I mean faces.
Hints
- A triple-click is “three presses within a short time window”. How short? Experiment. Somewhere around half a second to a second feels natural.
- You’ll need to remember when each press happened. MicroPython’s
timemodule has a millisecond counter. Ask your AI: “how do I measure the time between two button presses in MicroPython without blocking the rest of my program?” - Watch out for button bounce: one physical press can look like several super-fast presses to the Pico. Ask the AI what “debouncing” is.
- Make the mode obvious. Put a little
TESTlabel in a corner, or change the background colour, or set the RGB LED to a different colour. If you can’t tell which mode you’re in at a glance, neither can anyone else. - Think about this: what should happen if you press B once or twice? Nothing? Something else? Your design, your call.
β Done when: triple-click B, see the mode change. Triple-click again, it changes back. Single clicks don’t accidentally trigger it.
Step 3 β Fake the weather π‘οΈβ¬οΈβ¬οΈ
Goal: in TEST mode, buttons X and Y raise and lower a pretend “measured” temperature. The eyes change when the temperature crosses a line.
This is how real engineers work: test your logic with fake data before you trust real data. If the face is wrong at a fake 30 Β°C, it’ll be wrong at a real 30 Β°C too β and that’s much harder to test in November.
Hints
Pick your temperature bands. For example:
- below 10 Β°C β cold π₯Ά
- 10 to 18 Β°C β meh π
- 18 to 24 Β°C β happy π
- above 24 Β°C β too hot π₯΅
Four bands means you need four sets of eyes now. Time to go back to the graph paper.
Show the number on screen in test mode, so you can see exactly where you are. Then you can check: at exactly 18, which eyes do I get? That’s called testing a boundary, and it’s where most bugs hide.
Should X go up by 1 degree? By 0.5? What if you hold it down β should it keep going? Your choice. Write it down, then build it.
Keep the “pick the eyes” logic in its own function that takes a temperature and returns which eyes to use. Then every later step can reuse it. Ask your AI why that’s a good idea.
β Done when: in test mode, X and Y change the number, and the eyes change at exactly the temperatures you planned. In live mode, X and Y do nothing (yet).
Step 4 β Real sensor, real data π¬
Goal: wire up the SPA06-003 and use the real room temperature. In test mode show the reading; in live mode just show the face.
Wiring
The sensor talks to the Pico using IΒ²C β a two-wire data bus. Two wires for data, two for power:
| Sensor pin | Omnibus empty deck socket |
|---|---|
| VIN | 3V3 (not VBUS, not 5 V!) |
| GND | GND |
| SCK / SCL | GP5 |
| SDI / SDA | GP4 |
Use the empty deck on the Omnibus β its sockets are labelled, so you can push the jumper wire ends straight in. If your sensor has a STEMMA QT cable, the colours are usually: red = power, black = ground, yellow = SCL, blue = SDA.
π Unplug the USB before wiring. Always. Every time.
Is it alive?
Plug back in and type this in the Thonny Shell:
You should get a list with a number in it β probably [119] (that’s 0x77 in
hex) or [118]. That’s the sensor saying “I’m here!” π
- Empty list
[]? Check the wiring. SDA and SCL swapped is the classic. - Error? Check the pin numbers and that the sensor has power.
Hints
- The sensor doesn’t just send “21.5 Β°C”. It sends raw numbers plus a set of calibration values stored inside the chip, and you have to combine them using a formula in the datasheet. That’s real engineering.
- Ask your AI: “Explain how the SPA06-003 temperature sensor turns raw readings into degrees using its calibration coefficients. What registers do I need to read?” Then check its answer against the datasheet on Adafruit’s product page . Adafruit also has a library you can study for clues.
- Sanity-check the number. Is it roughly room temperature? Breathe on the sensor β does it go up? Put it near an open window β does it go down? That’s you doing actual science. π§ͺ
- Now hook it up: in live mode, feed the real temperature into the “pick the eyes” function from Step 3. In test mode, keep the X/Y fake controls and show the real reading on screen too.
β Done when: live mode shows the right face for the real room. Test mode shows the actual reading in degrees.
Step 5 β Go online π‘
Goal: connect to Wi-Fi, look up your UK postcode, and get the outdoor temperature from a free weather service.
Wi-Fi
- The Pico W only does 2.4 GHz Wi-Fi. If your network is 5 GHz only, use a phone hotspot.
- School or library Wi-Fi with a “click here to log in” page usually won’t work. A home network or phone hotspot is easiest.
- Put the network name (the SSID) and password in a separate file on the
Pico, something like
secrets.py. Never paste your Wi-Fi password into an AI chat, and never share that file. Ask your AI how to import values from another file. - Set the Wi-Fi country to GB β ask the AI how.
- Connecting takes a few seconds. Show it on the screen! A little “connecting⦔ message, or a sleepy face, beats a blank screen every time.
Weather β two free services, no sign-up
- Postcode β location.
postcodes.io
turns a UK postcode into a
latitude and longitude. Try it in a web browser first:
https://api.postcodes.io/postcodes/SW1A1AA - Location β weather. Open-Meteo gives you the weather for any latitude and longitude. Its docs page has a URL builder: tick temperature under “current”, and max/min temperature and weather code under “daily”.
Open both in your browser first. You’ll see JSON β the format most of the internet uses to send data. Find the temperature in it with your own eyes before you write any code. Then ask your AI: “How do I fetch a URL and read a value from JSON on a Pico W in MicroPython?”
Hints
- You only need to look up the postcode once β the location doesn’t move!
- Don’t ask for the weather every second. It changes slowly, and hammering a free service is rude. Every 15 to 30 minutes is plenty.
- Wi-Fi drops. What does your face do if the internet disappears? Crash? Freeze? Or show a confused face π΅ and try again later? Plan for it.
β Done when: the Pico connects on its own, gets the outdoor temperature for your postcode, and the face reacts to it.
Step 6 β Ping pong: now vs tomorrow π
Goal: the screen bounces back and forth between “how it is NOW” and “how it’ll be TOMORROW”, every few seconds.
The weather service already gave you tomorrow’s forecast in Step 5 β it’s in the “daily” part of the JSON.
Hints
The challenge here is design: anyone glancing at it must instantly know which one they’re seeing. Some ideas β pick a few:
- a big NOW or TMRW label
- a different background colour for each (warm for now, cool for tomorrow?)
- the RGB LED changes colour to match
- a little progress bar that fills up until it switches
- a quick slide or wipe animation between them
- in test mode, show both numbers and which one is active
More hints:
- How long on each screen? 3 seconds? 5? Test it on a friend. If they can’t tell what’s going on, change it.
- Think about which temperature you mean by “tomorrow”: the max? The average? There’s no wrong answer, but know which one you picked.
- The ping-pong timer must not stop the buttons working. If your code uses
sleep(5), the buttons go dead for 5 seconds. Ask your AI: “how do I run a timer in MicroPython without blocking button presses?”
β Done when: it bounces between now and tomorrow, it’s obvious which is which, and the buttons still respond instantly.
Step 7 β Give it a mouth π
Goal: add a mouth on top of the eyes, so the face has way more emotion.
Here’s the clever bit: the eyes and mouth can mean different things.
- Eyes = temperature (from Step 3)
- Mouth = the weather type, from the weather code in the forecast
The weather code is a number. Open-Meteo’s docs have the full table, but roughly:
| Code | Weather | Mouth idea |
|---|---|---|
| 0 | clear sky βοΈ | big smile |
| 1β3 | cloudy β | small smile |
| 45, 48 | fog π«οΈ | wobbly line |
| 51β67, 80β82 | drizzle / rain π§οΈ | frown |
| 71β77 | snow βοΈ | little “o” |
| 95β99 | thunderstorm βοΈ | zig-zag π¬ |
Hints
- An overlay means drawing the mouth after the eyes, on top. Same bitmap trick as the eyes, just a different shape and position.
- Hot and raining? Happy eyes and a frown. Is that confusing, or is that actually funny and honest? You decide.
- In test mode, how will you test all the mouths without waiting for a thunderstorm? π€ Maybe hold X and Y together to cycle through fake weather codes? Your call.
β Done when: the face has eyes and a mouth, and you can explain to someone what each one means.
Step 8 β Stretch goals: you’re an expert now π§
Seriously, look what you’ve built. Hardware, sensors, a data bus, the internet, JSON, user interface design, testing. That’s a lot of real engineering.
Pick something and make it yours:
- Blink. Make the eyes blink at random. Instantly 10Γ more alive.
- Pressure power. The SPA06-003 also measures air pressure. Falling pressure often means bad weather coming. Can your face predict rain before the forecast does?
- Inside vs outside. Compare the room sensor with the outdoor temperature. Window open? Heating on too high? The face could nag you about it.
- Sleep mode. Dim the screen at night. What time is “night”? Hint: the weather service can tell you sunrise and sunset.
- More days. Ping-pong through the whole week, not just tomorrow.
- Data logging. Save a reading every hour to a file on the Pico, then plot a graph on the laptop. Now that is a science project.
- Personality. Give it a name. Make it say things. Make it dramatic about drizzle.
- Battery + box. Add a battery and 3D print or laser cut a case. Now it’s a product.
Show us what you made! Post a video of your weatherface doing its thing. Explain one bug you hit and how you fixed it β that’s the part people actually learn from. π¬
Back to the MakerLab overview.