Arnov Sharma
Published © MIT

PiP-WATCH Project

Pipboy inspired watch from the Fallout game series.

BeginnerFull instructions provided1 hour1,225
PiP-WATCH Project

Things used in this project

Hardware components

FireBeetle ESP32-E IoT Microcontroller with Header (Supports Wi-Fi & Bluetooth)
DFRobot FireBeetle ESP32-E IoT Microcontroller with Header (Supports Wi-Fi & Bluetooth)
×1
GC9A01 Display
×1

Software apps and online services

Fusion 360
Autodesk Fusion 360
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

cad file

Schematics

SCH for Wiring

Code

code

C/C++
#include <WiFi.h>
#include <NTPClient.h>
#include <WiFiUdp.h>

#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();

// Replace with your network credentials
const char *ssid = "YOUR SSID";
const char *password = "YOUR PASS";

// Define NTP Client to get time
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP);

// Variables to save date and time
String formattedDate;
String dayStamp;
String timeStamp;

void setup() {
  // Initialize Serial Monitor
  Serial.begin(115200);
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  // Print local IP address and start web server
  Serial.println("");
  Serial.println("WiFi connected.");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

// Initialize a NTPClient to get time
  timeClient.begin();
  // Set offset time in seconds to adjust for your timezone, for example:
  // GMT +1 = 3600
  // GMT +8 = 28800
  // GMT -1 = -3600
  // GMT 0 = 0
  timeClient.setTimeOffset(19800);
  tft.init();
  tft.setRotation(4); // Adjust rotation if needed

}

void loop() {
  while(!timeClient.update()) {
    timeClient.forceUpdate();
  }

  formattedDate = timeClient.getFormattedDate();
  Serial.println(formattedDate);

  int splitT = formattedDate.indexOf("T");
  dayStamp = formattedDate.substring(0, splitT);

 tft.fillScreen(TFT_BLACK); // Clear the screen
  tft.setCursor(35, 40); // Set cursor position
  tft.setTextColor(TFT_GREEN); // Set text color
  tft.setTextSize(2); // Set text size
  tft.print("DATE: "); // Print DATE
  Serial.print("DATE: ");


  tft.setCursor(32, 60); // Set cursor position
  tft.setTextColor(TFT_GREEN); // Set text color
  tft.setTextSize(3); // Set text size
  tft.print(dayStamp); // Print text 
  Serial.println(dayStamp);

  
  // Extract time
  timeStamp = formattedDate.substring(splitT+1, formattedDate.length()-1);
 
  tft.setCursor(35, 100); // Set cursor position
  tft.setTextColor(TFT_GREEN); // Set text color
  tft.setTextSize(2); // Set text size
  tft.print("HOUR: "); // Print text 
  Serial.print("HOUR: ");

  tft.setCursor(32, 120); // Set cursor position
  tft.setTextColor(TFT_GREEN); // Set text color
  tft.setTextSize(3); // Set text size
  tft.print(timeStamp); // Print text 
  Serial.println(timeStamp);

  tft.setCursor(32, 170); // Set cursor position
  tft.setTextColor(TFT_GREEN); // Set text color
  tft.setTextSize(3); // Set text size
  tft.print("pipBOY"); // Print text 

  delay(500);
}

Credits

Arnov Sharma

Arnov Sharma

284 projects • 297 followers
Just your average MAKER

Comments