GithubHelp home page GithubHelp logo

doubledave / ttgo-ntp-clock Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 26 KB

clock for ESP32 device TTGO T-Display which uses wifi to get the time from an NTP time server

License: MIT License

C++ 100.00%

ttgo-ntp-clock's Introduction

TTGO ESP32 T-Display Project with UPS

Overview

This project leverages the TTGO ESP32 T-Display, an ESP32 development board with an integrated display, and is designed to work with a large UPS (Uninterruptible Power Supply) for enhanced power management and reliability. It features WiFi connectivity, time display, button interaction, and UPS voltage monitoring.

Features

  • WiFi Connectivity: Connects to a specified WiFi network and prints the connection status.
  • Time Display: Displays the current time obtained from an NTP server.
  • Button Functions: Utilizes onboard buttons for display interaction.
  • UPS Voltage Measurement: Measures and displays the UPS voltage.
  • Screen Time Management: Controls the display backlight based on user interaction.

Hardware Requirements

  • TTGO ESP32 T-Display board
  • Large UPS (Uninterruptible Power Supply)
  • USB cable for programming

Software Requirements

  • Arduino IDE
  • ESP32 board support (installation URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json)
  • Required Libraries:
    • TFT_eSPI from Bodmer
    • WiFi
    • SPI
    • time.h
    • esp_adc_cal.h
    • Button2

Installation

Setting up Arduino IDE

  1. Add ESP32 board support to the Arduino IDE. In File > Preferences, add the following to 'Additional Board Manager URLs':
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
    
  2. Install ESP32 board support via Tools > Board > Boards Manager.

Installing Libraries

  • Open Tools > Library Manager and install:
    • TFT_eSPI by Bodmer
  • Download the repository from https://github.com/Xinyuan-LilyGO/TTGO-T-Display and replace the TFT_eSPI directory in Documents/Arduino/libraries/ with the one from the repository.

Hardware Setup

  • Connect the TTGO ESP32 T-Display to the UPS and to your computer via a USB cable.

Loading the Sketch

  • Open the provided Arduino sketch in the Arduino IDE.
  • Select ESP32 Dev Module under Tools > Board.
  • Select the correct COM port under Tools > Port.
  • Upload the sketch to the board.

Usage

  • The device will automatically connect to the specified WiFi network.
  • Time will be displayed on the screen, updated from the NTP server.
  • Button 1 resets the screen time counter, while Button 2 sets it to a specific value.
  • The device measures and displays the voltage of the UPS.
  • The display backlight is managed automatically based on user interaction.

Customization

  • Update WiFi credentials in the sketch with your network details.
  • Modify NTP server settings as required.
  • Adjust screen time management settings as per your preference.

๐Ÿ“‹ Note:
You can find more information on configuration on the configuration wiki page

ttgo-ntp-clock's People

Contributors

tayjaybabee avatar doubledave avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ttgo-ntp-clock's Issues

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Screen turns off right away when entering the loop() after setup()

For some reason I can't figure, in the first iteration of the loop() the counter starts at 750.
It's then incremented to 751, and then the screen gets turned off as intended by "if (screen_time >= 750)".

I tried setting the counter to 0 at the end of setup but that doesn't make any difference.

My best guess is that during reset there might be some ghost state in button 2 which registers as the button being pressed, triggering the callback, and thus setting the counter to 750, otherwise I can't imagine where the 750 comes from.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.