Back-to-the-Future: Twin Pines Mall Clock

by mawob in Circuits > Clocks

1441 Views, 14 Favorites, 0 Comments

Back-to-the-Future: Twin Pines Mall Clock

TwinPinesMall-Pic-page001.jpg
tpm.jpg

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), and one with Marty and the Doc standing in front of the clock face (based on a photo featured in BTTF part III).

Part I of BTTF 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"). This is the one I'm building here.

Supplies

20201124_153107.jpg
20201124_152546.jpg
20201124_152450(0).jpg
20201124_152650.jpg
20201124_152954(0).jpg

The electronics is built around an Arduino Nano. When bought from a Chinese supplier, the total cost of the electronics components should be below $20.

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 module, 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 - this worked in my previous projects, and I'm doing this here again.

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

This is all that is needed:

  • Arduino Nano (an Arduino Uno would work too)
  • RTC module DS3231 (modified as desribed above) and CR2032 battery
  • 8x32 LED module with MAX7219 driver
  • light-dependent resistor (LDR) and one 10k resistor
  • 2 momentary push button switches (to set the time: hours/minutes)
  • a 6cm x 8cm PCB (or a breadboard)
  • wood, acrylics (as described below)

The Electronic Circuit

TwinPinesMall-clock-circuit.jpg
20201112_110212.jpg
  • The Arduino Nano is powered using a simple USB power adapter, connected to its USB port.
  • The Vcc pins of the clock module and the LED module, and the LDR are connected to the 5V pin of the Arduino
  • The GND pins of the clock module and the LED module, and the 10k resistor are connected to the GND pin of the Arduino
  • The clock module's SCL and SDA pins are connected to the Arduino as: SCL -> A5 and SDA -> A4 (the "SQW" and "32k" pins are not used)
  • The LED module's pins are connected to the Arduino as: DIN (or 'data') -> pin 12 and CS -> pin 10 and CLK -> pin 11
  • The two push buttons are connected between Arduino pins 7, 8 and GND
  • The LDR is connected to the 10k resistor, and this connection goes to pin A6 of the Arduino

The photo shows a test setup of the clock and LED modules (with an Arduino Uno)

The Enclosure

20201112_190456.jpg
20201112_190827.jpg
20201112_191111.jpg
20201113_165003.jpg
20201114_120218.jpg
20201113_165042.jpg
20201117_203440.jpg
20201114_205725.jpg
20201114_210109.jpg
20201115_150725.jpg
20201115_212856.jpg
20201117_235728.jpg
20201117_203839.jpg
20201118_192537.jpg
20201124_155046.jpg

The total size of the unit is scaled to match the size of the LED matrix. This results in a size of the enclosure of 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. A simple foot is added. The additional pieces are cut with a laser cutter from 3/16" plywood and clear acrylics. The pair of trees are made from two layers of 3/16" plywood plus two additional triangular pieces cut with a table saw.

The attached laser-cutter file was created in librecad. It has the different pieces in different layers (the letters, the acrylic front plate, the 3/16" wooden plate to hold the LED matrix, the trees, and the 3/16" wooden full front plate). I forgot to include a little hole for the LDR (which sits between the trees and the LED matrix), so I added that later with a drill.

Assembly of the Electronics and Arduino Code

20201124_154155.jpg
20201124_153202.jpg
20201124_153234.jpg
20201124_153720.jpg
20201125_153920.jpg

In principle, one could simply build everything on a breadboard. But I decided to solder the circuit on a 6cm x 8cm PCB. The push buttons (which set the the hours and minutes) are simply soldered onto the PCB, so they can be accessed from the backside of the unit. I thought that these are rarely used, so they don't need to be accessible from the front.

The clock module has an integrated temperature sensor. Therefore my original plans also featured a touch sensor which I wanted to use to display the temperature information. However, I could not get this to work, so I abandoned this (the little red board of the touch sensor is visible on the photos and the connectors are on the PCB, so don't be irritated - just ignore it). After all, the temperature sensor in the clock module reads only the internal temperature of the module (which, during operation) will be higher than room temperature. So, in my final Arduino code, it displays the temperature only for one second when you turn it on, and then it only displays the time.

After I assembled everything, I noticed that I had inserted the LED matrix upside-down. But this is not a real problem and it was easily compensated in the Arduino code. The Arduino code (which is attached below) requires two libraries "Wire.h" and "RTClib.h" for the clock and one ("LedControl.h") for the LED matrix.

The Arduino code is based on the idea of the "blink without delay" sketch. The main loop calls five subroutines:

  • readLDR() - this reads the LDR and adjusts the brightness of the LED matrix accordingly - the brightness is computed as a rolling average of the LDR readouts (five times per second)
  • readClock() - this gets the time information from the real-time clock
  • updateTime() - this updates the time on the LED matrix if needed
  • blinkColon() - this lets the colon blink in 0.5 second intervals
  • readButtons() - this reads the buttons to set the time (hours and minutes) - it requires a long press (>600 ms)

Finished Clock

20201126_131329ed.jpg

That's it, "Marty, you made it!" - my Twin Pines Mall clock. It looks great on our fridge - especially if one adds the two brick figures of Marty and Doc.