Wednesday, February 1, 2023

Getting Time From NTP Server Made Easy

By: Pamarthi Kanakaraja

- Advertisement -

ashwiniEvery once in a while, you come across an idea where keeping time is a prime concern. For example, imagine a relay that has to be activated at a certain time, or a data logger that has to store values at precise intervals.

The first thing that comes to our mind is to use a real-time clock (RTC) chip. But since these chips are not accurate, we need to keep doing manual adjustments to keep them synchronised.

The solution here is to use network time protocol (NTP). The ESP8266 NodeMCU has access to the internet, so you can get day of the week and precise time within a few milliseconds of Coordinated Universal Time (UTC) for free! And you don’t need any additional hardware circuitry.

Fig. 1: NTP communication format structure
Fig. 1: NTP communication format structure
- Advertisement -

Download source code


This project will be published in a few weeks. If you want to access it now, refer to Electronics For You’s December 2022 Issue–print or ezine edition.



What's New @

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Tech Contests