Making A Clock With A Retooled Unihiker K10

The Unihiker K10 is intended to be a small single-board solution for light AI and machine learning tasks. However, you don’t have to use it in that way if you don’t want to. [mircemk] figured out how to repurpose the device, and whipped up a simple Internet clock build to demonstrate how it’s done. 

While the Unihiker K10 is based on the common ESP32 microcontroller, out of the box, it isn’t compatible with standard Arduino libraries. However, [mircemk] had previously figured out how to get the K10 to play nice with the Arduino environment, building a simple light meter as a proof of concept. It just took a little tinkering to get everything playing nicely together, but soon enough, the TFT LCD and a light sensor were playing nicely with the K10 platform.

Moving forward, [mircemk] wanted to unlock more capability, so set about figuring out how to get WiFi and the onboard buttons working within the Arduino environment. A great way to test this was building a clock—the screen would show an analog clock face, the buttons would be used for control, and the WiFi would be used to query an NTP time server to keep it synced up and accurate.

It took a little work, particularly as the buttons are accessed through an external I/O expansion chip, but [mircemk] got there in the end. The clock may not be a particularly advanced project, but the write-up demonstrates how the K10 can readily be used with Arduino libraries for when you’re not interested in leveraging its fancier AI/ML capabilities.

We’ve seen a few good builds from [mircemk] before, too, like this neat proximity sensor. Continue reading “Making A Clock With A Retooled Unihiker K10”

Network Time Protocol On The ESP32

Network Time Protocol (NTP) is one of the best ways to keep networked computers synchronized to the same time. It’s simple, lightweight, and not only allows computers to maintain a time standard together, but it also allows some computer manufacturers to save some money on hardware costs. The Raspberry Pi is perhaps the most well-known example of a low-cost computer without the extra expense of a real-time clock (RTC). While the Pi sets up NTP essentially automatically, other microcontrollers like the ESP32 don’t, but it is possible to configure them to use this time standard with some work.

For this project the MicroPython implementation for the ESP32 is required. MicroPython is a way of running Python code on microcontrollers or other embedded systems without all of the overhead that Python would normally require. Luckily enough, the NTP libraries are built right in so once MicroPython is running on the ESP32 it’s nearly as easy as calling the library. Of course you will have to make sure there is an internet connection, and then grab the time, sync it to the machine, and then set the timezone.

For a bonus exercise, the project’s creator [Bhavesh] suggests attempting to configure Daylight Savings Time, although this can be a surprisingly difficult problem to solve. In the meantime, there are a few other ways of installing a clock on a microcontroller like this one. An RTC module is an obvious choice, but you can also get incredibly accurate time by using a GPS module as well.

Network Time Clock For A Home Media Center

[Derek] wanted a clock for his media center. A simple wish, but he had a few requirements: he didn’t need an alarm, wanted it to automatically set its time after a power outage, needed a big display, and also wanted it to look good. After shopping around [Derek] couldn’t find a clock that would fit his requirements so he decided to build one.

[Derek]’s project is called the SNTP clock. As you might expect, it gets its name from the protocol used to automatically synchronize the clock in your computer with other network time servers. The clock itself is built around an ATMega168 gathering time data from the Internet with the help of a Lantronics XPort. One inch seven segment LEDs serve as the display for the clock, and everything, from the time offset from UTC, the brightness of the display, and whether the clock displays 12 or 24-hour time is controlled by an infrared Apple remote.

A bare PCB or bundle of wires would look out of place in [Derek]’s media shelf, so he used a metal picture frame and smoked acrylic to dress up his clock. Now he’s got a beautiful and elegant clock that fits right in to his media servers and receiver.