Home    Master Clock   LCD Master Clock    Kenley Weather

Section   Top    Intro   Features  Super Filter   Clock Case   Dot Matrix Disp Panel Const   Main 7 Seg Disp Const  Main Vero Board Layout    

RTC Disp Mod   PIR Module  RTC Mod   Remote Ctrl  DOT Matrix Disp Reading    DCF77 Code Animation   Schematic    Atmega 328 Pin Table    4K Video  Code

 

 

 

 

Arduino DCF77 Tower Clock & Signal Analyzer

 

This Clock displays the received & decoded DCF77 time code on three 8x8 dot matrix displays and time, date and signal info on four 8 digit 7 segment displays.

It uses 2 x Atmega 328 microprocessors  (Arduino Uno) , 1 to control the DCF77 Analyzer and 1 to control a Udo Klein Super Filter.

The Super Filter is switchable and will allow reception of the DCF77 signal from a very noisy signal.

 

 

Click to view full screen animation

 

 

This clock is based on a DCF77 Analyzer Clock by Erik de Ruiter.

above Erik de Ruiter's DCF77 Analyzer Clock

Erik has provided full details of his clock here on GitHub

See pictures of his clock here Flickr

and Arduino Project Hub

and his other amazing clocks here Flickr

 

 

 

 

 

 

 

Clock Functions/Features

Receive and display, second by second the DCF77 coded signal from the transmitter in Germany.

Display the received signal on a 8x8 dot-matrix display.

Once received and if error checked OK display the stored data on a 2nd 8x8 dot-matrix display, update the real time clock

& display time and date on the top two 7 segment display modules

Display signal error codes, signal status, day of the week and display intensity on a 3rd dot-matrix display

If received signal has errors use a real time clock to display the time.

Uses 7 segment display modules to show the buffer, DCF Bit, no of errors, Period Time & Pulse Width

Switchable DCF77 signal filtering provided on a 2nd Atmega 328 IC using software by Udo Klein

Remote controlled individual reset of DCF77 Analyzer & Super Filter, DCF77 sound On/Off and Super Filter status LEDs On/Off.

PIR controlled display auto blanking. Display will auto blank if no movement is detected near the clock.

 

New v60 software.

Erik de Ruiter has released his new v1.72 software with added features including parity checking and display.

My v60 software now incorporates this update including an updated 3rd matrix display showing parity checks.

See new parity display here

 

above close up of front panel

 

below DCF77 code for the next minute is received in the buffer (matrix 1 left) @ 1 bit per second

at the end of the minute and if error checked OK the buffer is loaded into the current display store (matrix 2 middle)

and the real time clock (RTC) is updated

matrix 3 right shows Day of week, display intensity, clock status and clock info

 

 

 

 

Super Filter

When switched on the Udo Klein's Super Filter actively processes the incoming DCF77 signal

from the Antenna/receiver. Over a number of days of learning the Super Filter can predict the DCF77 signal and use this

to determine if the incoming signal contains any errors. The Super Filter will then synthesize a corrected DCF77 signal even if the signal is absent.

 

Above. Super Filter example

The top row shows the Super Filter turned on.

Once synchronized and tuned into the signal the Super Filter will synthesize a good signal even when the signal is completely lost.

On a noisy signal the Super Filter will search for known signal bits and keep itself synchronized to the transmitter.

The bottom row shows the Super Filter turned off. Whatever signal is received (good or bad) is sent to the decoder.

 

Below Super Filter correcting a noisy signal as displayed on the DCF77 Scope

Normal Signal No super filter - Normal signal from the DCF77 reciever

Noisy Signal No Super Filter - The aerial is move near a LCD screen to generate noise over the signal

No Signal- The aerial is disconnected and moved connected via the super filter

Noise On Superfilter On- The noise is filter out leaving a perfect signal.

 

 

Note the Super Filter input is always connected to the incoming DCF77 Signal even if the Super Filter is turned off.

As the Super Filter can take a few days to tune to maximum accuracy this ensures it is always tuned/synchronized at maximum accuracy to the DCF77 signal.

 

 

 

 

Clock Case

 

The case for this clock is based on a Tesco Black Glass & Metal Lantern. The case has a hinged door that I have positioned on the right of the clock.

The top glass panels are a good fit for the 3 x dot matrix displays.

I have added 18mm MDF top and bottom sections as well as 2 x 6mm plywood pieces to replace the side glass on the small top panels.

These panels are sprayed in black silk to match the metal case. The original metal handle on top of the case is cut away and 2 slots to take the remnants of the handle are

cut into the top MDF panel.

Dimensions H27xW15xD15cm

                 

 

 

 

 

Construction

 

Dot Matrix Display Module Construction

Completed Dot Matrix Display Modules

 

 

 

The display uses 3x 8x8 dot matrix display modules with onboard MAX7219 ICs

 

 

A small aluminium bar is cut to size and 6 x holes are drilled to take the matrix module mounting bolts.

Note on pre-built modules the lower connectors may need to be de-soldered and re-soldered on the rear of the boards.

Use extra nuts and bolts as spacers over the exposed solder pads as required.

 

 

 

A clear Perspex sheet is then cut to size with mounting holes drilled and is fitted on top of the aluminium bar.

 

 

 

Print out the display on Lazertran decal transfer paper and fix to Perspex sheet making sure it is aligned with the dot matrix modules.

Let the paper dry and don't spray with acrylic varnish to keep the transfer opaque to act as a diffuser for the LEDs.

 

 

 

Add a final sheet of white paper behind the Perspex to complete the diffused effect. The heavier the paper the more diffused (and dimmer) the matrix LEDs will be.

You can offset this effect is the software by setting different intensity values for the 7 segment displays and matrix displays.

Note if you don't want to use Lazertran you could print the display on white paper and fix it behind the Perspex.

 

 

 

 

 

 

 

 

Main Display Board Construction

The main display board to house the four 7 segment displays is made up from 2 Cero boards bolted together with L shaped insulated aluminium angles.

On the finished clock the main Vero Board housing the twin Arduinos are fixed to the top six mounting bolts.

 

 

Vero boards bolted together to mount displays. Board fronts are sprayed black.

 

Connection strips are soldered to the display boards.

The four 7 segment displays plugged into connection strips, positioned marked by the four labels.

Power and serial connections for the displays are run on the from of the display board.

 

 

 

Vero Board Layouts & Mounting

Note board fronts are shown orange for clarity actual board fronts are spay painted black

 

Front of display boards showing 7 segment display connection strips

 

 

 

below 7 segment display modules mounted along with black wooden blocks for fixing Perspex neutral density contrast display cover

note black tape colon masking on top display module

 

 

 

7 segment display modules on without Perspex neutral density contrast display cover

 

 

 

same display but with Perspex neutral density contrast display cover fixed to wooden mounting blocks

 

 

Perspex neutral density contrast display cover with Letroset applied

 

 

 

Display Positions in Main Case

 

 

 

 

 

Rear (solder side) of display boards

 

 

 

rear of display boards with insulated aluminium angles bolted on

 

 

 

main board fixed to rear of display boards on aluminium angles

 

 

 

 

 

 

Main Vero Board

 

Vero Layout of main board front top and rear bottom the Atemga 328 on the controls the DCF77 Analyzer and displays.

The Atmega 328 on the right controls the Super Filter.

 

 

 

Display board with added  Microwave Radar Sensor RCWL0516 new to version 6.2.

The display will blank after 10 minutes of inactivity. Any activity in that 10 minute period will cause the timer to restart.

Note The time the module triggers is on top of this time. So if your Radar module goes low after 5 seconds the timer will start from then.

 

 

Microwave Radar Sensor RCWL0516 new to version 6.2.

Unlike the old PIR sensor this module uses Microwave Radar and can see through solid objects like Perspex and wood.

On my clock looking through a layer of glass and Perspex it has a range of around 4 to 5 meters.

 

 

 

 

Fully assembled main display

 

above & below assembled display and main board

 

 

 

 

 

 

Modification of the RTC Time 7 Segment Display Module to Show Colon Digit Seperators

The standard display only has decimal points to separate the digits

 

 

To display colons on digit 3 and 6 these 2 digits are set to display "o" lower case letter O permanently

This illuminates the bottom 4 led segments only

 

 

4 x strips of black plastic tape are then applied over the digits as below

 

 

when lower case "o" is displayed all you see is colons

 

 

 

 

 

PIR Detector and Module

The PIR sensor is mounted on the top of the clock with the PIR module PCB mounted on the underside of the lid.

Above. Case lid with handle and PIR Sensor Cover.The PIR sensor is de-soldered from the module PCB

and is fitted under the half blacked out sensor diffuser on the top of the lid.

Original sensor

 

The PIR sensor is de-soldered from the module PCB

and is fitted under the half blacked out sensor diffuser on the top of the lid.

Above PIR sensor fitted to PCB.

Below PIR PCB from below showing PIR sensor de-soldered and removed

 

Connect three wires from the PCB to the de-soldered PIR Transistor

 

Below. Underside of lid showing PIR sensor PCB and wiring to sensor on top of the lid.

Slots on the underside of lid allow the lid to sit flush over the original handle fixings.

 

 

 

 

 

 

 

RTC Modification

 

Modification of DS3231 AT24C32 I2C Precision Real Time Clock Module

My clock uses a DS3231 AT24C32 I2C Precision Real Time Clock Module instead of a DS1307.

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.

 

 

 

 

 

 

 

 

 

 

Remote Control

The remote control has four functions

 

1. DCF77 Pulse sound On/Off

When switched On the incoming DCF77 Pulses can be monitored via the small active buzzer

 

2. Super Filter Reset

This will reset the Super Filter and remove all the learned tuning and will start the Super Filter unsynced.

The Super Filter Monitor LEDs if switched on will go out until the Filter resynchronizes itself

 

 

3. Super Filter Monitor LEDs

These 3 LEDs monitor the function of the Super Filter

LED1- DCF77 Second Pulse

LED2 DCF77 Signal Good

LED3- Synthesized difference

 

 

4.

DCF77 Analyzer Clock Reset

This will reset the clock and displays to zero and the clock will lose any sync it had.

If the RTC had been previously set RTC time will be displayed.

Note the Super Filter will not be reset and any learned tuning and sync will not be effected.

 

 

If remote control is not required then momentary switches can be used instead.

 

 

Remote Control Construction

 

The remote control is based on a PT2272 Wireless Receiver Module (433MHz version) and a PT2262 Wireless Transmitter Module (433MHz version)

             

I use the 433Mhz version here in the UK but there are 315Mhz versions available for use in other countries.

You can get a 315Mhz Transmitter ready built in a key fob including the separate receiver on Ebay. This option does not seem to be available in 433 Mhz.

 

If you go for this option you just plug the receiver into the main display board and you are ready to go.

 

The 433Mhz option requires either a small remote transmitter to be constructed or a learning key fob can be purchased and learnt from your transmitter.

 

      

Above Remote Control Transmitter for 415Mhz boards

The left four switches mounted on a small piece of vero board.

The transmitter is mounted on the reverse along with a 9v battery.

See instructions supplied with the module for wiring.

 

 

 

Alternatively a learning key fob can be purchased and can be programmed from the transmitter using

the simple circuit above. A PCB link is used to connected the micro switch to the four inputs in turn so the key fob can be programmed.

 

 

 

 

 

 

 

 

 

 

Super Filter On/Off Control Switch

A single switch controls the Super Filter and has 3 positions

On Super Filter - When On the Super Filter output is connected to the Analyzer Clock DCF77 input and 5v is connected to IC1 pin 5 (IDE pin 3) to light the Super Filter LED on display matrix 3.

No Connection- When in this position the Analyzer Clock DCF77 input is not connected to any signal

On DCF77 Signal- In this position the Analyzer Clock DCF77 input is connected directly to the DCF77 receiver/antenna.

Note in all positions the Super Filter is connected to the directly to the DCF77 receiver/antenna so it alway remains in sync.

 

 

 

 

 

 

 

 

 

 

Reading The Received and Decoded Matrix Buffer Displays

The received matrix buffer is on the left and contains the information for the next minute. The display is identical the

decoded matrix in the middle which shows the time, date etc for the current minute.

After each minute (if error checking is OK) the Next Minute buffer data is loaded into the Middle Matrix and becomes the Current Minute.

DCF77 data is received serially once per second and once the clock is in sync second 0 is loaded into buffer 00 (Matrix position M), second 1 into buffer 01 etc.

When a bit value of 1 is received the LED for that segment is lit but will remain unlit if the value is 0.

 

 

 

Second 0  Buffer 00  Matrix Label M

This is the start of the minute and will always be 0.

 

 

 

Second 1 to 14  Buffer 01 to 14  Matrix Label 01 to 14

These bits contain licensed encrypted Weather data for Europe and is used by DCF77 weather clocks.

This data is displayed but not used by this clock.

 

 

 

Second 15  Buffer 15   Matrix Label Flt This bit contains transmitter info and is 0 unless there are transmitter problems

Second 16  Buffer 16  Matrix Label LHr  Summer time announcement normally 0. Set to 1 during hour before change.

Second 17  Buffer 17  Matrix Label CEST  Set to 1 when CEST (Central European Summer Time) is in effect.

Second 18  Buffer 18  Matrix Label CET  Set to 1 when CET (Central European Time) is in effect.

Second 19  Buffer 19  Matrix Label LSec  Leap second announcement. Set to 1 during hour before leap second.

 

 

 

Second 20  Buffer 20  Matrix Label S  Start of encoded time. Always set to 1.

 

 

 

 

Second 21 to 27  Buffer 21 to 27  Matrix Label 01,02,04,08,10,20 & 40.

  These bits contain the minutes and are added together to show minutes from 00 to 59.

21 minutes would have 01 and the 20 LEDs lit, likewise 53 minutes would have 01,02,10 & the 40 LEDs lit

 

 

 

 

Second 28  Buffer 28  Matrix Label P1

This bit shows even parity over minute bits 2128.

Parity is a basic form of error checking. A Parity bit is added to the end of a string of digits in this case 7 bits from buffer 21 to 27.

The Parity bit indicates if the number of 1s in the buffer from 21 to 27 is even or odd.

If the number of 1s is even using Even Parity the Parity bit is 0 and if the number of 1s is odd then the Parity bit is 1.

For example if the minutes to be transmitted are 5. Buffer Bits (Yellow hi-light above) 01=1, 02=0, 04=1, 08=0, 10=0, 20=0 & 40=0

0r 1010000 if you add the number of 1s together you get 2. This is an even number so the Parity bit transmitted will be 0.

Therefore the transmitter will send 1010000 & 0.

At the receiver end the receiver does not know what code to expect but it knows to check the parity of bits 21 to 27.

If when receiving the bits 21 to 28 a miss reading occurs for example bit 22 is received as a 1 not a 0 the resulting bits would be 11100000.

The receiver would expect the last bit (Parity) to be 1 as there are a an odd number of 1s.

This indicates an error in the received signal and the received buffer would be rejected as it contains errors.

 

 

 

 

Second 29 to 34  Buffer 29 to 34  Matrix Label 01,02,04,08,10 & 20.

These bits contain the hours and are added together to show hours from 00 to 23.

10 hours would have only the 10 LED lit , likewise 23 hours would have 01,02 & the 20 LEDs lit

 

 

 

 

Second 35  Buffer 35  Matrix Label P2

This bit shows even parity over minute bits 29 to 35.

See explanation of Parity in P1 (seconds 28 above)

 

 

 

 

Second 36 to 41  Buffer 36 to 41  Matrix Label 01,02,04,08,10 & 20.

These bits contain the day of the month and are added together to show days from 01 to 31.

The 10th of the month would have only the 10 LED lit , likewise the 23rd of the month would have 01,02 & the 20 LEDs lit

 

 

 

 

Second 42 to 44  Buffer 42 to 44  Matrix Label 01,02 & 04.

These bits contain the day of the week and are added together to show  Day of week Monday=1, Sunday=7

Monday would have only the 01 LED lit , likewise Sunday would have the 01,02 & the 04 LEDs lit

 

 

 

 

Second 45 to 49  Buffer 45 to 49  Matrix Label 01,02, 04, 08 &10

These bits when added together contain the month number and range from 01 to 12.

January would have only the 01 LED lit , likewise July would have the 01,02 & the 04 LEDs lit

 

 

 

 

 

Second 50 to 57  Buffer 50 to 57  Matrix Label 01,02, 04, 08, 10,20,40 & 80

These bits when added together contain the year number within the centuary and range from 00 to 99.

Year 01 would have only the 01 LED lit , likewise the year 99 would have the 01,08, 10, & the 80 LEDs lit

 

 

 

 

 

Second 58  Buffer 58  Matrix Label P3

This bit shows even parity over minute bits 36 to 58.

See explanation of Parity in P1 (seconds 28 above)

 

 

 

Seconds 59 Buffer 58 Matrix Label

On the 59th second the minute mark no 1 or 0 are transmitted indicating the end of the buffer on the next received pulse the buffer is reset to 00.

 

 

 

Reading The Day, Display Intensity and Status/Info Matrix Display

The 3rd LED Matrix display shows the Day, the display intensity, the clock status and also info and is split in four sections

 

 

Day

This section simply shows the current day illuminated by an LED on the Matrix.

 

 

 

 

Display

This section of 16 LEDs indicate the auto adjusted Matrix and 7 segment display intensities.

The light level is checked once per second and the intensity is adjusted up and down accordingly.

 

 

 

 

Status

Eight LEDs indicate clock status messages.

DCF: When lit this shows the DCF77 signal is OK

Sync: When lit this shows the clock is synchronised to the DCF77 signal

PT: When lit this shows there is an error with the Period Time of the received signal

PW: When lit this indicates an error with the Pulse Width of the received signal

EoB: Lights when buffer is full before end of 60 second cycle

EoM: Lights when buffer is not full at end of 60 second cycle (end mark received too early)

BF: This indicates the Buffer is full and will normally light at the end of the 60 second receiving cycle.

If will also light at other times when lots of error pulses are being received.

When lit the buffer is reset to 00.

RTC: When there is an error with the Real Time Clock ie no stored time this will light

 

 

 

Parity

This is new to v60 software

The incoming signal displayed on the left hand Matrix is Parity checked at 3 points, P1 for mins, P2 for hrs and P3 date.

If Parity is an even value then "P1 OK" , "P2 OK" & "P3 OK" will light accordingly as the data comes in.

Any Parity checks that fail will light the relevant P1 to P3 fail LED.

These are reset on the end of each minute cycle.

 

Parity is a basic form of error checking. A Parity bit is added to the end of a string of digits in this case 7 bits from buffer 21 to 27.

The Parity bit indicates if the number of 1s in the buffer from 21 to 27 is even or odd.

If the number of 1s is even using Even Parity the Parity bit is 0 and if the number of 1s is odd then the Parity bit is 1.

For example if the minutes to be transmitted are 5. Buffer Bits (Yellow hi-light above) 01=1, 02=0, 04=1, 08=0, 10=0, 20=0 & 40=0

0r 1010000 if you add the number of 1s together you get 2. This is an even number so the Parity bit transmitted will be 0.

Therefore the transmitter will send 1010000 & 0.

At the receiver end the receiver does not know what code to expect but it knows to check the parity of bits 21 to 27.

If when receiving the bits 21 to 28 a miss reading occurs for example bit 22 is received as a 1 not a 0 the resulting bits would be 11100000.

The receiver would expect the last bit (Parity) to be 1 as there are a an odd number of 1s.

This indicates an error in the received signal and the received buffer would be rejected as it contains errors.

 

 

 

 

 

 

Info

Eight LEDs indicate clock information

Sig: This LED will flash with the received signal Pulse Width and is not effected by the Super Filter if switched on

Spk: When lit this indicates the received signal speaker is activated and signal pulses can be heard through the speaker

Fltr: When lit the Super Filter is turned on and the incoming signal is being processed and synthesised.

LEDs: When lit the Super Filter monitor LEDs are turned on.

Rmte: Lights when any button on the remote is pressed.

Win: Lights when the clock is in Wintertime

Sum: Lights when the clock is in Summertime

Leap: Light when it is a leap year

 

 

 

 

 

 

DCF77 Transmitted Code Translation for each Buffer value

 

 

 

 

 

 

DCF77 Code Display Animation

 

Above 65 second animation of DCF77 receiver/decoder matrix with RTC Time, Buffer & DCF Bit included for info

 Data for the next minute is loaded second by second into the left hand matrix

On receipt of the minute mark the data is loaded into the middle matrix and into the clock for decoding into time and date

Note. Normally the received 100mS and 200mS signal is indicated by the flashing "Sig" indicator bottom right of the 3rd matrix. This is not shown in this animation.

 

 

 

 

 

 

 

 

Schematic

 

Note if not supplied with display kits add 100nF and 10F capacitors close to every MAX7219 IC

Ensure good 5v and Gnd runs to every display module

 

 

 

 

Atmega 328 IC1 & 2 Pin connections

IC No. IC Pin IDE Pin Sketch Name Function
1 1 Reset Remote4 Reset DCF77 Analyzer
1 2 0 Tx & DCF_INTERRUPT Tx & Interrupt number associated with pin
1 3 1 Rx Rx
1 4 2 DCF77PIN  INPUT: Connection pin to DCF 77 device. Must be pin 2 or 3!
1 5 3 DCF77SW LED Turns LED on when switching to the superfilter output
1 6 4 Super Filter on LED Signal mon from super filter
1 7 NA   4.4v
1 8 NA   Gnd
1 9 NA   Xtal1
1 10 NA   Xtal2
1 11 5 Remote1 DCF77 Speaker Control
1 12 6 Spare Spare used to reset super filter not connected on IC1
1 13 7 Remote3 Superfilter monitor LED switch on
1 14 8 REmote3out Turns on Superfilter LEDs via transistor 1
1 15 9 RemoteLEDpin Remote control monitor LED. Lights when remote pressed
1 16 10 CS/LOAD Connected to the CS/LOAD of the MAX72XX IC
1 17 11 CLK Connected to the CLK of the MAX72XX IC
1 18 12 DataIn Connected to the DataIn of the MAX72XX IC
1 19 13 PIR Connected to the PIR detector
1 20 NA   4.4v
1 21 NA   AREF
1 22 NA   Gnd
1 23 A0 LDR LDR sensor
1 24 A1 BUZZER OUTPUT: Piezo buzzer on Analog port
1 25 A2 Sp LDR sensor
1 26 A3 Spare Spare
1 27 A4 RTC SDA
1 28 A5 RTC SCL
2 1 Reset Remote 2 Superfilter reset
2 2 0   Rx
2 3 1   Tx
2 4 2   Diff Synthesized
2 5 3   DCF77 Signal Good
2 6 4   Inverted Synthesized
2 7 NA   4.4v
2 8 NA   Gnd
2 9 NA   Xtal1
2 10 NA   Xtal2
2 11 5   Synthesized
2 12 6   Spare
2 13 7   DCF77 Difference
2 14 8   Spare
2 15 9   Spare
2 16 10   DCF77 Second Pulse
2 17 11   DCF77 Inverse Pin
2 18 12   DCF77 Filtered Pin
2 19 13   Spare
2 20 NA   4.4v
2 21 NA   AREF
2 22 NA   Gnd
2 23 A0   Difference Semi Synthesyzed
2 24 A1   Inverted Semi Synthesized
2 25 A2   Semi Synthesized
2 26 A3   Spare
2 27 A4   Signal Monitor Super Filter
2 28 A5   DCF77 Inverse Pin

 

 

 

 

4 K Ultra HD Video of completed Clock

 

 

 

 

 

 

Code

The main bulk of this code was written by Erik de Ruiter's DCF77 Analyzer Clock

Erik has provided full details of his code here on GitHub.

I have tried to keep his code as and where I have not used it I have commented it out.

Where I have added or modified it I have added a comment  starting // Brett

 

 

Download v62 code in zip format here DCF77 Analyzer Code

New v62 code 27/06/2018

Version 62 has added support for Microwave Radar Sensor RCWL0516. The old PIR can be used instead if required.