A screen, a knob and a beep: design notes for a desk timer
A desk timer is a small board with three things on it that almost every gadget needs sooner or later: something to show, something to turn and something that makes a sound. These notes go through each of them, and the mistakes that are easy to make.
Turn the knob to 25 minutes, press it, get on with your work, and let the board tell you when the time is up. A desk timer does very little, which is what makes it a good board to design. It has three things on it that you will meet again in almost every gadget: a small screen, a rotary knob and a buzzer.
The screen

The usual choice is a 0.96-inch OLED module with 128 by 64 dots. It talks over I²C, so it needs four wires: power, ground, clock and data.
- Pull-up resistors. The two I²C lines can only pull low. Something has to pull them back up. Two resistors of about 4.7 kΩ to 3.3 V do it. Many modules already have them on the back, so check before you add a second pair.
- Pin order. Modules that look the same come with two pin orders: some start with power, others with ground. Check the one you bought against your footprint, or the screen gets its supply backwards.
- Burn-in. An OLED that shows the same digits in the same place for months will fade there. Dim the screen when nothing is running, or let the digits move by a dot now and then.
The knob

A rotary encoder is not a potentiometer. It has no end stops and it does not report a position. Inside are two switches that open and close as you turn, one a quarter step behind the other. The controller watches which one changes first, and that tells it the direction. Many encoders can also be pressed like a button, which gives you a start key for free.
- Bounce. Mechanical contacts chatter for a few milliseconds when they switch. Without a cure, one click reads as three. The cure is a small capacitor on each line, or a few lines of filtering in the firmware. Either works. Both together is fine.
- Pull-ups again. The two switches connect to ground, so each line needs a pull-up. The controller's built-in ones are usually enough.
- The footprint. Encoders from different makers have different pin spacing and different mounting tabs. Take the drawing from the datasheet of the exact part.
The beep

Buzzers come in two kinds, and the order form does not always make the difference clear.
| Kind | What it needs | What you get | | --- | --- | --- | | Active | Just power. It has its own oscillator. | One fixed tone. | | Passive | A square wave from the controller. | Any pitch you send it, so it can play a tune. |
Either way, do not wire a magnetic buzzer straight to a controller pin. It draws more current than a pin is meant to give. Put one small transistor in between, with a resistor of about 1 kΩ on its base.
A magnetic buzzer is a coil. When the transistor switches it off, the coil answers with a voltage spike. A diode across the buzzer, pointing against the supply, gives that spike somewhere harmless to go. It is the cheapest part on the board and the one most often forgotten.
Keeping time
A timer that drifts is a poor timer. The controller's internal clock can be off by a percent or more, which is half a minute in an hour. A watch crystal fixes that.
The crystal runs at 32,768 Hz. That number is 2 to the power of 15, so a simple counter that halves it fifteen times gives exactly one tick per second. An ordinary one is good to about 20 parts in a million, which is under two seconds a day.
- Put the crystal right next to the controller, with its two small capacitors beside it.
- Take the capacitor values from the crystal's datasheet. The wrong value still runs, only slightly fast or slow.
- Keep other signals away from the two short tracks.
Power
A USB-C socket is the easy way in. Two 5.1 kΩ resistors, one on each CC pin, tell a charger that something is plugged in. Without them a C-to-C cable gives no power at all. A small regulator takes the 5 V down to 3.3 V for everything on the board.

Before you order
- Check the OLED's pin order and the encoder's footprint against the parts you will really buy.
- Check the height. The knob is the tallest thing on the board and the buzzer comes second. If the board goes into a case, those two decide how deep it is. [A case for your board](#/story/a-case-for-your-board) covers that side.
- The encoder and the OLED header are through-hole parts. Say in your notes whether you want them fitted or will solder them yourself. It changes the assembly price.
- Put the reset button and the USB socket where a finger and a cable can reach them once the knob is on.
A board like this is a comfortable first or second order. Upload the Gerbers, the BOM and the placement file on EIN. The DFM check reads them first, and makers come back with prices for the bare board or the assembled one. [Nine keys and a knob](#/story/macropad-nine-keys-and-a-knob) uses the same kind of encoder with nine keys around it.
The timer in this film was drawn for the article. It is a design sketch, not a product.