WiFi Connected Clock With Westminster Chimes




Introduction: WiFi Connected Clock With Westminster Chimes

My latest digital clock is based on this video and the code found there.

It works very well but I wanted something that also gave me auditory announcements of the time. The classic way of doing this is with Westminster Chimes. Such chimes are found on most grandfather clocks as well as mantle clocks.

While the Arduino that I am using for this project is capable of producing rudimentary sounds that could resemble Westminster Chimes I opted to use an MP3 player that sounded out recordings of the chimes. This gives much better audio quality and flexibility to use whatever sound you choose to play. It also allows me to change the version of the chimes that is played by simply swapping micro SD cards.

One of my clocks is shown here. It continuously displays the time and sounds the chimes at 15 minutes, 30 minutes and 45 minutes after the hour. On the hour where it also chimes the number of the hour.

Step 1: Video

This video shows the clock in action.

Step 2: The MP3 Player & Sounds

I have used the MP3 player that is used in this project many times before. It is the DFPlayer, an inexpensive, high quality MP3 player that stores sounds on a micro-SD card. For more information on this device see: http://www.trainelectronics.com/Arduino/MP3Sound/...
This page also suggests where it can be purchased. Files for the MP3 player reside on a micro SD card in a folder named mp3.

There are 6 sound files for the Westminster Chimes.

0001.mp3 - the chimes for the quarter hour

0002.mp3 - the chimes for the half hour

0003.mp3 - the chimes for the three-quarter hour

0004.mp3 - the chimes for the hour

0005.mp3 - the hour chime

0006.mp3 - the hour chime with a long trailing sound at the end (used as the last chime)

The sound files that I used are in the attached file called mp3.zip

A shorter version is called mp3-shorter.zip To make these files I changed the Tempo in a sound editing program called Audacity.

Step 3: Parts

Only a few parts are needed. The processor is a Wemos ESP8266 that can be ordered from BangGood and Amazon. It requires some additional setup in the Arduino IDE that can be seen here:


The DFPlayer MP3 player can be found at Amazon and BangGood as well.

The LED Matrix display can be found at Amazon and BangGood.

The display's visibility can be improved dramatically by adding a red filter. I use a red, self-adhesive film that can be found on eBay, but red acrylic will work, too.

In addition you will need a 1K resistor, a 10K (a 50K or 100K will work, too) and an 8 ohm speaker.

The unit can be powered from a USB cable to the Wemos D1 or you can use a voltage regulator circuit that supplies 5 volts.

Step 4: Schematic

As you can see from the schematic the wiring is very simple.

Power can come from a 5 volt USB power supply, USB cable, or batteries (3.7 to 5 volts will work)

Step 5: Prototype

This photo shows my prototype. It was built on a small circuit board. The Wemos D1 processor with WiFi is on the right side of the board. It is connected to a USB cable to supply power to the circuit. The DFPlayer is to its left and contains a micro SD card with the sound files. The speaker is connected to the red/black wire that goes off to the left of the photo. Be sure to use an 8 ohm speaker with the DFPlayer. If you only have a 4 ohm speaker put a 3 to 5 ohm resistor in series with the speaker.The 4 module display has been placed behind a piece of red acrylic to make it more visible.

This close-up shows the potentiometer (to the far right) that can be used to adjust the brightness of the display.

Most of the wiring is on the back of the board. It follows the schematic. The only part that is not shown on the schematic is the black capacitor that was placed on the power input connections to filter the DC power when I used a noisy external power supply. It is not necessary if you power with USB through the Wemos D1. The 1K resistor is under the white tubing.

Step 6: Arduino Code

The code is based on YouTube video from John Rogers & DFPlayer code found on my web page here: http://www.trainelectronics.com/Arduino/MP3Sound/...

The libraries used in this sketch can be found here:




To install the libraries go to each link above, select "Clone or Download" and download the ZIP version. Install in the Arduino IDE with Sketch/Include Library/add ZIP Library

Step 7: Going Farther

The clock with its accompanying Westminster chimes has been operating in my workshop for some weeks and provides a very reliable time and pleasant tones every 15 minutes. I plan on making high quality recordings of my mantle clock's chimes to substitute for the sound I now have on the micro SD card. The next project will be to add hands to the clock and to mount it in an appropriate enclosure.

I hope you have a chance to experiment with WiFi connected clocks, too!

4 People Made This Project!


  • Creative Misuse Contest

    Creative Misuse Contest
  • Fix It! Contest

    Fix It! Contest
  • Tiny Home Contest

    Tiny Home Contest

42 Discussions


4 months ago

Hi Dave.

I have two problems: at midnight it plays only one and the volume setting work only one time. For the first problem I think that the code is invalid in theese double conditions:

if (h >= 2) { <------

if (h >= 13) {

h = h - 12;


if (h == 0) {

h = 12; <-------


for (i = 1; i <= h - 1; i++) {







...or I don't understand...


5 replies

Umberto - you may be right about the code you found - I am not the author of that set of routines as I used code that I found on YouTube.

If you come up with a fix please let me know.



Hi Dave.

With this modification work well and at midnight play twelve time.

For volume I don't know.


flag4 = 1;

// if (h >= 2) {

if (h >= 13) {

h = h - 12;


if (h == 00) {

h = h + 12; // ...


if (h >= 2) {

for (i = 1; i <= h - 1; i++) {

mp3_play(5); // ....




mp3_play(6); // suono 6 con eco




Thanks for the code, Umberto - I'll give it a try.


Hi Dave.

My summer time don't work: have you a fix for this problem?

I try to fix by my self, if I can. Let me know if you have, please.



I do not have a good solution, Umberto - for now I just changed the value of SummerTime and uploaded the software - there is talk about going to DST year round so the issue may not be around much longer

Let me know if you have a better solution




Question 5 months ago

Hi Dave.

I have a question: how to change hour in other time zone.



1 more answer

Hi Dave.

I found utcOffset.

very well.



7 months ago

hi davebodnar, can you explain how do you create 6x8 font ? is it rotated ? can't find way to decode it. Need to do some changes on this font. Will you be kind to explain me ? Thanks

2 replies

Sorry, but I did not design the routines that generate the fonts - As with many Arduino projects I used the work of others to help to develop my design.
I did a Google search and found this link that may help


Good luck!


thanks dave , I will search :-)

I FOUND MY FATHER FINALY.......... i am a clock JUNKY also.. i am for the last 2 years STACKING clock kit after clock kit, and have many more orher kits as well of course to build soon, i think i will call you dad now. on my channel i will start soon with my clocks to, and will use your coding as well. THANX for all your hard and awesome work sir. ( dad )

2 replies

Thanx man I HIGHLY appreciated it.

luckily there are still cool and normal people here.

and i already build another build of him ALREADY ALSO....

thunder and lightning with this sound player. AWESOME!!!!!!!

on my website



The symbol that points down (an arrow or triangle) indicates a connection to ground (the negative terminal of the power supply) - so, you connect all such symbols together then to minus power.


hi Dave,

I also tried, there is no error with the library but it won't trigger the mp3, not even light the mp3 led every 15 minutes. It silent.

The led mp3 never blink, I tested the mp3 dfplayer board with simple code works fine.

The clock works fine.

I connect to D4 , not D1, tested on D1 doesn't work.

Is the schematic wiring correct ? Don't you need tx and rx ?

I'm not a programmer for sure.

2 replies

I just double checked and there is an error in the schematic - the TX pin on the Wemos goes to the RX pin on the DFPlayer  through a 1K resistor.

I'll change the schematic to reflect this.

Thanks for the good eyes - I am not sure how that got in there!


Hi Dave, I have the RX of the DFPlayer going to the TX pin of the Wemos through a 1K resistor but I'm not able to trigger any MP3 audio. Light on DFPlayer remains dark. Triple checked my wiring to no avail. Any idea what I should look for?