Network Time Digital Clock Using the ESP8266

2,102

11

4

About: #BnBe is a platform to help teach electronics no matter what the age or skill level. We’re currently designing a wide range of products from beginner level kits to industry-standard microcontroller platforms.

We learn how to build a cute little digital clock that communicates with NTP servers and displays network or internet time. We use the WeMos D1 mini to connect to a WiFi network, obtain the NTP time and display it on an OLED module.

The video above talks you through the entire process of building this project.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Gather the Electronics

To build this project, you will need a WeMos D1 mini or compatible board that uses the ESP8266 chipset along with an OLED module. The sketch should also work with the ESP32 boards but I haven’t tested this.

Step 2: Edit and Upload the Sketch

Download the sketch using the following link: https://www.bitsnblobs.com/wp-content/media/fw/diy/diy-e12.zip

Start by adding your network credentials as we need to connect to a WiFi network. Then, make sure you add the correct time zone information. You can visit the following link to obtain the relevant time zone string for your region: https://remotemonitoringsystems.ca/time-zone-abbreviations.php

Before you can upload the sketch, make sure that you have installed the U8g2 library along with the board support package for the ESP8266 boards. Check the images for further information or watch the video for detailed instructions. Once completed, plug in the board and make sure you have selected the right board settings as seen in the image. Then, hit the upload and wait for it to complete.

Once uploaded, open up the serial monitor and make sure that the correct time is being displayed. If not, make sure you have selected the right time zone for your region.

Step 3: Connect the OLED Module

Use the wiring diagram above to connect the OLED module to the microcontroller board. Power on the board and you should see the time displayed on the module.

Step 4: Add the Modules to the Enclosure

Once you're happy with the results, download and 3D print the model from the following link: https://www.thingiverse.com/thing:857858

The board sits on the back cover while the OLED module sits at the end of the enclosure. You can use double-sided tape to hold the OLED module in place and you can also add a bit of hot glue near the wires to keep it in place. Solder the wires from the OLED module to the microcontroller board and then seal the unit by using some glue to hold it together. Plugin the microUSB cable and it should work as expected.

If you've liked this post, then don't forget to follow us using the links below as we will be building many more projects like this one:

Be the First to Share

    Recommendations

    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    4 Discussions

    0
    None
    Scotthus2

    9 days ago

    dont work.. I get errors saying esp not declared in this scope. it shows up at the esp.restart()

    1 reply
    0
    None
    Bnbe_clubScotthus2

    Reply 9 days ago

    Have you used the same board configuration as shown in the video/top of the sketch? This was tested using the WeMos D1 mini board.