Introduction: 3D Printed Personalised Word Clock

About: I love the challenge of building unique things. My goal is to make technology fun and help individuals build the skills and the curiosity to experiment with some of the amazing technologies we have available t…

** Full Kitset and Parts for this project are now available here **

Build your own 3D printed Personalised Word Clock.

After experimenting with a few word clocks over the years and found they are something people really enjoy having however are complex to build. The three biggest challenges with Word Clocks being

  • Soldering over 150 LEDs
  • Building a good looking case
  • The complexity of getting the front panel letters and the lighting just right

Which is why this project is focused on simplifying construction by providing a preassembled PCB, 3D printed Case, front screen and baffles.

This design incorporates ESP32 powered color LEDs that can be programmed for various foreground and background colors, personalized name, time of day and year messages (including "Happy Birthday"), alarm sound, and an ambient room light sensor-controlled brightness to ensure it doesn't keep you awake at night. The unit is powered by a standard USB charger.

These are great personalized gifts for friends and family with a professional finish.

Step 1: Gather the Materials

Materials

  • ESP32 DOIT Dev Kit 1
  • 36mm diameter 8-ohm 1w speaker
  • Light Dependent Resistor - 5528 1M ohm Dark, approx 10 K ohm bright light
  • USB-A Charger
  • Hookup wire
  • USB 2.0 Micro to USB A cable 1m length
  • 15 Pin female header strip x 2
  • LDR connection - 2 Pin male header pins & 2 Pin female header socket
  • Speaker connection - 2 Pin male header pins & 2 Pin female header socket
  • JLPCB assembled PCB Board - See construction section below
  • 3 x M3 diameter 8mm length screws

** Full Kitset and Parts for this project are now available here **

Step 2: Print the 3D Components

The 3D printable files are stored and available on Thingiverse here

Personalizing the Clock Name

The STL files enable you to cut your own Name into the Display Panel and Baffle part using your choice of 3D Model tools.

You can do this by importing the model (e.g into Blender) then extruding a text string then subtracting this off the STL provided.

Printer Slicer Settings

I used PLA for all of the components printed on a 60-degree glass bed to get a smooth finish on the front panel.

  1. The Case, Lid and Speaker Cover were printed at a speed of 50 using a 0.28mm layer thickness
  2. The Baffle and Display were printed with Black PLA at a lower speed of 30 using a finer 0.2mm layer thickness
  3. The front panel filter was printed using White PLA and was printed at a lower speed of 30 using a finer 0.2mm layer thickness

Step 3: Build and Order the LED PCB

Note: If you don't want to build your own PCB then you can order pre-assembled single boards here

  1. Firstly, navigate to the JLPCB site here and create a new account.
  2. Once logged in Navigate to EasyEDA designer tool here.
  3. Tutorials for EasyEDA can be found here and there are multiple YouTube tutorials available so I will not go into a blow-by-blow description of how to design a PCB.
  4. I have provided you with a schematic circuit diagram below that you can copy and select your own components and board layout or alternatively you can use my design files here to prepare to order (Please ensure you use V5 files provided).
  5. Use the "Add Gerber File" button to upload the Gerber File. This will import the design and give you a view of the PCB and its attributes. Scroll down to the bottom of the page and review the settings.
  6. If you want components installed you need to turn on the switch for "SMT Assembly" which will bring up additional fields. You will be asked to upload two further files which again are a by-product of the circuit design process. Upload the component BOM file Upload the Pick and Place file provided Points worth noting before finalizing the order "SMT Assembly" can only be added to one side of the PCB in the manufacturing process.For this reason, I manually soldered in the Header Pins for the ESP32.
  7. Some components may be unavailable due to stock variability. In some cases, there are alternatives that can be selected. If not available then it becomes a component you need to source and add manually.
  8. If you want to solder the boards yourself I recommend you order a solder mask that can be ordered with the PCBs which allows you to easily apply solder paste onto the PCB before using a heated bed or air gun to finish the process.
  9. Follow the process and place the order for your PCB!


*** Please note ****

1. The physical orientation of the LEDs - my PCB design alternates the physical orientation of LEDs on the PCB for each column. If you are soldering the LEDs yourself ensure you align each LED Cathode with the Cathode marked on the PCB. This is denoted by a white triangle on the corner of the LED.


Step 4: Load the Code and Test the Unit


Once you have your ESP32 device you can configure and load the code.

There are three high-level steps to getting the Personalised Word Clock working correctly.

  • Connecting the ESP32 via USB port and loading the code
  • Setting the correct time zone for your location
  • Use a Mobile Device to connect clock to your Wifi Router so it can synchronize the time

1. Getting your Computer ready to upload code

  • Arduino IDE
  • USB Serial Cable
  • Mac vs Windows IDE and Driver installation
  • Loading the correct Correct Libraries

Instructions on how to do this are clearly described here and cover both Windows and Mac installations.

I have put together a zip file with the required Libraries here so my suggestion is that you move existing libraries you have to another location and just expand out this zip file into the Arduino IDE library subdirectory. This saves a lot of hassle messing around with libraries.

Once you have your PC/Mac successfully communicating with the ESP32 you can load the code provided which is located here.

2. Set Up the Time Zone

The code contains a specific configuration for your country time zone on row 122.

const char* TZ_INFO = "NZST-12NZDT-13,M9.4.0/02:00:00,M4.1.0/03:00:00";

The code between the speech marks needs to be changed to reflect your local time zone.

Time zone information can be found by navigating to this location here and identifying your geographical location for the correct time zone.

For example, I live in New Zealand so the code I have added is here in between the speech marks

const char* TZ_INFO = "NZST-12NZDT-13,M9.4.0/02:00:00,M4.1.0/03:00:00";

Copy and paste the correct text into your code.

3. Setup Wifi Network Access

The code now incorporates the ability to securely set your Wifi Accesspoint and password without the need to reload the code which is very convenient for the user of the clock. It avoids problems with changes to wifi passwords or relocating the clock to other wifi access points.

In order to keep the Clock Synchronised with the correct time, an NTP server is polled over the internet when the clock is powered up. This requires you to add your Wifi access router name and password. Be assured that the code only connects to the internet on power-up, gets the time from a time server then disconnects until rebooted. There is no internet data collection going on just the convenience of not having to add a real-time clock board and a battery for the clock.

***Note of recognition: This innovation is courtesy of Matthew Ford who very helpfully contributed with code further explained here ESP32 / ESP8266 Auto WiFi Config

Preparation - You will require the following

  • Your Wifi Password and Router name
  • Wifi capable mobile device (Phone or Tablet)
  • QR Code Scanning App on the device (not mandatory but makes it easier)
  • Print out the Wifi Access Graphic provided and use a glue stick to glue it to the back of the case.

3.1 Put Clock into Wifi Configuration mode

In Wifi Configuration mode the ESP32 is set up to become a Wifi Access Point temporarily so you can upload your Wifi Credentials using a mobile device. The Clock is in Wifi Configuration mode when the blue led on the ESP32 flashes quickly.

The procedure for putting the Clock into Wifi Configuration mode is to

  • Attach the USB cable to the Clock for 5 seconds
  • Disconnect the USB cable for 2 seconds
  • Re-attach the USB cable

The blue led on the back of the PCB should now flash quickly. If not repeat the procedure.

3.2 Connect your mobile device to the Clock over Wifi

With the blue led flashing quickly (indicating that the WiFi configuration mode is active) scan the QR code to connect your phone to the Clock.

SSID: WiFiConfig

Password: 12345678

3.3 Enter your home Wifi credentials into the Mobile Device

Then open a web browser and type in http://192.168.1.1. to display the WiFi configuration page. (This configuration page may also popup automagically.)

On the configuration page enter your Wifi Credentials for your local wifi access router. Take care to get the syntax correct.

Press the configure button to save this to the Clock.

3.4 Return the clock into Clock Mode

When in Clock mode The blue led will flash slowly. The procedure to put the clock into Clock mode is as follows

  • Disconnect the USB cable for 12 seconds
  • Attach the USB cable
  • After approx 20 seconds, the Clock should now start and display the correct time.

The Clock should see the power-up sequence results in successfully displaying the time and playing the "Jedi" startup audio clip.

If there are issues please go back through each of the previous steps and validate each has been followed carefully.

Message me for help if you have any further issues.

Step 5: Putting It All Together

1. Adding the ESP32 to the PCB

JLPCB will generally only perform single-sided assembly so the 2 x 15 Header pin sockets for the ESP32 need to be hand soldered into the board on the underside as you can see from the photos.

Gently push the ESP32 into the header pins and use this to keep the pins vertically aligned before soldering in the pins.

2. Mounting the Baffles and Front Panel Filter

Lay the case face down on a table. Gently align the Baffles and Front Panel Filter and place them into the rear of the case. Carefully rotate the PCB into the case with the Push Buttons going in first. The PCB should sit nicely into the baffles you have printed. See the video above.

The latest version of the 3D model has four screw holes in the case and requires four printed washers which can now be used to fasten the PCB into position. Make sure you add the washers to ensure no tacks on the PCB coming into contact with the metal screws.

3. Adding the LDR

Using hookup wire solder approx 15cm of hookup wire to the LDR attach it to the pins labeled on the PCB.

4. Adding the Speaker & Speaker Cover
Using hookup wire solder approx 15cm of hookup wire to the Speaker attach it to the pins labeled on the PCB. I have added a Speaker Cover in the 3d Model to enable you to fully enclose the speaker with plastic to ensure there is no chance of the metal will short out the PCB. Make sure the speaker and cover are fastened with hot glue to ensure it does not short out any of the other components on the PCB.

5. LED Brightness and Power Consumption

The Color LEDs can draw considerable current when used at a high intensity so I have put a limitation on current consumption in the code to limit to 200mA (Line 105). This can be adjusted if a higher intensity is required, however, be sure not to make this too high otherwise your USB charger will max out and the clock will not operate correctly.

6. Personalised Birthday Message

Row 63 and 64 of the code need to be changed to represent the day and month of the owner of the clock

byte birthday = 28; // Birthday "Day" of individual owning the clock Note: [1,31]

byte birthmonth = 2; // Birthday "Month" of individual owning the clock Note: [0,11]

Note the Month is 0-11. When correct the owner gets a nice Happy Birthday Message on the front of the clock for 24 hours.

Step 6: Using the Two Button Menus

Once the code is loaded correctly you should hear a sound in the speaker "the force will be with you always" followed by the time being displayed on the clock.

After first turning on the Clock power the clock will start in Clock Mode.

Clock mode:

  1. Short press the Lower Button to change the color of the foreground.
  2. Short press the Upper Button to change the color of the background.
  3. To exit Clock Mode and access Alarm Mode Long Press Both Buttons Simultaneously

Alarm Mode:

  1. To arm or disarm the Alarm, long-press the Lower button. You will see the word "ON" appear on the Alarm Mode Screen indicating the Alarm is armed.
  2. To set the the Alarm Time you can Increment alarm hour and minutes using Upper and Lower buttons. Note the AM/PM notation on the screen to ensure you get the correct Alarm time.
  3. Once you are happy with the Alarm time you can exit Alarm mode with a long press of both buttons which will return you to Clock Mode.

I would be grateful for feedback on the design and also suggestions on how to improve the unit. If there are issues building feel free to message me.

I hope you enjoy building as much as I enjoyed designing.

Step 7: Optional - Adding Your Own Startup and Alarm Sound

The cool thing about the ESP32 is that it has enough memory and resources to store and playback Digitized audio.

This means you can create your own sound effects for both alarm and startup of the clock. The library used to produce sound in the ESP32 is "XT_DAC_Audio.h" which uses audio files converted to hex files which are then stored in header files along with the sketch for the ESP32.

The process for updating them with your own audio file is as follows.

1. Select and Download your desired audio file in a Wav format. This can be done by using a youtube downloader or audio file converter.

2. Download the Audacity application onto your desktop device from here. Use Audacity to combine the sound into a mono track.

3. Shorten clip to correct length

4. Change sample rate to 8000 using the project option. The key is to keep the number of Data samples to less than 40,000. 5. Select all audio and resample under the tracks menu

6. File export selected audio to WAV Microsoft, Unsigned 8-bit save file

7. Go to https://hexed.it/ and upload the file.

8. Right-click and select all menu option

9. Right-click and Export selected bytes as a code snippet (Check number under 40k samples)

10. Copy text from the window into Sound.Data.h

11. Add semi colon at end of the text 1

2. Name the file correctly "unsigned char PROGMEM Force" For a detailed tutorial, you can see an example here by the author of the library here

Make it Glow Contest

Second Prize in the
Make it Glow Contest