Introduction: WiFi Connected Clock With Westminster Chimes

Picture of 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

Picture of 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

Picture of 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:

https://www.instructables.com/id/Wemos-ESP8266-Get...

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

Picture of 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

Picture of 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:

ArduinoJson

ESP9266WiFi

DFPlayer_Mini_Mp3

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!

Comments

WannaDuino (author)2017-10-13

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 )
wannaduino.com

MichaelS163 (author)WannaDuino2017-10-31

thumbs up to you

WannaDuino (author)MichaelS1632017-11-12

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

www.wannaduino.com

ArthurR38 (author)2017-11-03

Where do the arrows in the schematic go?

davebodnar (author)ArthurR382017-11-04

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.

dave

calico8 (author)2017-10-23

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.

davebodnar (author)calico82017-10-24

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!

dave

Probedude (author)davebodnar2017-10-28

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?

davebodnar (author)Probedude2017-10-29

First I would check to see if you have power to the DFPlayer (check voltage between VCC and GND) -

It is also easy to have the DFPlayer installed backwards - the notch in the player is between VCC and BUSY

Also, check the sound files - they must be in a subdirectory on the SD card called mp3

I would also try a different SD card

Hope that helps

dave

Probedude (author)davebodnar2017-10-29

Thanks Dave, I have pushbuttons connected to IO1 and IO2 of the MP3 module and the sounds play when I push them. I am thinking that my TX pin on my Wemos board isn't working.

davebodnar (author)Probedude2017-10-29

Try connecting an LED to the TX pin and ground (with a 1000 ohm resistor in series with the LED) and see if it blinks when it is supposed to be sending data -

That is if you don't have an oscilloscope or logic analyzer!

dave

Probedude (author)davebodnar2017-10-29

I do own a logic analyzer. Serial data is coming out the TX pin but the format doesn't look correct for the DFPlayer. Looks like I need to make a simple program to just get the player to work and then go from there. Out of curiousity, what version Arduino IDE, and what is the version ESP8266 board add-in are using? (2.0.0? 2.3.0?) Thanks for your help.

davebodnar (author)Probedude2017-10-30

I am using IDE version 1.8.4

The ESP8266 version is 2.3.0

I added a link to the DFPlayer library I am using here

http://www.trainelectronics.com/Arduino/LED_Matrix...

Let me know how it goes

dave

Probedude (author)davebodnar2017-11-01

Dumb mistake on my part - I missed where you said the files had to be in a \mp3 subfolder. I put them in the root. Once I put them in the right folder everything works! Did have to extend the timeout when using the longer sounds - it would truncate the hour chime otherwise. Thanks for your help!

davebodnar (author)Probedude2017-11-02

That is a common error - I have done it myself!

Great news that you have things working - enjoy!

dave

calico8 (author)davebodnar2017-10-24

I solve the issue right before you reply.

I wonder if anyone knows better Westminster chimes sound quality files than this ??

these mp3 files sounds a bit clipping.

anyway thank you Dave for this nice project you have and share to us.

ruddy

davebodnar (author)calico82017-10-25

Ruddy - I agree that the sound files are not wonderful - if you (or anyone) finds a better set of sounds please let us know.

thanks

dave

BigGurt (author)2017-10-23

Hi Dave, I tried to build the wifi clock because it seems to me an awasome project. Due to the fact that the libraries on the websites are newer then you used the sketch can't be compiled. Is it possible for you to upload also the libraries you used? thanks Gertjan

davebodnar (author)BigGurt2017-10-23

Gertjan- Something else may be going on with your system as those are the libraries that I have been using and they do compile - what kind of error are you getting?

dave

BigGurt (author)davebodnar2017-10-25

Hi Dave, I have similar errors Iike Probedude. So I guess it's best that I follow Probedude 's advice to start simple and first try some examples of the Wemos module.

Gertjan

Probedude (author)BigGurt2017-10-31

BigGurt, as soon as I tried an example I saw my error. I needed to choose the Wemos D1 R1 Mini as the board type and then the project built correctly and I could upload. Disregard my statement above about changing ESP8266WiFi.h to SerialESP8266WiFi.h, that was my attempt to fix the problem when I didn't chose the right board.

That said, though I can compile and upload and run, I can't get the MP3 part to work. I think my board cannot use the TX line so I need to code it to use a different pin.

davebodnar (author)Probedude2017-10-31

That is good news - let me know if you get the DFPlayer working

enjoy!

dave

Probedude (author)davebodnar2017-10-23

Similar problems here Dave. The MP3 player library changed names, as did the ESP8266Wifi library. I've edited the includes to match the new library names so that it doesn't complain when building, however now I keep getting errors about 'WifiClient does not name a type' or 'not defined in this scope'

Dave (another one)

davebodnar (author)Probedude2017-10-24

Hello (another) Dave - Not sure what may be up with your installation - have you added the ESP8266 support ( See:

https://www.instructables.com/id/Programming-the-W...

Have you selected the "Wemos D1 R2 & mini" under boards?

Do you have all three files (that are in the ZIP file) to the program folder?

I just loaded the file and compiled it with IDE version 1.8.4 without errors.

dave

Probedude (author)davebodnar2017-10-24

Hi Dave,

Same error after adding the ESP8266 support and choosing the Wemos D1 R2 & mini board. Tried a fresh install on another laptop and got the same results:

- have to rename the ESP8266 include statement to: #include <SerialESP8266wifi.h> as the name has changed

- Next had an error about not finding avr/pgmspace.h in SerialESP8266wifi.h. Fixed that by changing it to 'pgmspace.h'

Now getting the same error as above - 'WifiClient does not name a type"

Guess I should start with a simpler sketch and see if I can get it build.

davebodnar (author)Probedude2017-10-25

Good plan to start simple - there are a number of examples (Click File / Examples and look for Examples for Wemos) that you can try first.

Good luck experimenting!

dave

ldjohnsen (author)2017-10-26

Hello Dave, I too am having issues. It seems the dfplayer lib. is no longer good. I love the design and really want to install a speaker in a church on my layout. I'm not an expert with Arduino but I have gotten the just the clock sketch to work which is also great, thank you. Sorry to be a pain but any help will be appreaciated. Thanks, Loren

davebodnar (author)ldjohnsen2017-10-27

Loren - sorry to hear that you are having issues with the DFPlayer - I put a link to the DFPlayer library that I am using on my web page here

http://www.trainelectronics.com/Arduino/LED_Matrix...

It is a ZIP file - give it a try and see if that helps

Good luck!

dave

menoscab (author)2017-10-12

Very nice Dave

I will build it but I would like to use a bluetooth speaker like my echo dot...any ideas?

HydrogenCore (author)2017-10-12

Hello

First of all this is an awesome project! Can you do it using an 4-5" LCD screen?

Thanks,

Gabriel

About This Instructable

6,982views

84favorites

License:

More by davebodnar:WiFi Connected Clock With Westminster ChimesMaking a Moving, Wirelessly Controlled LED DisplayFidget Spinner to Brushless Motor
Add instructable to: