Another pointless project - the programmable digital watch

johna by | January 20, 2025 | Electronics Web Development

Programmable digital watch project.jpg

I've come up with yet another pointless project.

Recently, I've rekindled my interest in digital watches after having found my old calculator watch from the 1990s.

With mobile phones, there's no longer much need for a watch, let alone a calculator watch, and I was trying to think of what features might make a watch more appealing in the current age.

To be honest, I couldn't think of any new features or good reasons to wear a watch other than for fashion reasons, or for people who want to be able to check the time quicker and more convenient than reaching for their mobile phone.

But you can still buy a new calculator watch in 2025, so that indicates to me that there is a market for pointless watches for hobbyists. So what would be of interest to hobbyists?

The only thing that I could come up with was being able to program your own watch. I know you can get smart watches and have apps for any purpose, or create your own app, but I was thinking of a much simpler, more convention digital watch that uses a typical watch battery that lasts for years rather than needing to be charged every day.

It would have a simple BASIC-style programming language that would have minimal features and commands but enough to do anything a watch needs to do and more.

How would you program it? You could develop in a desktop application or browser-based editor with a built-in emulator, and then compile into some sort of minimalist opcode and transfer to the watch by a simple serial two-pin cable. No USB as that might add to the complexity of the computing power needed for the watch.

As a proof-of-concept I started working on a web-based emulator with a JavaScript library of functions, similar to what I would expect the watch would have. For my POC, developing your own programs is in the JavaScript language simply because I didn't want to go to the lengths of creating my own compiler.

I have no idea the available computing power of a digital watch so I don't know if this is actually possible. For the POC, I kept things pretty minimal. I chose a display consisting of 4 rows capable of alphanumeric characters plus a row of common icons (AM, PM, 24HR, DST, ALM, SNZ, CHIME). The font is made up of 5 x 5 pixels. However, a fully customisable pixel display would be more flexible if possible.

The top and bottom rows are 13 characters long and are intended to indicate what each of the four buttons do, as their functions would not be printed on the watch, and will vary depending on the mode and settings of the watch.

I liked the idea of the different modes of the clock being stored in self-contained modules so did this for my example.

This is very much a work-in-progress. The JavaScript library is only for the purpose of emulating what the watch would do.

It's been quite interesting thinking of how to make the various watch functions work and the potential problems associated with certain situations, such as if an alarm was to go off while in the middle of setting the time.

If you are reading this post, my question to you is if you had access to a programmable digital watch, what features would you like to create?

UPDATE: turns out there is already something similar to this out there. Sensor Watch is a new circuit board that fits inside a Casio F-91W watch housing and has an ARM processor. There is various firmware to download and a framework for creating your own. Updates are through USB and despite being a powerful processor, the battery can last 18 months. As good as this is, and much more powerful than I imagined possible, the programming part is more complicated than I would have aimed for, and the F-91W display is very limiting.

Try it

Here is my incomplete first attempt at the proof-of-concept.

The main clock mostly works, setting the date and time works but has issues due to problems with the JavaScript library, and the stopwatch works pretty well. I will keep working on these and the other functions like alarm, dual time and countdown timer.

Inspect the page code to see how it works.

Once the code is in a better state I will make a package that can be downloaded and will be easier to do some development for.

24HR AM PM DST ALM SNZ CHIME

Command reference

LET / CONST / VAR
Use these JavaScript commands to declare variables

ADDSHOWDATE(name, datetimevalue, row, column, format)
Shows a date on the specified row, starting at the specified column, in the specified format.

ADDSHOWTIME(name, datetimevalue, row, column, format, clockmode)
Shows a time on the specified row, starting at the specified column, in the specified format, with am/pm/24 hour indicator, and update when the time or date changes.
Formatting string allows you to control what parts of dates and times are shown, how many digits, and whether they should flash or not (useful for a set mode).

REMOVESHOWTIME(name)
Stop showing and updating a time previously set with SHOWTIME.

PRINT(row, col, stringvalue)
Prints alphanumeric characters on the specified row starting at the specified column.

ONBUTTON(buttonnum, handler)
When a button is pressed (numbered 0 to 3 clockwise) call the specified handler function.

ONTICK(name, handler)
Add an event handler function that will be called every second. Set handler to NULL to stop event handling.

ADDCLOCK(name, datetimevalue, increment)
Add a datetime object that the watch will automatically increment based on the specific increment. The normal clock and stopwatch would typically increment by 1 second, a countdown timer would increment by -1 seconds.

REMOVECLOCK(name)
Remove a clock from being updated by the watch.

CLEAR(row = NULL)
Clear the screen or a specific row.

DISPLAY(icon, status)
Show or hide one of the built-in icons (am, pm, 24hr, dst, alarm, snooze, chime).

DATE FUNCTIONS

I added a couple of my own functions, but for this POC I am mostly using JavaScript date object functions.

SETDATE()
SETTIME()

GETHOURS()
GETMINUTES()
GETSECONDS()
GETMILLISECONDS()
GETYEAR()
GETMONTH()
GETDATE()
GETDAY()

SETHOURS()
SETMINUTES()
SETSECONDS()
SETMILLISECONDS()
SETYEAR()
SETMONTH()
SETDATE()
SETDAY()

TODO

I need to add a function to sound a chime or alarm, and possibly handle stopping an alarm rather than make the programmer handle this.

It would be nice to be able to develop games for the watch so that would need the ability to display graphics, play sounds, and have an event handler quicker than every second.

Related Posts

Electronics

Radio Shack digital calculator/databank watches history

by johna | January 9, 2025
Radio Shack digital calculator/databank watches history

Electronics

Vintage clock/radios and my Soundesign 3834-A

by johna | January 7, 2025
One of the most amazing clock/radios: the Soundesign 3834-A.

Electronics

Vintage watches and my Radio Shack 63-5087 Multifunction Watch

by johna | December 22, 2024
I own a Radio Shack 63-5087 which was given to me as a gift by my then girlfriend, now wife back in the 1990s.

Comments

There are no comments yet. Be the first to leave a comment!

Leave a Comment

About

...random postings about web development and programming, Internet, computers and electronics topics.

I recommend ASPnix for web hosting and Crazy Domains for domain registration.

Subscribe

Get the latest posts delivered to your inbox.