This guide is written for the original Adafruit Trinket board using an ATtiny85 microcontroller. It uses features specific to that chip including the timers, which is different from other microcontrollers. If you are using another microcontroller, please search the web for a more modern guide.

Trinket lends itself very well to building clock projects, its small and easy to hide behind a larger display. And clocks don't need a lot of logic, this example only has maybe 20 lines of code. Adding a digital display via I2C is possible using seven segment or character-based displays (with the library code posted for other projects).

This project interfaces Trinket to the the Adafruit DS1307 real-time clock (RTC) breakout board to form a clock. But rather than use the traditional digital display, the display is done using two analog meters. One for hours, one for minutes.

The Trinket can output to a meter without digital to analog converters. Trinket has pulse width modulation (PWM) on three of its pins. The meter uses a moving coil inductance movement, acting to average the indication of current flowing through it. If you have narrow pulses, the average voltage it sees is lower, thus the current is lower for the fixed resistance attached to it. For wide pulses, the meter sees nearly the supply voltage and will stay around the full scale. This circuit varies the pulse width sent to the meters proportional to the hour of the day and the minutes after the hour.

For two meters, we will use two of the three PWM pins on Trinket (the third is also an I2C pin connected to the clock module).

There are several projects on the web using analog meters to tell time. The ease at which you can do this with Trinket allows you to build this type of clock quickly and compactly. You may focus on designing how to mount the meters in a creative way.

There are many ways to display the finished project. Rather than a cabinet or plexiglass display, I chose meters free-floating in a colorful box. I think it lends a modern look.

You can check Google Images for "Clock Analog Meter" for other mounting designs. Designing your own solution is the best part of such a project.

This guide was first published on Oct 14, 2013. It was last updated on Mar 08, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.