Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 55 additions & 2 deletions designs/weather_stations/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
# Weather Station!
# weather station
Here's my submission for my weather station! Under the asylum "dragons_weather"

This is the first project of asylum! Design your own weather station somewhat similar to [this](https://learn.adafruit.com/wifi-weather-station-with-tft-display/overview) demo by Adafruit
## Features:
- Displays:
- Date
- Temperature
- Settings
- 4 WS2812Bs for dynamic LED effects
- A switch for turning on and off
- Slider for settings


## PCB
Here's a picture of my schematic, I wired a Wemos ESP32-S3 module to a TFT display, 5 WS2812B LEDs, a slider for settings

Schematic | PCB
:-------------------------:|:-------------------------:
![Screenshot 2025-01-27 211234](https://github.com/user-attachments/assets/2088f276-877b-47b5-9cea-305067c11d55)
tic.png) | ![Screenshot 2025-01-27 211213](https://github.com/user-attachments/assets/6c694724-561b-40c4-a9fa-53a2c9137b01)


[ x ] I ran DRC in KiCad and have made sure there are 0 errors!

## CAD Model:
Everything fits together using 4 M3 Heatset inserts

![Screenshot 2025-01-27 211705](https://github.com/user-attachments/assets/9a4c252e-04fb-4102-9352-95bd7987d6c8)

![Screenshot 2025-01-27 211719](https://github.com/user-attachments/assets/ff207bfb-3439-4747-8868-8af1710aee0b)


## Firmware overview
Firmware is written in aurdino, it grabs data from a API. Code for turining it off and on, slider and basic settings are written

[ x ] I remembered to exclude any personal information, including API Keys, WiFi passwords, etc

#BOM
**Provided by dari // alex**:
- 1x WeMos S2 Mini WITHOUT FEMALE HEADERS
- 1x ST7735 1.8" LCD display WITHOUT FEMALE HEADERS. Male headers soldered!

I will buy 4 WS2812Bs, which will cost me $0.8 in total.
I will be sourcing the following parts with my grant:
- 1x PCB from JLCPCB
- $2 for 5x + $1.50 shipping

- 1x SPDT slide switch [(ADAFRUIT)](https://www.adafruit.com/product/4219) $2.95



Total before tax: $6.5

I'll also be source the following parts myself since I already have them and would like to help Hack Club:

- 3d PRINT
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions designs/weather_stations/dragons_weather/CAD/c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions designs/weather_stations/dragons_weather/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

115 changes: 115 additions & 0 deletions designs/weather_stations/dragons_weather/firmware/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#include <WiFi.h>
#include <HTTPClient.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <ArduinoJson.h>

#define TFT_RST 4
#define TFT_DC 2
#define TFT_CS 15

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

const char* ssid = "Wokwi-GUEST";
const char* password = "";
// Charlotte weather
const char* serverName = "https://api.open-meteo.com/v1/forecast?latitude=35.2271&longitude=-80.8431&current=temperature_2m,relative_humidity_2m&forecast_days=1";

void parseWeatherData(String payload);

void setup() {
Serial.begin(115200);

WiFi.begin(ssid, password);
tft.begin();
tft.setRotation(1);
tft.fillScreen(ILI9341_BLACK);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);

tft.println("wifi connecting");

while (WiFi.status() != WL_CONNECTED) {
delay(500);
tft.print(".");
}

tft.fillScreen(ILI9341_BLACK);
tft.println("wifi connected");
Serial.println("wifi connected");

tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0, 120);
tft.setTextSize(2);
tft.println("Today's Weather!");
delay(3000);
}

void loop() {
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin(serverName);

int httpResponseCode = http.GET();
Serial.print("HTTP Response Code: ");
Serial.println(httpResponseCode);

if (httpResponseCode > 0) {
String payload = http.getString();
Serial.println("Received Payload: ");
Serial.println(payload);

parseWeatherData(payload);
} else {
tft.fillScreen(ILI9341_BLACK);
tft.println("Error fetching data");
Serial.println("Error fetching data");
}

http.end();
} else {
tft.fillScreen(ILI9341_BLACK);
tft.println("WiFi disconnected");
Serial.println("WiFi disconnected");
}

delay(30000);
}

void parseWeatherData(String payload) {
tft.fillScreen(ILI9341_BLACK);

Serial.println("Weather Parse");

StaticJsonDocument<1024> doc;
DeserializationError error = deserializeJson(doc, payload);

if (error) {
Serial.print(F("deserializeJson() failed: "));
Serial.println(error.f_str());
return;
}

JsonObject currentWeather = doc["current"];

float temperature = currentWeather["temperature_2m"];
int humidity = currentWeather["relative_humidity_2m"];
String time = currentWeather["time"];

tft.setCursor(0, 0);
tft.setTextSize(2);
tft.println("Austin Weather");
tft.setTextSize(1);
tft.println("");

tft.print("Time: ");
tft.println(time);

tft.print("Temperature: ");
tft.print(temperature);
tft.println(" °C");

tft.print("Humidity: ");
tft.print(humidity);
tft.println(" %");
}
1 change: 1 addition & 0 deletions designs/weather_stations/dragons_weather/pcb/n\
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading