Small Weather Display

by Duruo in Circuits > Microcontrollers

21 Views, 1 Favorites, 0 Comments

Small Weather Display

weather display demo

Get weather data from the OpenWeather API and display it with LED lights. If rain is expected in the next 3 ~ 6 hours, the round LED light at the top will be red. Otherwise, it's green. The 4-digit display shows the real-time temperature, alternating between Celsius and Fahrenheit.


Here is the code: https://github.com/starryDuruo/small-weather-display/blob/main/weather_display.py


This is my final project for Prof.G's Physical Computing class

Supplies

12011746944408_.pic.jpg

Raspberry Pi Pico WH $7 https://www.adafruit.com/product/5544

Solderless Breadboard for Raspberry Pi Pico (optional) $4.95 https://www.adafruit.com/product/5422

USB Battery Pack (optional) $14.95 https://www.adafruit.com/product/1959

USB cable - USB A to Micro-B - 3 foot long $2.95 https://www.adafruit.com/product/592

Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack - White - STEMMA QT / qwiic $10.95 https://www.adafruit.com/product/1002

STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable - 150mm Long $0.95 https://www.adafruit.com/product/4209

Diffused Red and Green Indicator LED - 18mm Round $1.75 https://www.adafruit.com/product/4042

2 47ohm resistors

jumper wires

Soldering Iron Kit $10 https://a.co/d/aP7Sc7F

glue

laser cut

Settings

Create a free account on openweathermap.org, then get the key at home.openweathermap.org/api_keys

Find out the latitude and longitude of the target location. Be aware of the direction, I had to change the longlitude to its negative value. You can search your city on openweathermap.org, there's a search box at top left.


Put the following information in settings.toml file:

CIRCUITPY_WIFI_SSID = "your wifi name"

CIRCUITPY_WIFI_PASSWORD = "your wifi password"

OPEN_WEATHER_DEFAULT = "open weather default key"

lat = "XX.XXXXX"

lon = "XX.XXXXX"

test_variable = "Successfully read from settings.toml"

Circuit

12051746945429_.pic.jpg
12031746944411_.pic.jpg

Solder the segmented LED to its backpack

Plug in the STEMMA QT cable to the LED backpack and connect it to the Raspberry Pi Pico W: red to 3.3v, black to ground, blue to GP4, and yellow to GP5.

For the round LED, you need to test it with code to see which side is which color. The middle is a common cathode, connect it to ground on Pico using a jumper wire. Plug a 47-ohm resistor on GP7, then connect to the red anode with a jumper wire. Plug a 47-ohm resistor on GP12, then connect to the green anode with a jumper wire.

Frame

11991746944404_.pic.jpg
12001746944406_.pic.jpg

Laser-cut the frame. File attached below.

Glue the two lights onto the frame.

Downloads