Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe UNO R4 WiFi has Wi-Fi and a 12 x 8 LED matrix on the board, so this project needs no other parts. The board joins your Wi-Fi, serves a small web form, and scrolls whatever you send to it.
Keep the board on a home network; do not open its port to the internet.
Tick anything you already have and the total updates.
message_board.ino#include "ArduinoGraphics.h" // must come before Arduino_LED_Matrix.h
#include "Arduino_LED_Matrix.h"
#include <WiFiS3.h>
const char* SSID = "your-wifi";
const char* PASS = "your-password";
ArduinoLEDMatrix matrix;
WiFiServer server(80);
String message = "Hello from Geekobot";
String urlDecode(String s) {
String out;
for (unsigned i = 0; i < s.length(); i++) {
char c = s[i];
if (c == '+') out += ' ';
else if (c == '%' && i + 2 < s.length()) { out += (char) strtol(s.substring(i + 1, i + 3).c_str(), NULL, 16); i += 2; }
else out += c;
}
return out;
}
void scroll() {
matrix.beginDraw();
matrix.stroke(0xFFFFFFFF);
matrix.textScrollSpeed(60);
matrix.textFont(Font_5x7);
matrix.beginText(0, 1, 0xFFFFFF);
matrix.println(" " + message + " ");
matrix.endText(SCROLL_LEFT);
matrix.endDraw();
}
void setup() {
Serial.begin(115200);
matrix.begin();
while (WiFi.begin(SSID, PASS) != WL_CONNECTED) delay(2000);
delay(2000); // wait for an address
Serial.print("Open http://"); Serial.println(WiFi.localIP());
server.begin();
}
void loop() {
WiFiClient client = server.available();
if (client) {
String req = client.readStringUntil('\n'); // GET /?m=Hello HTTP/1.1
int a = req.indexOf("m=");
if (a > 0) message = urlDecode(req.substring(a + 2, req.indexOf(' ', a))).substring(0, 60);
while (client.available()) client.read();
client.println("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\n");
client.println("<form><input name=m maxlength=60><button>Send</button></form>");
client.stop();
}
scroll(); // one pass of the message, then check for new requests
}
Use a 2.4 GHz network; the board does not join 5 GHz-only Wi-Fi.
Include ArduinoGraphics.h before Arduino_LED_Matrix.h.
The board answers between scroll passes; shorter messages respond faster.
Yes, read it from an NTP server and scroll it.
No, anyone on your Wi-Fi can send a message. Keep it on your home network.
No, the Minima has no Wi-Fi or matrix.
1 part: Arduino UNO R4 WiFi Development Board ABX00087. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 4 steps.
No. This page has the complete, tested code (message_board.ino).
About ₹1,429 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
The WiFiS3 library and a minimal web server; Scrolling text with ArduinoGraphics; Reading URL parameters.
Keep the board on a home network; do not open its port to the internet.
Ideas that reuse this build: STM32 first steps. They are listed under Take it further on this page.
Your first MicroPython project: temperature and humidity on an OLED.
A web page with ON and OFF buttons that switches a relay over Wi-Fi.
A warm ring light that fades up at dusk and down at dawn.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Learning project. Check every circuit and the datasheet of each part before you power it up.