Skip to content

mattudakis/ArduinoLEDClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino based LED word clock

Alt text


Contents

  1. Features - WordClock features.
  2. Components - Components used to make the clock.
  3. Circuit - Circuit and wiring diagram for the clock's electronics
  4. Fabrication Process - Guide for the clock's build process.
  5. Setting the time and date - How to set time and date via Bluetooth terminal app.

 

Features

  • LED colour change button
  • On the hour and quarter hour LED animations
  • Birthday LED message on set dates
  • Automatic LED brightness control via photoresistor
  • Real time clock (RTC) time keeping with automatic daylight-saving time changes

 

Happy Birthday message and some different colour options

On the hour and quarter hour animations

Components

Component Description Source Reference Quantity
Frame Box photo Frame 23x23 cm Ikea Black RIBBA* 1
Letter cut outs Laser cut panel 3mm birch plywood online laser cutting service 1
Baking paper 23 x23 sheet to diffuse LED light grocery store 1
LED dividers Dividers to isolate LED light online laser cutting services 1.5mm backing board 1
LED array template Card template to attach LED strips online laser cutting services 1.5mm backing board 1
MDF board 230 x 230 x3mm for back of clock Hardware store/ online 3mm thickness 1
LED strip addressable LEDs 60/meter 16.5mm interval Amazon/AliExpress 60 IP30, WS2812B 121 LEDs
Arduino nano Arduino/Elegoo nano Amazon/AliExpress ATmega328P 1
Real time clock (RTC) RTC with battery to keep time Amazon/AliExpress DS3231 1
Bluetooth BLE module BLE Bluetooth for remote connection Amazon/AliExpress HM-10 1
Push button (momentary) button to cycle through LED colour Amazon/AliExpress Tactile Push Button 1
Photoresistor measures ambient light to set brightness Amazon/AliExpress GL5516 1
Wire wire to connect components together Amazon/AliExpress <1 m
Heat shrink tubing heat shrink to tidy soldered connections Amazon
Soldering iron/solder soldering iron to solder all components Amazon/hardware store
Custom PCB optional custom PCB to solder components online PCB manufacturer 1
Resistors 1x330 1x1K, 1x2K, 2x10k Amazon/AliExpress 5
Capacitor 100uF 50V for power surge protection Amazon/AliExpress 1
Power Jack 5.5 X 2.1mm DC power Jack Amazon/AliExpress 1
DC power supply 5Volts 3Amp Amazon 1
Mini USB-A cable Cable used for Arduino power Amazon/AliExpress 1
Square wood dowel 10 x 10 x 30mm square dowel for backplate Hardware store/ online 4
M2x10 micro screws flat head screws for attaching backplate Hardware store/ online 4
Glue gun with glue glue gun to fix components Hardware store/ online 1
Drill bits and drill 12mm, 2mm, and 6mm drill bits and drill Hardware store/ online 3

*The Ikea RIBBA frame in black has been discontinued. An oak version is still available, which could be spray painted. Alternative frames of the same size can be found on Etsy.  

Circuit

Circuit components can be connected following the Arduino clock circuit

Alt text

 

Alternatively a Custom PCB can also be fabricated for ease of assembly.

PCB files found here

Alt text

 

Optional full size PCB with pre-assembled LEDs

A large PCB with the addressable LEDs can be fabricated and pre-assembled.
This will save a lot of time in the soldering of the LED strips.
Full sized PCB files and pictures of assembled PCB can be found here

 

Fabrication process step-by-step

The assembly process involves the following steps

  1. Frame assembly
  2. LED array and power input assembly
  3. Arduino circuit soldering
  4. Button and photoresistor assembly
  5. Backplate fabrication and final assembly
  6. Loading firmware onto the Arduino

 

1. Frame assembly

  • Discard all parts of the frame except for frame itself.
  • Take the wooden laser cut clock face and place it face down within the frame.
  • Cut out a piece of baking paper the same size as the clock face and place on top of the clock.

This will diffuse the LED light to evenly light each letter.

  • Assemble the dividers and place on top of the baking paper/ clock face.

Alt text

 

2. LED array and power input assembly

Power input assembly

  • Take the USB cable and strip the external casing to expose the 4 wires.
  • Trim off the two data wires (these are usually green and white) leaving just the power and ground wires.
  • Extend the power and ground wires and tidy up the connections to add more stability.
  • With two additional pieces of wire solder the capacitor between them (see circuit diagram) this will connect to and power the LED array.
  • Connect both sets of wires to the DC jack making sure the wires are securely in place.

Alt text

 

LED array assembly

  • Cut the addressable LEDs to 11 LED strips.
  • Solder the LED strips in a snake like orientation starting from the bottom left.

The LEDs are directional so make sure they are solder in the correct direction. This soldering is time consuming, be patient and use soldering flux to help.

  • Tidy up the soldering connections with some electrical tape or heat shrink tubing.
  • Get the LED array template.
  • Using a glue gun, add a little glue between each hole in the template and glue the LED strip to the template.

Do this one strip at a time to prevent glue drying. Don't glue the first part of the first strip as access to this is needed later.

Alt text

 

3. Arduino circuit soldering

Using either the custom PCB or manual wiring, connect the HM-10, DS3231 RTC and the Arduino nano together. If using manual wiring follow the circuit diagram ensuring the correct resistors are included.

The custom PCB will save a lot of time and add more stability to the electronics so this is recommended.

For assembly via the PCB

  • Solder the Arduino nano, HM-10 and DS3231 RTC to the PCB along with the various resistors.

Alt text

 

4. Push button and photoresistor assembly

The colour of the LEDs in the clock can be altered using a push button attached to the back of the clock. In addition the brightness of the clock is automatically adjusted to the environments ambient light levels.

 

Making the brightness photoresistor

  • Solder two wires to the photoresistor and tidy the solder contacts with electrical tape or heat shrink tubing.
  • Using a drill, drill a hole slightly larger than the photoresistor diameter.

To prevent damage to the top of the clock, stick some tape over the drilling area.

  • Using a glue gun, glue the photoresistor into the drilled hole ensuring it is flush with the top of the clock frame and securely in place.

Alt text

 

Making the push button

  • Solder a small push button to two wires, tidying the connections with heat shrink/ tape.
  • Make sure the wires are long enough so that when attached to the Arduino the back plate can be removed.
  • Optional solder two female jump cable connectors to the wires so that it can be easily removed from the main assembly. Then solder two male header pins to two additional wires that will be then soldered to the Arduino.

Alt text

 

5. Backplate fabrication and final assembly

Backplate assembly

  • If no pre-cut backplate is available cut a 2-3mm piece MDF or plywood to the same dimensions as the front plate (23x23cm).
  • Using a large drill bit (12 mm), cut a hole at the centre bottom of the backplate. Try to align this with where the DC jack will be glued to the inside of the frame.
  • Using a smaller drill bit, drill a hole the same size as the pushbutton button head.
  • Using a glue gun, glue the button assembly to the inside of the backplate, ensure that the button mechanism isn’t glued.
  • Cut some small pieces of square/circle dowel (1cm diameter) and glue them to the inside corners of the frame.

These should be cut to a length that when the backplate rests on them the backplate is flush with the back of the frame.

  • Place the backplate onto the back of the frame and using a very small drill bit, drill holes through the base plate and the dowels.

These holes should be slightly smaller than the micro screws that will be used to fix the baseplate.

 

Final assembly

  • Using a glue gun, glue the DC Jack to the bottom of the frame, making sure it aligns with the hole in the backplate.
  • Solder the photoresistor and the button to the Arduino/ PCB.
  • Solder the power and ground wires from the DC jack to the first LED strip and at the same time, solder a data and ground wire from the LED strip. Tidy up the connections with heat shrink or tape.
  • Solder the data and ground wire from the LED strip to the Arduino / PCB.

Alt text

 


6. Loading the code onto the Arduino

The Arduino code (sketches) used for the clock can be found here. These include the HM-10 bluetooth settings, the main clock sketch and a trouble shooting Demo real sketch that can be used to check if all the LEDs work.

These sketches can be loaded onto the Arduino nano using the Arduino IDE. There are several Arduino libraries needed for this project found here. These need to be added to the Arduino IDEs library folder.

 

Changing the bluetooth settings

  • To check the Bluetooth module works corretly load the HM-10 bluetooth sketch onto the Arduino and monitor the outcome on the Arduino IDEs serial monitor.
  • This code will change the name of the BLE module from its default "hmsoft" to "WordClock".
  • If you would like to change the name of the Bluetooth module you can edit the following line in the HM-10 bluetooth sketch.

BLECmd(timeout,"AT+NAMEWordClock",buffer); // Set the name of the module to HM10

  • Changing the "AT+NAMEWordClock" to "AT+NAME*insertname*"

Troubleshooting:

  • If no BLE devices are detected in the Arduino IDE serial monitor, make sure the baud rate of the serial monitor is correct and make sure the HM-10 is wired to the correct pins on the Arduino.
  • If both of these still don’t fix the problem you may have a faulty HM-10 module which you can replace.

 

Set the correct time in the clock sketch

  • To initially set the time the WordClock sketch can be edited and loaded onto the Arduino.

  • Uncomment the following lines of code changing the date and time to the correct values.

//****settings to edit the time on the real time clock ******
//setTime(18,50, 00, 14, 05, 2023); //this sets the system time set to GMT without the daylight saving added.
//RTC.set(now()); //sets time onto the RTC. Make sure to comment this out and then re-upload after setting the RTC. -- (setTime() and now() are Part of the Time Library)
//**** Un-comment above 2 lines to set the time and load onto chip then comment out the lines and re-load onto the chip********

  • Load this sketch onto the Arduino, this will set the time on the RTC.
  • Re-comment out the above code in the sketch and reload to the Arduino. This is important otherwise the time will reset every power cycle.
  • The time/ date can be changed remotley in the future via Bluetooth, using these guides

 

Clearing the EPROM memory

The arduino can store birthdates in its "eprom" memory, to allow this to work the first time make sure the line EEPROM.write(0, 0); is uncommented this will clear the eprom memory to allow birthdays to be stored. After loading the sketch for the first time, re-comment this line and re-load the sketch.

 

Altering the dates for birthdays in the clock sketch

  • The clock will light up a 'Happy Birthday' message on set dates.
  • You can set these dates via Bluetooth see here
  • To set the dates directly in the sketch edit the following code in the clock sketch.

// **** to add birthdates without bluetooth use this code,
// **** comment this out after loding for the first time
//addManualBday(6, 1) // pass the variables (day, month)

  • Change the day and month value in the addManualBday() function, you can copy and paste this line of code to add additional birthdates.
  • after loading this onto the arduino, make sure to comment this line out and reload the sketch to prevent it writting a new birthday after each power cycle.

 

Finished

  • After loading the main clock sketch onto the Arduino replace the USB with the power USB.
  • Attach the backplate to the clock with micro screws, plug the clock in and check that the colour change button and brightness sensor work.
  • If everything it working correctly the clock is finished!

 

Using Bluetooth to set the time and add or remove birthdays

The clock should keep good time and automatically alter the time for daylight saving changes. However if the time and date needs to be changed or you want to add or remove birthdates to light up this can be done via Bluetooth. The following instructions will outline how to do this.

 

1. Download a Blueooth terminal app onto a smartphone/tablet

To talk to the clock via Bluetooth a bluetooth (BLE) terminal app is needed.

  • The following apps which have been tested, can be downloaded on the iOS app store or android's Goggle Play app store.
  • iOS devices "BLE Terminal HM-10" app.
  • Android devices "BLE Terminal" app.

    

 

2. Connect to the WordClock

  • Once opened, the app should search for Bluetooth devices.
  • Select the clock's bluetooth connection which should be named "WordClock".
  • Once connected, make sure the settings are as shown in the image below.
  • To access the sttings long press on the "send ASCII" button for a few seconds.

    

 

3. Sending a command

  • The clock takes five commands:

    • gettime - to display the current date and time
    • settime - to set the date and time
    • listbday - to list all the birthdates stored in memory
    • addbday - to add a birthday to memory
    • removebday - to remove a birthday from memory
  • Type the command you want for example: settime and press the "send ASCII" button.

  • The terminal should respond with the instruction as shown in the image below.

    

 

Setting the time and date

  • Send the settime command and wait for a response
  • Type out the current time and date in the following format: hh,mm,ss,dd,mm,yyyy corresponding to hour,minutes,seconds,day,month,year.
  • The values should have a comma, slash or colon between them.
  • Press the "send ASCII" button to set the time and date
  • If the time is set correctly a message will be shown as seen in the image below.

    

 

Adding a new birthday

  • Send the addbday command
  • Type the birthday to be added as dd/mm (day/month)
  • The value should have a slash between them.
  • Press the "send ASCII" button to add the new bday

 

Removing a birthday

  • Send the removebday command
  • Type the birthday to be removed as dd/mm (day/month) note: it might help to list the birdays first with the listbday command
  • The value should have a slash between them.
  • Press the "send ASCII" button to remove the birthday

About

arduino based word clock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages