Section Top Intro Changes Specs Case Design Controls Modes Prototyping Word Map Power Module Connections Construction Components Vinyl Sticker Pin Outs LEDs DHT22 NANO Touch Sensor RTC Mod MAX7219 Rset Schematic Wiring MAX7219 Wiring Dust Seals LDR Set Brightness Set Clock Sync Clock Sum/Win USB Port PIR PIR On Off Code
background picture from GRAPHIC GOOGLE
Arduino Word Clock with minute resolution of time in words and linear display of seconds.
There are also modes for digital clock, analogue clock, temperature & humidity, & also three games, Game of Life, Simon & Tetris.
The clock can be stand alone or run as a slave off a Master Clock if required.
In stand alone mode the clock runs off it's built in temperature compensated real time clock with an accuracy of ±2ppm from 0°C to +40°C
When running as a slave off a Master Clock time is synchronised on every 30seconds past the minute.
Summer/Winter time is also automatically adjusted by one of my Pragotron Master Clocks on the BSTin (D7 Nano) pin.
A manual switch can be added instead if quick summer/winter time change is required.
There is an option for PIR control so the clock automatically turns off when no one is in the room.
The Clock measures 500mm x 500mm weighs 12lb (5.5Kg) and is designed to be wall mounted.
There are touch pads in each corner to setup and control the clock.
A mini USB socket provides brightness information over the serial port and also allows software programming in situe.
View on GITHUB or instructables
Demo Video showing Clock functions
About Word Clocks
Word Clocks tell the time using a matrix of words or numbers and letters and have been around for many years.
There are a few different design types around that effect the complexity of the clock build.
The simplest use blocks of words to tell the time in five minute resolution eg O'CLOCK, 5 PAST, 10 PAST etc.
These clocks only use 23 individual LED blocks and therefore are the simplest to construct.
The main disadvantage of these clocks is they can only show the time in this set format.
below simple commercial word clock
The medium level clock has a 11x10 matrix of LEDs plus four addition LEDs around the outside of the clock.
The Raspberry Pi controlled clock below even has multicolour LEDs and as it has 110 individual LEDs it can display digits and basic images.
These clock still use a 5 min resolution in words but often add "just gone 5 past" or almost 10 to" to increase the resolution slightly.
Often the four LEDs around the corners of the frame indicate the passing four minutes to fill the gap between the 5 minute worded resolution.
These clocks are reasonable complex to build and often use strips of LEDs to make the build easier.
below Raspberry Pi Word Clock
There are commercial versions of this type of clock available.
The 450mm wall hanging version cost around £1000 and features interchangeable front panels in many colours and materials as well as smaller desktop and watches are available.
below the 450mm x 450mm QLOCKTWO commercial word clock
The Word Clocks with the highest level of complexity use a 16x16 LED matrix giving a full 256 LEDs to control.
These clocks have a one minute worded resolution of time as well as morning, evening, night etc.
They often tell the rough temperature in words like warm, very warm, cold very cold etc.
With the 256 LEDs to play with there are huge amounts of different display modes available.
These clocks are quite complex to build due to the number of connections in the matrix display.
Building the LED matrix on PCBs with surface mount components allows for very slim clock bodies and makes the display construction simpler but above 500mm x 500mm the PCBs start to get expensive.
Hand building the LED matrix as in my clock needs space and 500mm x 500mm is a good starting point as this can just about accommodate the large wiring looms
needed to interconnect the LEDs and display modules. Very large wall filling clocks can be built using hand built LED matrixes.
below 256 matrix Word Clock by Wouter Devinck
This clock is based on the original Word Clock by Wouter Devinck full details on Facebook Instructable GitHub and the "Catalan" Pijuana Word Clock software based on Wouter Devinck's clock (this is a fork off the original Wouter Devinck design) here GitHub.
This clock is a mixture of the Wouter Devinck Clock hardware & the "Catalan" Pijuana clock software. I have not used any PCBs just ready made modules and three small Vero board circuits for the power.
The main changes are detailed below.
No custom PCBs are used in this version of the clock just cheap easy to come by prebuilt modules.
The main clock body is built from 2 x sheets of 14 mm MDF rather than a single 18mm sheet.
The rear sheet is 10mm smaller than the front sheet on all sides except the top so the clock appears to be only 14mm thick.
The Wouter Devinck clock is just 20mm deep including the 2mm glass whereas my clock is actually 34mm deep including the 4mm glass and 2mm dust seal on the rear.
Due to the setback of the rear 14mm panel and the 1.5mm setback of the glass panel from most angles the clock only looks 14mm deep.
This extra depth has allowed me to use a hand built LED matrix and wiring looms rather than 4 large PCBs.
It also means I can use prebuilt maintenance friendly modules without surface mount ICs on the MAX7219 boards.
The main display is built direct to the display LEDs with no PCB so any size display is possible.
TTP223 Touch Sensor Modules are used instead of Azoteq IQS127D mounted on the main boards as I was unable to source the IQS127Ds.
The display driver boards for the MAX7219 I/C use modified LED matrix boards. These boards come complete with all components.
An Arduino Nano is used to drive the clock due to it's small size.
A PIR sensor module is used to shutdown the display when no one is in the room (this can be disabled to keep the display always on).
A trimmer resistor has been added to the circuit, accessible from the bottom of the clock with a small flat bladed screwdriver to calibrate the automatic display brightness.
Synchronisation to my master clock system every minute on 30 seconds. If no synchronisation pulse is available the clock will free run using the RTC. Synchronisation pulses are displayed on the main display.
Auto summer & winter time correction from a Master Clock added. If you don't have a Master Clock time defaults to wintertime and can be manually changed as normal. A manual summer winter switch can also be added if required.
The software is mainly based on the "Catalan" Pijuana version of the word clock so this has been translated into English for the display.
Credits display modified from the "Catalan" Pijuana" version to show the current software version number, my name and also the year of build.
The worded temperature has been removed from the clock display and a linear seconds display added to the bottom row of the Word, Digital & Analogue clocks.
When the PIR is turned On or Off "PIR ON" or "PIR OFF" is displayed for a few seconds on the word clock display.
This clock uses a DS3231 AT24C32 I2C Precision Real Time Clock Module as per the Wouter Devinck Clock & the "Catalan" Pijuana clock. I am not keen on using the
Lithium-Ion rechargeable battery that is supplied with the module. I use a non rechargeable battery and have modified the module to suit.
4mm float glass with polished edges replaces the 2mm glass.
The glass is fixed to the main MDF board using Chicago Fasteners rather than glue. These also act as touch pads to control the clock and allows the glass can be removed if required.
Two dust seals are built into the clock, one on the rear panel and one behind the removable glass display panel.
In clock setting Mode pressing the BOT Right button now resets seconds to 0.
The following changes to the English wording have been made
These are mainly down to personal preference as there are so many different ways to say the time.
Removed the words indicating the temperature on the word clock. These have been replaced with Sync status, PIR ON/OFF and Linear display of seconds.
Changed "MINUTES" to "MINUTE" at 1 minute past and 1 minute to the hour.
Added an "A" before the "QUATER" past and "QUATER" to the hour.
Added the missing "ELEVEN" from Wouter Devinck clock as per his notes.
At Midday changed the time to read TWELVE OCLOCK IN THE AFTERNOON.
At Midnight changed the time to read TWELVE OCLOCK AT NIGHT.
After 01:00hrs the clock will always say IN THE MORNING.
Auto display dimming using an LDR
Auto display On/Off using a PIR sensor module
Display 4mm float glass, 16x16 matrix, 256 White 5mm LEDs output 13000mcd each
Dimensions 503mm x 503mm x 34mm
8 display modes Credits, Word Clock, Digital Time, Temperature & Humidity, Analogue Clock, Game of Life, Simon & Tetris
Battery backup of time using a real time clock
As my clock does not use custom Display matrix PCBs with surface mount components my clock case has to be somewhat deeper than Wouter's design.
My case is 34mm deep and includes the rear dust seal 2mm, rear MDF board 14mm, front display board 14mm and 4mm float glass.
Wouter's case is just 21mm deep, 18mm single MDF panel and 2mm float glass.
below my 34mm deep case layer makeup
In order to make my clock appear less bulky to the eye when mounted on the wall I have incorporated a few simple design features.
|The two images
below show the case design differences. My clock is on the left
and Wouter's case is on the right.
From an extreme side angle view you can clearly see my case looks bulkier. This is offset somewhat by the rear board being black rather than white making your eye concentrate on the slim white 14mm edge. The rear board being 10mm shorter on the bottom and both sides enforces this illusion.
|34mm Deep Twin Board Dual Edge Colour Design||21mm Deep Sigle Board Single Edge Colour Design|
The further towards the front of the clocks you go the shorter rear board on the left clock disappears from view until only the slim 14mm front board is visible.
The 4mm glass is also cut 1-2mm shorter than the front board helping to hide it from view.
The bulky 34mm clock now appears to be just 14mm deep.
|34mm Deep Twin Board Dual Edge Colour Design||21mm Deep Sigle Board Single Edge Colour Design|
There are TTP223 touch control modules on the clock, top left, top right, bottom left and bottom right corners of the display.
The buttons have different functions depending on what mode the clock is in, see chart below.
|Clock Mode||Top Left||Top Right||Bottom Left||Bottom Right|
|Credits||Previous Mode||Next Mode||None||None|
|Word Clock||Previous Mode||Next Mode||PIR On (Enabled)||PIR Off (Display always on)|
|Digital Clock||Previous Mode||Next Mode||Set Time||Set Time|
|Temp/Humidity||Previous Mode||Next Mode||None||None|
|Analogue Clock||Previous Mode||Next Mode||None||None|
|Game of Life||Previous Mode||Next Mode|
|Simon||Previous Mode||Next Mode||Start Game||Start Gane|
|TETRIS||Previous Mode||Next Mode||Start Game||Start Game|
|Digital Clock||Button Location|
|Sub Menu||Top Left||Top Right||Bottom Left||Bottom Right|
|Set Time (Hours)||Hour Decrement||Hour Increment||Set Minutes/Accept Time||Reset Seconds to 0|
|Digital Clock||Button Location|
|Sub Menu||Top Left||Top Right||Bottom Left||Bottom Right|
|Set Time (Minutes)||Minute Decrement||Minute Increment||Set Hours/Accept Time||Reset Seconds to 0|
|Sub Menu||Top Left||Top Right||Bottom Left||Bottom Right|
|Game Contols||Select Top Left||Select Top Right||Select Bottom Left||Select Bottom Right|
|Sub Menu||Top Left||Top Right||Bottom Left||Bottom Right|
|Game Contols||Move Left||Move Right||Select Bottom Left||Select Bottom Right|
|On startup or if mode 1 is selected the clock displays the following|
On each touch of the top right button the following clock & info displays are shown
Temperature & Humidity
Touching the left button steps backwards
below the four clock & info modes
There are 3 games built into the clock.
Conway's Game of Life
The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells,
each of which is in one of two possible states, alive or dead, or "populated" or "unpopulated".
Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically,
or diagonally adjacent. At each step in time, the following transitions occur:
The initial pattern constitutes the seed of the system.
The first generation is created by applying the above rules simultaneously to every cell in the seed
births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes
called a tick (in other words, each generation is a pure function of the preceding one).
The rules continue to be applied repeatedly to create further generations.
Simon memory game
When entering your sequence double tap the last entry to end your turn.
Tetris is the Soviet tile-matching puzzle video game released in June 1984.
This game still needs some work on the buttons to control the tiles. Corrected in v3.8.
The Clock can be prototyped and tested using the original DOT Matrix LED on the MAX7219 display board.
Note this temporary modification is only required if you want to test your code on the DOT matrix displays supplied with the MAX7219 modules.
This means you can try out your software/word layout modifications in miniature before committing to the full size version.
The wiring to the DOT Matrix LED will have to be modified to match the software connections.
The pic below shows how the Module is wired before modification.
The modification is quite straight forward.
First of all bend the following LED Matrix pins 90°, the top pins up and the bottom pins down.
Pins 16, 15, 3, 4,10 & 11.
Insert the LED Matrix in the socket on the display PCB the above pins will now not be connected.
Solder the following link wires from the back of the socket of the display PCB to the LED Matrix pins that are sticking out.
LEDA to Dot Matrix Pin 16
LEDB to Dot Matrix Pin 15
LEDG to Dot Matrix Pin 3
LEDF to Dot Matrix Pin 4
LEDE to Dot Matrix Pin 10
LEDC to Dot Matrix Pin 11
The Table below shows where the software pin number differ from the LED pin numbers on the display board.
MAX7219 Dot Matrix Module Wiring Test program
I have modified the Word Clock sketch to enable the MAX2719 Module to be tested after the wiring mod.
All this program does id light each LED in turn from the top left to the bottom right of the matrix.
Just connect 5 wires to the NANO and MAX2719 Module and power the NANO from it's USB port.
Load the sketch and let it run.
To test your word layouts print out a miniature version of your word display 62mm x 62mm on plain white paper.
Cut the printed layout into quarters.
These will then fit over the four LED Matrix displays.
Note the rotation of the MAX2719 modules.
The individual LEDs will light up the letters.
Note the orientation of the LED Display boards to match the software layout.
Fully working prototype on my test bench.
The small push button below the temp/humidity sensor is used to test the 30 second synchronisation.
The touch button modules are on the bottom left of the breadboard mounted sideways.
There are very few wires to connect on the main part of the clock so building the prototype is very simple.
Most wiring on the actual clock is on the LED display.
Time to Word Mapping Chart
The chart shows how each minute of the day is mapped to words.
|1||ONE||IN THE MORNING||1||ONE||MINUTE PAST|
|2||TWO||IN THE MORNING||2||TWO||MINUTES PAST|
|3||THREE||IN THE MORNING||3||THREE||MINUTES PAST|
|4||FOUR||IN THE MORNING||4||FOUR||MINUTES PAST|
|5||FIVE||IN THE MORNING||5||FIVE||PAST|
|6||SIX||IN THE MORNING||6||SIX||MINUTES PAST|
|7||SEVEN||IN THE MORNING||7||SEVEN||MINUTES PAST|
|8||EIGHT||IN THE MORNING||8||EIGHT||MINUTES PAST|
|9||NINE||IN THE MORNING||9||NINE||MINUTES PAST|
|10||TEN||IN THE MORNING||10||TEN||PAST|
|11||ELEVEN||IN THE MORNING||11||ELEVEN||MINUTES PAST|
|12||TWELVE||IN THE AFTERNOON||12||TWELVE||MINUTES PAST|
|13||ONE||IN THE AFTERNOON||13||THIRTEEN||MINUTES PAST|
|14||TWO||IN THE AFTERNOON||14||FOURTEEN||MINUTES PAST|
|15||THREE||IN THE AFTERNOON||15||A QUARTER||PAST|
|16||FOUR||IN THE AFTERNOON||16||SIXTEEN||MINUTES PAST|
|17||FIVE||IN THE AFTERNOON||17||SEVENTEEN||MINUTES PAST|
|18||SIX||IN THE EVENING||18||EIGHTEEN||MINUTES PAST|
|19||SEVEN||IN THE EVENING||19||NINETEEN||MINUTES PAST|
|20||EIGHT||IN THE EVENING||20||TWENTY||PAST|
|21||NINE||AT NIGHT||21||TWENTY ONE||MINUTES PAST|
|22||TEN||AT NIGHT||22||TWENTY TWO||MINUTES PAST|
|23||ELEVEN||AT NIGHT||23||TWENTY THREE||MINUTES PAST|
|24||TWENTY FOUR||MINUTES PAST|
|26||TWENTY SIX||MINUTES PAST|
|27||TWENTY SEVEN||MINUTES PAST|
|28||TWENTY EIGHT||MINUTES PAST|
|29||TWENTY NINE||MINUTES PAST|
|31||TWENTY NINE||MINUTE TO|
|32||TWENTY EIGHT||MINUTES TO|
|33||TWENTY SEVEN||MINUTES TO|
|34||TWENTY SIX||MINUTES TO|
|36||TWENTY FOUR||MINUTES TO|
|37||TWENTY THREE||MINUTES TO|
|38||TWENTY TWO||MINUTES TO|
|39||TWENTY ONE||MINUTES TO|
I use a common 12 volt power supply unit to drive many different types of circuits throughout my house. This 12 volt supply is then stepped down locally at each circuit with a 5 volt module to supply power for the control board and various modules.
If you are running just this one circuit then any regulated 5volt supply will do as long as it can supply the current for your circuit use.
below my common power supply has 18 individually fused 12v circuits each with a 2A fuse. 9 of these are battery backed up.
Clock boards also have their own on board fuse.
The local PSU module uses a MP1584 miniature Power supply to convert the 12v input to the 5v for the clock.
There are two extra power boards constructed from Vero board. Apart from 1 holding the buzzer they just add extra power distribution points for the power wiring of the clock.
I have measured the current draw from the clock and at low brightness it uses 30mA and full brightness 250mA.
This will of course vary with how many LEDs are on.
On a bright sunny day the brightness levels indicated on the serial out are 10. This is around 2 thirds of the max power of the LEDs.
Overall power consumption can be greatly reduced if the PIR is turned on. This will blank the display if movement is not detected by the clock.
Order of build
Get vinyl transfer printed.
Get glass cut.
Cut MDF Sheets front and back.
Cut holes in front sheet for LEDs.
Paint MDF Sheets.
Cut holes for sensors in glass.
Stick Vinyl transfer to rear of glass.
Cut sensor holes in MDF front board.
Cut sensor module rebates in front board.
Cut MDF back board and make 4 access holes for sensor access.
Add melamine edge strips to MDF boards, white to front board and black to rear board.
Screw back MDF board to front MDF board.
Make Vero boards, 1 power board and 2 power distribution boards.
Modify 4 x MAX7219 boards and add wiring to LEDs. Connect at MAX7219 end only for now.
Mount all modules and Vero boards. on rear of MDF front board.
Construct all 4 LED matrixes on front MDF board and solder 256 LEDs.
Wire all Batt and Earth runs from power supply Vero board and power distribution boards.
Connect all power runs to all modules.
Connect all wiring to Nano, MAX7219 modules, RTC , Temp sensor, Touch Sensors and Buzzer.
Connect all wiring looms from modified MAX7219 boards to LED Matrixes as per wiring table.
Connect a PIR module remotely from the clock and connect the PIR connection.
Connect the 30 second sync to your Master Clock.
Mount the Glass front display panel using the Chicago bolts also fixing the touch sensors at the same time.
Approximate Build Times
|Part||Ebay item UK||Qty|
|10K Resistor 1/4 W||4|
|20K Variable Resistor||1|
|Electromagnetic Piezo Buzzer 5v||181778719109||1|
|TTP223 Touch Sensor Module||4|
|DHT22 Temperature & Humidity Sensor||1|
|DS3231 AT24C32 I2C Precision Real Time Clock Module||1|
|CR2032 Battery (replaces rechargable RTC battery)||1|
|Vero Board 35 x 10 holes min||1|
|MP1584 miniature Power supply module||1|
|12v 1a PSU||1|
|MAX7219 Dot Matrix 8x8 Led Display Module||4|
|2.54mm 0.1" Male Pin Headers Single Row right angle||4|
|Vero pin Pack||1|
|LEDs White 13000mCD 120°||256|
The Vinyl sticker is designed in Inkscape. Inkscape is professional quality vector graphics software which runs on Windows, Mac OS X and GNU/Linux.
It is used by design professionals and hobbyists worldwide, for creating a wide variety of graphics such as
illustrations, icons, logos, diagrams, maps and web graphics. Inkscape uses the W3C open standard SVG (Scalable Vector Graphics)
as its native format, and is free and open-source software.
I downloaded the original Inkscape design by Wouter Devinck from his GitHub repository and then modified it in Inkscape to suit my design.
I tried out many different versions on my miniature prototype before sending the final design off to be printed.
Don't forget to get the sticker reverse printed!
I used a company called Regal Signs & Graphics who supplied my sticker in black vinyl, reverse cut, lettering weeded out and supplied with an application tape all for around £27 inc vat.
Although they are quite local to me I paid a bit more and got my sticker delivered in a nice secure cardboard tube.
I had a few problems getting the design in the correct format for their machine but in the end I sent it from Illustrator in eps format the very helpful people at Regal Signs scaled it down to the correct size for me.
My Inkscape file can be downloaded here VINYL STICKER.
Below edit your design in Inkscape
The Vinyl sticker came from Regal Signs with the letters weeded out so this saved me lots of time.
The sticker comes with a plastic tape over the front (glass) side and an application paper on the rear.
Usually you peel the from side tape off apply the sticker and then remove the application paper.
I decided to leave the application paper on as it acted as a diffuser for the LEDs.
As I was leaving the application paper on I trimmed off the excess paper around the sticker before applying.
Vinyl Sticker trimmed ready for application.
The sticker application was relatively easy. Just make sure you watch a few YouTube videos on Vinyl sticker application to glass before trying it yourself.
I cleaned the glass first with acetone and made sure it was dust free.
I then put on some plastic gloves to make sure I did not get any finger prints on the sticker.
I spayed the glass with a very diluted soap and water mixture and then very slowly peeled back the plastic film from the sticker to reveal the front surface.
It is important to peel the film back slowly and at a very acute angle so the letters on the sticker stay connected to the transfer paper.
Once the sticker is completely exposed apply it to the wet glass surface. The water/soap mixture will allow you to move the sticker to the correct place on the glass.
Next use a credit card and work away from the centre of the sticker to remove any air bubbles.
Leave the sticker to dry overnight then from the back of the sticker cut away the vinyl over the 4 mounting holes in the glass.
The main board of the clock is made up of 2 sheets of 14mm MDF. The rear sheet is 10mm smaller than the top sheet on all sides apart from the top.
The top has white edges while the back has black edges. When viewed on the wall the clock will then appear to be 14mm deep.
below the back board is setback from the front board
On the original Wouter Devinck Clock & the "Catalan" Pijuana version a single 18mm thick sheet of MDF is used with the back routed out to make space for the PCB and components.
Using 2 sheets of MDF means the back board can be simply cut out using a jigsaw rather than the time consuming and dusty routing.
The top sheet is 503mm x 503mm to give a 1.5mm overlap around the glass. This will give the glass a bit of protection from knocks.
The backboard is cut out using a jigsaw and allows 14mm of component space.
The deepest PCB including components are the MAX 7219 modules that are 10mm deep.
On completion the rear board is glued or screwed to the front board.
Front Board Construction
The front board holds the 256 LEDs that shine through 6.5mm holes and wider 18mm countersunk holes to illuminate individual letters and numbers on the display.
The board is marked up to show the drilling position of in the centre of each display character.
Using a 500mm display I measured my vinyl sheet and the characters are 25mm apart starting 62.5mm from the edges.
I drew these lines on the MDF, the intersections being the drilling points.
I used the top edge as the datum point I measured and marked each row from this point.
This was repeated for the vertical column using the left edge as the datum.
The intersections of the grid will be the centre point for the 6mm LED mounting holes and the 18mm countersunk holes.
Using an automatic centre punch ( use a nail or screw if you don't have one) I punched the 256 intersection points of the grid.
These punched marks will act as a guide for the 6mm drill bit for the LED mounting holes.
Using a drill bit to suite your LEDs (6mm in my case) and using the punched holes as a guide for the drill bit drill out all 256 LED mounting holes.
The next task is to drill the 256 18mm countersunk holes using a 20mm countersinking bit.
To keep the countersunk holes at a uniform depth and width I built a countersinking jig using an off cut of wood.
To make the jig a hole is drilled in the wood off cut to just fit the silver rotating bezel of my drill chuck.
Using a test piece of MDF the countersinking bit is then moved in and out of the chuck until a countersunk hole of the correct diameter is made when drilling through the hole upto the chuck in the off cut of wood.
Once the correct distance is found the chuck is tightened and the main board is drilled 256 times by centring the hole in the wood over the existing 6mm holes then drilling down until the chuck bezel hits the hole in the countersinking jig.
Completed front board with 256 countersunk holes and 6mm holes for the LEDs.
The board is then rubbed down and primed using MDF primer and painted white so the countersunk holes reflect the light from the LEDs.
A black edge is painted around the outside edge to hide the board as the glass is 1mm shorter all round.
To hide the bare MDF edges Iron on Melamine/Laminated Edging is applied.
White to the top board edges and black to the rear board edges.
See video below on how to apply Melamine Edging.
Four 5mm holes are then drilled in the corners to take the Chicago Fasteners.
The Chicago Fasteners hold the glass in place, hold the touch sensors and provide a touch sensitive pad on top of the glass.
The fasteners have 3mm shafts and will have a small bit of rubber tape wrapped around the shafts to protect the glass.
Turn the board over and drill a rebate with a forstner bit to take the four touch sensors.
This hole will be offset from the hole drilled in the previous step.
The clock uses 4mm float glass and has been cut to exactly 500mm x500mm. As the edges are exposed the edges have also been polished.
This was all done by my local glaziers for £20.
5mm holes were then drilled in the glass panel using a 5mm glass drill.
Touch Sensor Mounting
See cutaway section through mounting bolt below.
The touch sensor modules are fixed to the front panel using the glass mounting bolts. The mounting bolts then act as touch sensors.
A 5mm hole is drilled through the sensor pad on the module to allow the glass mounting bolt to pass through.
The sensor pad is insulated by the MDF panel and a plastic washer.
The touch pad on the sensor module has a 5mm mounting hole drill through the sensor.
Touch sensors in rebates behind rear panel. Holes drilled into rear panel allows access to the Chicago Fasteners that hold the sensors/glass front in place.
Clock front panel with touch plates.
Atmega 328 Pin Connections
Pin label numbers refer to Arduino IDE number
Arduino Nano Pin Connections
The LEDs were purchased from Bright Components
5mm White Flat Top LEDs offering a pure and
consistent colour with a wide angle ultra bright light output.
Colour : White
Quantity : 256
Lenses Type : Round Flat Top Crystal Clear
Brightness : 13000mcd
Forward Voltage : 3.2v - 3.8v
Forward Current : 20mA (typical), 30mA (Max)
Viewing Angle : 120 degrees
DHT22 Temperature & Humidity Sensor
The DHT22 is a basic, low-cost digital temperature and
humidity sensor. It uses a capacitive humidity sensor and a thermistor to
measure the surrounding air,
and sends out a digital signal on the data pin.
You can only get new data from it once every 2 seconds, so sensor readings can be up to 2 seconds old.
Simply connect the first pin on the left to 3-5V power, the second pin to your data input pin and the right most pin to ground.
To prevent the temperature of the inside clock case being measured the top and left side vent of the DH22 are covered over with tape.
This also stops dust being drawn into the clock case.
below view of the lower edge of the clock from the rear showing the air circulation vents.
The DHT22 is mounted with it's right open side mounted tight against the lower rear cover.
Two small holes are drilled in the lower edge of the rear MDF board to allow air from the room to circulate around the sensor.
Additionally, some pins have specialized
The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the FTDI chip and USB connection to the computer (but not for serial communication on pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Nano's digital pins. The ATmega328 also support I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of the I2C bus. To use the SPI communication, please see ATmega328 datasheet.
TTP223 Touch Sensor Module
The Touch Sensor Module is bolted to the front panel using the glass mounting bolts. The bolt goes through a 5mm hole drilled in the middle of the sensor.
Note the mounting bolt is touched to trigger the sensor but is insulated from the sensor itself through plastic washers.
Four of these modules are used in the clock one mounted on each corner of the glass.
Note the LEDs are not required and are removed from the modules to save power.
Modification of DS3231 AT24C32 I2C Precision Real Time Clock Module
My clock uses a DS3231 AT24C32 I2C Precision Real Time Clock Module.
The module comes supplied with a Lithium-Ion rechargeable battery see diagram above. I use a non rechargeable battery so have removed resistor R5
from the module as below.
Location of R5 on the DS3231 module.
Charging Resistor R5 removed.
MAX7219 Display PCB with LED Matrix removed
MAX7219 Display PCB Rear
MAX7219 LED current limiting
The max current through the LEDs is set by a single resistor R1 on the module.
The value of resistor can be found from the following table.
The module comes with a 10K resistor preinstalled but this can be removed and a resister to match your LEDs current added in it's place.
My LEDs Forward Voltage is 3.2v - 3.8v @ 20mA. They can handle 30mA max but for long LED life 20mA is best.
I have used 22KΩ resistors which will limit the current to around 20mA when the light levels are at their peek.
|RSET value in KΩ|
1088AS LED Dot Matrix display view of lower edge Pins 1 to 8 left to right
Main Board Modules
Four of these display boards are required making 256 LEDs in total.
Note the LED display matrixes are rotated anti-clockwise 90 degrees from each other starting from display matrix 01.
This was a design feature of the original clock due to PCP constraints. I have replicated it on my clock in case you want to build my version using Wouter Devinck's display PCBs.
Display Matrix 01 input is wired to the Arduino CLK,DIN and LOAD the output is taken to the input of Display matrix 02 etc etc.
The module locations are shown below. The four sensors are located in the recesses on the main board behind the rear board.
Holes are cut into the rear board to allow access for fit the Chicago Bolts/Sensor pads.
The four MAX7219 Display Modules are soldered together and are mounted in the centre top of the board.
This keeps the data links between the boards as short as possible.
The Arduino Nano is mounted on the left of the MAX7219 Display Modules and the RTC on the right.
The RTC battery holder on the base of the RTC module is recessed into the main board.
The Vero board containing the power module is located on the lower part of the board.
There are two power distribution boards mounted on the top of the clock. The main 5v 2A feed cable is taken to both of these boards and power is then distributed
to the other boards from these points.
The MAX7219 board power is fed from the left board and daisy chained through each board then taken out the forth board to ensure they are fed with 0v and 5v from both ends.
The LED locations are shown below. The LED matrixes each contain 64 LEDs and are labelled 1 to 4.
These correspond to the 4 MAX 7219 modules mounted above numbered 1 to 4 left to right.
The LED Matrixes are built up off 2 types of BUS Bars per module. A Cathode Bus at 10mm high and an Anode BUS bar at 2mm high.
There are 8 Cathode and 8 Anode BUS Bars per module.
Each module has 16 x 15mm panel pins hammered into the board in the position shown to support the 10mm high Cathode BUS.
The 15mm panel pins are hammered in 5mm (I used a 10mm piece of metal bar as a gauge) leaving 10mm as Cathode BUS bar support pins.
As shown below the pins correspond with the thick parts of the board not the recess for the LEDs on the front of the board.
0.9mm copper wire is then soldered to each pair of pins to form the Cathode BUS Bar.
Not the rotation of each module and also the modules are in reverse as it is the back of the board the LEDs are connected to.
The Anode BUS Bars are shown below in Red and are supported off each LED Anode about 2mm off the MDF board.
Both Cathode & Anode BUS Bar locations are shown below.
Each LED is connected to an Anode and Cathode of the Matrix.
The LEDs are bent in a jig to keep the position in the display constant and to speed up construction.
Each LED has four bends two on each leg that's 1024 in total. The Cathode leg is bent 90° from the Anode.
LED Matrix Wiring Schedule viewed from the rear
The LEDs are connected to the matrixes and MAX7219 modules from the rear.
The LED positions will be reversed and of course rotated 90° relative to the next module.
This makes it very complicated connecting the correct LEDs and Bus bars from the rear of the board.
The table below shows the LED positions in the blue boxes with the BUS Bar matrix position in black around the outside as they appear from the back of the front MDF board.
|MODULE 02||MODULE 03|
|BUS||LED 7||LED 6||LED 5||LED 4||LED 3||LED2||LED 1||LED 0||LED DP||LED G||LED F||LED E||LED D||LED C||LED B||LED A||BUS|
|LED A||D72||D71||D70||D69||D68||D67||D66||D65||D192||D184||D176||D168||D160||D152||D144||D136||LED 7|
|LED B||D80||D79||D78||D77||D76||D75||D74||D73||D191||D183||D175||D167||D159||D151||D143||D135||LED 6|
|LED C||D88||D87||D86||D85||D84||D83||D82||D81||D190||D182||D174||D166||D158||D150||D142||D134||LED 5|
|LED D||D96||D95||D94||D93||D92||D91||D90||D89||D189||D181||D173||D165||D157||D149||D141||D133||LED 4|
|LED E||D104||D103||D102||D101||D100||D99||D98||D97||D188||D180||D172||D164||D156||D148||D140||D132||LED 3|
|LED G||D120||D119||D118||D117||D116||D115||D114||D113||D186||D178||D170||D162||D154||D146||D138||D130||LED 1|
|LED DP||D128||D127||D126||D125||D124||D123||D122||D121||D185||D177||D169||D161||D153||D145||D137||D129||LED 0|
|MODULE 01||MODULE 04|
|LED 0||D1||D9||D17||D25||D33||D41||D49||D57||D249||D250||D251||D252||D253||D254||D255||D256||LED DP|
|LED 1||D2||D10||D18||D26||D34||D42||D50||D58||D241||D242||D243||D244||D245||D246||D247||D248||LED G|
|LED 2||D3||D11||D19||D27||D35||D43||D51||D59||D233||D234||D235||D236||D237||D238||D239||D240||LED F|
|LED 3||D4||D12||D20||D28||D36||D44||D52||D60||D225||D226||D227||D228||D229||D230||D231||D232||LED E|
|LED 4||D5||D13||D21||D29||D37||D45||D53||D61||D217||D218||D219||D220||D221||D222||D223||D224||LED D|
|LED 7||D8||D16||D24||D32||D40||D48||D56||D64||D193||D194||D195||D196||D197||D198||D199||D200||LED A|
|BUS||LED A||LED B||LED C||LED D||LED E||LED F||LED G||LED DP||LED 0||LED 1||LED 2||LED 3||LED 4||LED5||LED6||LED 7||BUS|
Below close up section of Module 1 wiring.
The Cathode BUS Bars run vertically and the Anode BUS Bars run horizontally on this module.
The Anode & Cathode BUS Bars have an 8mm vertical separation.
Diagram showing Bus Bar layout with panel pins supporting the Cathode Bus. This module has horizontal Cathode and vertical Anode Bus Bars.
Photo showing Bus Bar connections to LEDs and wiring to MAX2719 modules.
Note I ran out of 0.9mm tinned wire and used bare copper 0.9mm wire for some of the modules.
Rear left of clock showing completed wiring
The Matrix grids are wired to the corresponding pins on the MAX7219 modules according to the layout below.
There are 16 wires to each module.
Module LED Matrix Wiring Colour Code is shown below.
Each Module has 16 wires connecting it to the LED Matrixes.
I have used 50pr 0.5mm cable so the last 14pr colours are duplicated.
On Mod 4 I went out of order and missed out the Sl/Vi at the start so have put it in at the end.
|MAX 7219 Mod 01||MAX 7219 Mod 02||MAX 7219 Mod 03||MAX 7219 Mod 04|
Before wires can be connected to the MAX 2917 modules they will need to be modified.
Two sets of 8 90° pin connectors will to be soldered to the lower edge of the existing LED matrix connector.
Modified MAX7219 module with 90° pin connectors soldered in place to the bottom of the old LED Matrix connectors.
Wires are taken away from these points to the LED matrix on the main MDF board as per the LED Matrix Wiring Colour Code table above.
Side view showing the pins soldered to the side of the old LED Matrix connector pins just above the PCB.
To speed up wiring from the MAX2719 modules to the LED Matrix I split the 50 pair cable into blocks of 16 wires. Solder the wires to the MAX 2719 modules first then
screw the MAX 2719 module in place and run the 16 wires from the module to the corresponding LED Matrix.
To prevent ingress of dust two dust seals are fitted.
On the rear MDF board a 2mm soft foam rubber dust seal is fitted. When the clock is hung on it's hanging hooks the seal is under pressure
and seals the back of the clock to the wall. The seal is self adhesive and is fitted with a 5mm gap to the edge of the rear MDF board.
On top of the front board to prevent dust getting under the glass a strip of self amalgamating rubber is fitted 5mm from the board edge.
To prevent the glass from cracking when the Chicago bolts are tightened 4 small square of rubber are also fitted around the holes in the glass.
I punched holes for the Chicago Bolts in the rubber with a leather punch.
Dust seal in position on front board.
An LDR is used to sense the ambient light levels.
The LDR is around 500Ω in bright light and 10MΩ in the dark.
The LDR is positioned underneath the clock on the rear MDF panel.
Next to the LDR is a hole to give access to the trimmer resister to calibrate the LED brightness control.
Setting Automatic Brightness Levels
The clock automatically senses the ambient light and adjusts the LEDs accordingly.
When first installed the clock will need to be calibrated to the maximum light levels in it's actual location.
Connect a mobile, laptop/tablet etc via a suitable cable to the mini USB port of the clock and open an app to monitor the serial port.
I use Slick USB 2 Serial Terminal on my S7 via an OTG cable and USB to mini USB cable.
The clock will reboot and after the initial start screen you will see the following data updating down the screen.
You don't need to worry about lightReading or constrained lightReading+hyster just light reading, and bright.
With the clock in position and the ambient light at it's maximum levels carefully insert a flat bladed jewellers screwdriver into the access hole just to the right of the light sensor.
Turn the screwdriver slowly until the light reading = 600 (or your level set in brightness.cpp) and bright = 15.
Your clock will now go to max brightness when the ambient light is at it's maximum.
If you turn the screwdriver too far the light reading will go over 600 but the bright reading will not increase.
If you want the clock to be dimmer right across the range of ambient light levels adjust the light reading to a level less than 600 at max ambient light levels.
Note when bright=15 this will output the max current to the LEDs. The max current is set by R1( RSET) on the MAX7219 module and this should be chosen for your type of LED used in the display.
Setting and Synchronising the clock
The clock is set in the digital clock mode by touching the bottom left sensor.
The hour digits will now flash twice a second to indicate the clock is in time setting mode.
In this mode the sensors have the following functions.
Top right - steps the hours or mins digits up
Top left- steps the hours or mins digits down
Bottom left 1sr press - enters the time setting mode selecting hours digits
Bottom left 2nd press -selects the mins digits for changing
Bottom left 3rd press -exits time setting mode
Bottom right - resets the seconds to 00
If you have connected a 30 second master clock sync cable then the clock will jump back or forward to 30 seconds when out of time setting mode.
Just reset the seconds roughly in sync to the seconds (within 10 seconds either way) and wait for the clock to sync once out of time setting mode.
The animated loop below shows the Word Clock is running fast by several seconds. A synchronisation pulse is received from the Master Clock every 30 seconds synching the clock to 30 seconds.
The clock will ignore the 30 second synchronisation pulse from the Master Clock at 0 seconds.
Note from v3.3 clock synchronisation only happens when the Word Clock is 20 seconds past and 20 seconds to a minute.
In normal operation the sync pulse corrects the clock to within a fraction of a second so you will see the word "SYNC" appear with no visible correction to the seconds.
Note the synchronisation pulse is received every 30 seconds but the clock will ignore pulses at 0 seconds.
Automatic Summer to Winter Change
Normally summer and winter time changes are made by manually changing the hour through the clock setting function.
The clock can be automatically set to summer or winter time by using the "BST" input on Digital pin 7.
5volts on this pin will add an hour and 0volts will take an hour off.
I have programmed one of my Pragotron Master Clocks to output 0v in wintertime and 5volts in summertime.
If you do not have a Master Clock and don't want to set the clock through the clock setting function you can just connect digital pin D7 on the NANO to 5volts via a switch as per the diagram below.
When the switch is on the clock shows summer time and when the switch is off winter time is displayed.
The clock is fixed to the wall by two metal picture hanging mounts.
These are recessed into the frame so the highest point of the bracket is level with the frame.
Two 2" countersunk No6 screws sit in these bracket and hold the clock to the wall with a bit of tension so the dust seal is compressed.
PIR Controlled Display Shutdown
The PIR when enabled on the Word Clock menu (bott left PIR On, bott right PIR Off) turns on the display when movement is detected in the room.
When no movement is detected the display turns off after a set period of time.
When the PIR is enabled the displays shows "PIR ON" and when disabled (display always on) it shows "PIR OFF"
Note when the PIR is not enabled the display is always On.
The PIR module is fitted remote from the clock in a modified chrome light switch box.
The box is cut into a plasterboard wall and also contains a switch to turn the clock off.
A blank chrome switch plate and back box are used to house the power switch and PIR module.
Two holes are drilled in the blank switch plate for the power switch and PIR lens.
The hole are centre punched, pilot drilled and then drilled out just big enough for a step cutter to fit through.
The hole for the PIR diffuser is cut just big enough for the lens to go through with a friction fit.
The completed switch plate.
The 12 volt supply +ve is terminated on the switch with the 0v terminated on the earth screw.
12 volts is then fed back upto the clock PSU Vero board from the other side of the switch and again the earth screw.
5 volts are fed from the clock PSU Vero board to supply the PIR module. The 5 volts and PIR sensor wire to the clock terminate on PCB header sockets are is plugged into the PIR Module header pins.
The sync cable is terminated on a header pins and connects to the Master Clock 30 second sync cable via a single header socket.
The PIR has 2 trimmer resistors for adjusting sensitivity and also length of time the PIR & display stay activated.
PIR On Off Control
The PIR is turned On & Off in Word clock mode by touching the bottom left sensor to turn the PIR on or by touching the right sensor to turn the PIR off.
Note when the PIR is set to off the display stays on permanently.
When you change the PIR setting the work "PIR ON" or "PIR OFF" is displayed for 5 seconds.
When initial power up the default is PIR off if you switch the PIR On straight away the display will go off as the PIR takes a minute or so to initialise before detecting movement.
above & below "PIR ON" or "PIR OFF" are displayed for 5 seconds when PIR setting is changed.
Download Word Clock Manuals from One Drive
Program Files Modules
|character.cpp/.h||Character (digit) definitions|
|display.cpp/.h||Display & LED functions|
|life.cpp/.h||Game of Life|
|serial.cpp/.h||Serial port setup menu|
|simon.cpp/.h||Simon Says game|
|temphum.cpp/.h||Temperature & Humidity display|
|time.cpp/.h||Wordclock, digital clock|
|touchbuttons.cpp/.h||Touch buttons, mode switching|
Third party libraries:
|Chronodot.cpp/.h||Chronodot library (for DS3231)|
|DHT.cpp/.h||Temperature sensor library (for DHT22)|
|LedControl.cpp/.h||LedControl library (for MAX7219)|
|stc.cpp/.h/platform.h||Simple Tetris Clone library|
|pitches.h||Note frequencies from the Arduino webpage|
Download Code v3.5 Auto Summer to Winter change added
Download Code v3.6 Added missing word "EVENING" from 18:00hrs to 20:59hrs
Download Code v3.7 Found "THE TIME IS" was corrupting every now and then. Modified time.cpp to refresh "THE TIME IS" on every time computation
Download Code v3.8 Corrected touch buttons not working correctly in Tetris Game. Tetris.cpp modified by reversing "UP" & "DOWN" for each button
Download Code v4.2 Sync on 30 seconds updated
Download Code v4.3
replaced the display of the seconds (time.cpp lines 261 - 673 and 920 - 1329) by
the following two lines:
addWordToFrame(w_seconds[ int( s / 10 ) ] );
addWordToFrame(w_seconds[ int( s % 10 ) + 6 ]);
This decreases program size by 10%
Changing The Code