ESP8266 NodeMCU Tutorial | NTP Client & 0.96 OLED Display with Time Based Automation (Without RTC)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
have you ever wanted to build a clock that's always accurate to the second without the hassle of real-time clock modules or perhaps you're intrigued by time triggered DIY automations well you're in for a treat hello and welcome to our Channel today we're diving into an exciting project that eliminates the need for RTC modules we'll be using the node MCU and ntp network time protocol to create a real-time clock display in this video we'll guide you through harnessing the power of the node MCU and ntp to fetch the precise time from the internet and display it on a small OLED screen followed by triggering an example automation at a specific time of the day let's jump in and discover how you can achieve this impressive feat to embark on this journey you'll need a node MCU esp8266 module a 0.96 OLED display and a small LED or buzzer for our time triggered automation if you're new to the world of esp8266 we recommend watching our getting started video before proceeding it will help lay the foundation with this powerful microcontroller let's start by setting up our development environment you'll need the trusted Arduino IDE and the esp8266 board don't worry if you're new to this will guide you through the installation process step by step open the Arduino IDE and navigate to files preferences in the additional board manager URL field paste the following code and click OK you can also find this code in the description below this will prepare your IDE to download the board for your node MCU once done go to tools board boards manager search for esp8266 and install it next let's proceed with installing the necessary libraries click on sketch include Library manage libraries search for and install the following libraries as they will play a crucial role during the coding process with a software side covered let's move on to the hardware use the provided diagram for the connections we'll connect our esp8266 to the internet via Wi-Fi and hook it up to a small OLED display this display will elegantly showcase the current time and date fetched from the ntp servers and the best part no RTC modules required let's delve into the heart of our project the code to begin we'll import the essential libraries we'll include the esp8266 Wi-Fi library for Wi-Fi connectivity ntp client for accessing the ntp server Wi-Fi UDP for UDP communication and add a fruit SSD 1306 to seamlessly control our OLED display as we move forward the code sets up constants and variables these Encompass Wi-Fi credentials PIN numbers for the LED and buzzer activation and deactivation times and arrays to manage days and months subsequently we'll initialize our OLED display with the help of the Adafruit SSD 1306 Library this display object becomes our canvas to present information next the Wi-Fi connect function takes charge of linking our esp8266 to a Wi-Fi network it skillfully updates the OLED display to reflect the connection status next in line is the clock display function it captures time from an ntp server using time client and elegantly showcases it on the OLED screen even the conversion to a friendlier 12-hour format is seamlessly handled introducing the device activation function this function scrutinizes the current time against the set activation and deactivation times if the moment Falls within the designated interval the LED comes to life otherwise it takes a breather and now for an extra dash of creativity let's add an enchanting touch text the gracefully Scrolls across the OLED display this delightful animation is a splendid method to convey supplementary information warm Greetings or messages in your projects behold the text scroll function The Mastermind behind this text scrolling feet with the X and Minx variables at our disposal we steer the scrolling phenomenon turning our attention to the setup function here we initiate the display configure pins for both the LED and buzzer establish a Wi-Fi connection start the client and establish the initial state of the LED based on the present time and last but not least the loop function Embraces the core logic of our project it orchestrates clock updates text scrolling and checks the device activation status if the state experiences a change a brief buzz from the buzzer marks the occasion now it's time to upload the code ensure that you've selected the correct board and port and that the module is connected to your computer there you have it fellow creators with the esp8266 and ntp by your side you've learned how to craft a real-time clock display without the need for RTC modules as we upload the code you'll witness the LED and buzzer activation and deactivation as programmed foreign this opens doors to Endless Possibilities from enhancing smart home automation to personalizing countdowns and event reminders the complete code and resources are waiting for you in the video description below if you found this tutorial valuable don't forget to give it a thumbs up and hit that subscribe button thanks for tuning in and remember the future is now so let's create something incredible
Info
Channel: Maison Up
Views: 5,764
Rating: undefined out of 5
Keywords: OLED, DIY, Microcontroller, Projects, RTC, NTP, ESP8266, NodeMCU
Id: ssB6pJ3JH5w
Channel Id: undefined
Length: 5min 46sec (346 seconds)
Published: Thu Aug 24 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.