Showing posts with label Back to the Future. Show all posts
Showing posts with label Back to the Future. Show all posts

Wednesday, March 10, 2021

LilyGo T-Watch 2020 goes Back to The Future



The LilyGo T-Watch 2020 hit the market in May 2020. A programmable watch with reasonably small size (looking somehow like the Apple watch), based on the ESP32 processor with an accelerometer, plus Wifi and Bluetooth connectivity at a price of only $30-$40.

When I bought mine in December 2020, I thought I was already late to the party. But then, I started to search the web for great watch faces for the T_Watch and I did not find much. So, I decided to make my own, and share this. Being a fan of the "Back to the Future" trilogy, in which the topic of "time" is omnipresent, I decided to make a Back-to-the-Future fun watch - and to share this.

This watch is not a smart watch! It does neither use the Wifi nor Bluetooth connectivity of the watch (I wouldn't know what I would use this for anyway). This watch will just be fun to look at, and without WiFi and Bluetooth, but with a good power management, the watch will be able to run three or four days without charging.

T-Watch 2020 with Back-to-the-Future Time Circuits watch face

Setting up the programming environment

The very first step is to install and set up the Arduino IDE. I have described this in detail in another blog post: Lilygo TTGO T-Watch 2020: Getting Started / The Software Framework.


References

While I did not find many great watches, I found plenty of good information and example codes that helped me to understand specific details of the watch. The power management, in particular, is very important, in order to get a watch that does not have to be charged every day. Here I'm listing some references that were valuable and from which I benefited a lot when writing my code.

  • The SimpleWatch example that comes with the TTGO T-Watch library
  • A series of articles at diyprojects.io (also check the links to their other articles)
  • The code for "aGoodWatch" from Alex Goodyear
  • The article and code at instructables.com by Dan Geiger
  • An interesting "Wordclock" by instructable.com user ArduinoAndy

Requirements

As mentioned above, I wanted this to be a fun watch that can be used in every day life, which means that it needs a very efficient power management. Therefore, in this project I am not using the WiFi and Bluetooth which helps a lot to save power. It allows to reduce the CPU frequency of the watch (from nominal 80MHz out of a max of 240MHz) down to 30MHz. The graphics are all programmed using the TFT_eSPI library. In contrast to many common example codes that have tiny buttons in their settings menus, the Back-to-the-Future watch has large buttons which can easily accessed. 


Features

My Back-to-the-Future watch code features five different watchfaces, a stop watch, and a settings menu with four screens (two to customize the display, and two to set time and date). The different categories can be thought of as three rows: The middle one has the watch faces, to top one the stopwatch, and the bottom row the settings menu.
The watch can be in three states: 
  1.  Full operation with the display on 
  2.  After a few seconds of full operation, it turns to light sleep from which it can be quickly awakened. This is done either by a press on the button at the top right - a quick(!) double tap - or by rapidly moving the watch upwards and rotating it towards you.
  3. To save power (e.g. over night) the watch can be set to deep sleep, by pressing the button for 5 seconds. It takes another (approx. 2 sec) press of this button to wake it up, which takes about 5 seconds.
In a very bright environment, you can use a double tap on the screen to get the maximum screen brightness. The next time when the watch returns from light sleep, the brightness is back at the normal value.

Watchfaces

The watchfaces, include a fluxing flux capacitor, the time circuits (with the current date/time in the middle row, plus typical movie dates in the top/bottom rows), the speedometer plus the plutonium gauges, the SID spectrometer, and the entrance sign to the Mall (which randomly appears as either "Twin Pines Mall" or "Lone Pine Mall"). 


T-Watch 2020 with Back-to-the-Future watch faces

T-Watch 2020 with Back-to-the-Future watch faces

The user can cycle through those with horizontal swipes. There are three different modes of operation: Whenever the watch returns from light sleep it either presents you with a random face (a: random), the next face (b: cycle), or the same face that was displayed before it went to sleep (c: "fixed").

Stopwatch

If you swipe to the top row, you get the stopwatch, which is modeled after the one Doc Brown uses in his experiment with Einstein (except for the display color, since yellow is much brighter than red).


Menu with Settings

When, starting from the watchfaces, you swipe to the bottom row, you get an "entry" screen: "Enter the Settings - swipe" from which you can swipe into the settings. The additional entry screen prevents you from erroneously entering the actual settings and from unwanted changes of your setup.

Swiping to the right, you get to part one of the display settings where you can select 
  • how the watchfaces are diplayed (random, cycle, fixed - as described above) 
  • the format in which the time is displayed: 12h, 12h plus seconds, or 24h format
  • if the stepcounter is shown in the top left corner (on/off)
  • if the remaining battery percentage is dislayed in the top right corner (on/off) 


On part two of the display settings you can select
  • how long the watch stays on: 7 sec, 12 sec, or 20 sec (I prefer 7 sec which is long enough for me to read the time. I used 20 sec to make the video, without the watch turning off all the time. I also use the 20 sec setting if I just enjoy looking at the watch...)
  • three levels of brightness (low, med, high)
  • if you want the display to dim at night (between 10pm and 7am).
On the next two screens, you can set the time and date. Any changes that are made with the "+" and "-" buttons are only stored when the "SET TIME" and "SET DATE" buttons are pressed.  


Swiping to the row above brings you back to the watchfaces.

Installing the Code

The code can be obtained from my github repository https://github.com/mawob/bttfWatch.
From the green "Code" pulldown menu, select "Download ZiP"


Unzipping the file creates a folder "bttfWatch-main" which has all the relevant files. Rename the folder from "bttfWatch-main" to "bttfWatch" and move this into the Sketchbook folder of your Arduino IDE. Then open it from the File menu, connect your watch, upload, and enjoy your new watchface!
 


Thursday, November 26, 2020

Building the Twin Pines Mall Clock from "Back to the Future"



Clocks are one of the main themes in "Back to the Future" - and also some of my favorite items for building replica props. Previously, I built three of those clocks, the one in the Time Circuits, the Harold Lloyd clock (as seen in the beginning of part I in Doc's house), one based on a photo featured in part III.



 

Part I of the movie also features another important clock which is part of the "Twin Pines Mall" sign (which, after Marty changed the timeline, became the "Lone Pine Mall").


I had this idea quite some time ago, and the electronic parts all at hand, when a posting of another build in the "Back to the Future Forever" facebook group inspired me to get this started.

Electronics (I)

The electronics is built around an Arduino Nano. 


The time is displayed on a 8x32 LED array, based on the MAX7219 driver IC - this looks rather close to the display in the original movie prop. The differences are that in the original movie prop the colon is not exactly aligned with the grid of the dot matrix, and the "AM"/"PM" displays use a smaller dot matrix). But for my purposes this is close enough.



For the real time clock (RTC), I am using the module DS3231 which I also used previously in the Time Circuits. This clock is very precise and it runs for years with a CR2032 battery. There is, however, one problem with this modul, related to the charging circuit which is supposed to be able to charge a rechargeable battery. As discussed in detail on this web page, the charging circuit would do damage to both a rechargeable battery or a non-rechargeable battery. So, the suggested solution is to simply remove a resistor (as indicated in the image) and to operate the module with a (non-rechargeable) CR2032 battery - and that's what will I do. 


I also add a light dependent resistor (LDR) to the circuit, so the clock can adjust the LED intensity based on the surrounding brightness.


My test-setup (using an Arduino Uno) works fine. 



Enclosure

The LED matrix defines the size of the unit - the enclosure is scaled accordingly to 5 1/8" x 21". The outer part of the enclosure is built like a picture frame using 3/4" thick and 3 1/2" wide pine boards, cut with a miter saw, glued, and sanded.






The additional pieces are cut with a laser cutter from 3/16" plywood and clear acrylics.


For the first time, I used the program inkscape, so I could cut the letters for "Twin Pines Mall".



Everything is painted using acrylic paints.







The pair of trees are made from two layers of 3/16" plywood plus two additional triangular pieces cut with a table saw.


This is the enclosure.


Electronics (II)

The electronics is soldered on a 6cm x 8cm PCB. First comes a sketch...


... and then the soldering.



Everything is connected...


... and inserted into the enclosure.


The Final Unit

Here it is: my "Twin Pines Mall" clock (with two Lego figures as a reference).









Monday, January 13, 2020

Building Props for a Back-to-the-Future Time Machine - Part 6: The SID panel


My other blog posts on BTTF props:
  Part 1: Building a Flux Capacitor
  Part 2: Building the Time Circuits
  Part 3: Building the Speedometer
  Part 4: Building the Analog Gauges
  Part 5: Building the TFC switch

This is now the last of the Time Machine props that I am building: The "SID panel" (Status Indicator Display) which sits in the DeLorean behind the drivers seat (right from the Flux Capacitor). It does not have any obvious function, but it looks cool in the movie when Marty approaches 88mph and you can see behind him, more and more of the 200 LEDs in this panel starting to light up: One row (= ten) red LEDs, siz rows of yellow LEDs, and thirteen rows of green LEDs. The good thing is that these days LEDs are dirt cheap (like 100 for $0.99 at Aliexpress). The bad thing is that in the original prop, each LED is mounted inside a little plastic holder - and these holders cost like $0.50 a piece (and 0.5 * 200 = ... too much). But I never went for 100% accuracy, so I just omit these holders. With this, I think the whole SID cost me less than $15.

The construction of the enclosure is straightforward.


It was fun, to watch the laser cutter cutting the 200 holes, and the result is, of course, very precise.





Now that the enclosure is glued and painted, it's time to address the electronics. Unlike for the other BTTF Time Machine props, the matrix circuit (and, later, the Arduino programming) for the 200 LEDs is a little more complex. 


The LEDs are soldered onto three 9cm x 15cm PCBs, as a matrix.



The electronics is based on an Arduino Pro Mini (ATmega 328). The LED matrix is accessed by a decimal counter (CD4017) for the 10 columns (together with two MIC2981 drivers), and three chained shift registers (TPIC6B595, which can sink larger currents than the 74HC595) for the 20 rows.


The code require a few more thoughts: My SID panel will operate in two modes: 1) standalone and 2) connected (via serial) to the other Time Machine props, so it gets the information of the current speed from the speedometer - and it can adjust the LED activity to the speed.
In both modes, the LEDs are moving randomly up and down. In mode 2) the random activity is coupled to the speed, while in mode 1) a speed value of 40 is assumed. The up and down motion of the individual LEDs columns is, however, not independent. If, for a given column, the two neighbors are higher, this increases the probability for this column to rise. Also, if a column was rising before, the probability is higher for this column to continue to rise in the next step. When a column has reached its max or min value, it will sit there for a while (the time is, again, random) and then change it direction. All the probabilities mentioned here are speed-dependent, such that the overall activity also changes with the speed. At zero speed, the columns are typically only moving up to the 5th row, while at 88 on average more than half of the columns will go all the way up, into the red.


After spending too much time on BTTF forums, I concluded that I had to add some corrugated plastic pipe (of about 3/4" diameter) which is held by two P-clamps (I could not find any purple ones, like in the movie prop, so I had to settle for black), through which the power/serial cable coming from the TFC switch is led. 



Here, the final unit is operating on the back seat of my car (no, it's not a DeLorean...).


Related:

My other blog posts on BTTF-related props and pieces:
   - Building BTTF clocks
   - Building a BTTF Brick Stage (featuring the smallest Flux Capacitor)