Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rick&Morty NFC Tag #41

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
7 changes: 7 additions & 0 deletions designs/nfc_keytags/Rick&Morty_Tag/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Rick & Morty NFC Tag

I dont know I made something which i liked


<img width="410" alt="Rick Morty" src="https://github.com/user-attachments/assets/e31fedfd-cb98-4b8f-9882-ad90874bdb9e" />

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,492 changes: 1,492 additions & 0 deletions designs/nfc_keytags/Rick&Morty_Tag/Rick&Morty.step

Large diffs are not rendered by default.

128 changes: 128 additions & 0 deletions designs/weather_stations/Jai's Weather Display/Display_Script.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#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);

// Coordinates for Delhi
const char* ssid = "Wokwi-GUEST";
const char* password = "";
const char* serverName = "https://api.open-meteo.com/v1/forecast?latitude=28.6139&longitude=77.2090&current_weather=true";

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("Connecting to WiFi...");

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

tft.fillScreen(ILI9341_BLACK);
tft.println("Connected to WiFi");
Serial.println("Connected to WiFi");

tft.fillScreen(ILI9341_BLACK);
tft.setCursor(0, 120);
tft.setTextSize(2);
tft.println("Weather App - Delhi");
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(60000); // Wait for 1 minute before next update
}

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

Serial.println("Parsing weather data...");

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_weather"];

float temperature = currentWeather["temperature"];
float windSpeed = currentWeather["windspeed"];
String time = currentWeather["time"];
int windDirection = currentWeather["winddirection"];
bool isDay = currentWeather["is_day"];
int weatherCode = currentWeather["weathercode"];

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

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

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

tft.print("Wind Speed: ");
tft.print(windSpeed);
tft.println(" km/h");

tft.print("Wind Direction: ");
tft.print(windDirection);
tft.println("°");

tft.print("Day/Night: ");
tft.println(isDay ? "Day" : "Night");

tft.print("Weather Code: ");
tft.println(weatherCode);
}
Binary file not shown.
16 changes: 16 additions & 0 deletions designs/weather_stations/Jai's Weather Display/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This is my first PCB design:


![PCB](https://github.com/user-attachments/assets/f8f9c4fe-892f-42b5-af5d-2206a75f467d)


This is the Case for it:


<img width="610" alt="Screenshot 2024-12-21 at 1 17 18 PM" src="https://github.com/user-attachments/assets/cddb1763-db29-4d2e-88c6-5455ead36fd9" />


There are four pillars designed to hold the PCB, allowing it to slide in and out of the enclosure easily.


This the Wokwi Script: https://wokwi.com/projects/417352360582221825
Binary file not shown.
Binary file not shown.
Loading