7 Segment LED Clock

by Hobby Home Electronics in Circuits > Clocks

22865 Views, 172 Favorites, 0 Comments

7 Segment LED Clock

Превью_часы_Atmega328_WS2812_4_2.jpg

Good afternoon, dear viewers and readers. Today I want to show you a complete assemblage manual of the clock based on the Atmega328AU microcontroller and WS2812 addressable LEDs.

YouTube Video

7 сегментные светодиодные часы (ENG Sub)

Link to this video:

Links to Radio Components.

Please support me on Patreon to create a new projects.

You can find all the necessary information for repeating this device by clicking on the link to Patreon:

Links to radio components:

Radio parts store:

Microchip Atmega328AU:

Microchip DS3231:

Microchip TTP223-BA6:

Addressable LED,s WS2812:

Modul FTDI FT232RL:

Arduino NANO:

Battery compartment CR2032-BS-6:

Rechargeable battery LIR2032

SMD Power Connector:

SMD male 2.54mm connector:

Brass Mounting Posts:

Power supply cable:

Power supply:

Soldering Station NEWACALOX 8786D:

Circuit Design and PCB Layout.

Snapshot.png
Snapshot_1.png
Snapshot_2.png
Snapshot_3.png

The schematic LED clock diagram was developed in the Easy EDA online environment.

The LED clock circuit contains such nodes as: an ATmega328AU command microcontroller, a DS3231 real-time microcircuit, touch-sensitive buttons based on the TTP223-BA6 microcircuit and WS2812 addressable LEDs.

Based on the schematic diagram, a double-sided control printed circuit board (PCB) was obtained.

In the circuit, the SMD components will used for surface mounting on the one side only, on the PCB top layer.

Also, in the Easy EDA online environment there is a preview of the future PCB 3D model.

After that, we create a Gerber file and upload it to the JLCPCB PCB manufacturer website.

Stainless Steel Stencil for Applying Solder Paste.

Snapshot_4.png
Snapshot_5.png
Snapshot_6.png
Snapshot_7.png

We get PCBs of the very high quality from the manufacturer’s plant.

Also, in a set with PCBs, I ordered a stainless steel stencil for applying solder paste and facilitating the installation of SMD components.

Next, we put the stencil on the PCB and position the holes in accordance with the SMD components bond pads location.

Then we apply solder paste to the stencil and accurately fill the holes with a small spatula, leaving a good uniform layer on the bond pads for all surface mount components soldering.

Applying a strictly measured amount of solder paste reduces the probability of jumper straps between printed circuit tracks.

Installation of Radio Components on the Control PCB.

Snapshot_8.png
Snapshot_9.png

Let’s proceed to the installation of radio components on the LED clock control printed circuit board.

We will use a soldering station with a hot air dryer to solder all SMD components.

Downloading the Arduino IDE Software.

Snapshot_10.png
Snapshot_11.png

Next, we turn to the software part of the LED clock.

For the Atmega328AU microcontroller firmware we will use the Arduino IDE programming environment.

A free version of the Arduino IDE installer can be downloaded from the official website.

Going to the site, download the current version for your operation system by clicking on the WIN7 and up tab, then click on the simply download tab and save the file.

Installing the Arduino IDE Software.

Snapshot_12.png
Snapshot_13.png
Snapshot_14.png

Run the “EXE” file of the Arduino IDE from the download folder. In the opened window we accept the license agreement, click further and then click install.

The Arduino IDE Installation Drivers.

Snapshot_15.png
Snapshot_16.png
Snapshot_17.png
Snapshot_18.png

If during the Arduino IDE installation, the drivers did not have installed for some reasons, then you can install them manually from the program folder located along the drive path “C:\Program files (x86) \Arduino\drivers” and run “dpinst-x86.exe” or “dpinst-amd64.exe” file depending on the operating system bitness.

The Arduino IDE Library Folder.

Snapshot_19.png
Snapshot_20.png
Snapshot_21.png
Snapshot_22.png
Snapshot_23.png
Snapshot_24.png
Snapshot_25.png
Snapshot_26.png
Snapshot_27.png
Snapshot_28.png

For the convenience of working with the libraries folder, create a shortcut and save it on the desktop.

Next, we set administrator privileges for the whole folder with libraries, in order for you do not have to confirm the changes on behalf of the administrator each time.

For better understanding and displaying of files, set up the checkmark for file name extensions in the view tab.

Downloading and Installation the Java Runtime Environment (JRE).

Snapshot_29.png
Snapshot_30.png
Snapshot_31.png

We also need a JRE (Java Runtime Environment) to work with the Arduino IDE. Go to the official JAVA website and download the installation files.

Run the “EXE” file from the download folder, then click on the install button in the opened window.

Java may not be relevant for new versions of the Arduino IDE, but it may be useful for other programs as well.

Downloading and Installation Driver for a USB TTL Converter on Arduino NANO.

Snapshot_32.png
Snapshot_33.png
Snapshot_34.png
Snapshot_35.png
Snapshot_36.png
Snapshot_37.png

In order to be able to work with the Chinese analogue of Arduino NANO, you need to install a driver for a USB TTL converter.

The driver can be easily found and downloaded on the Internet or you can download the archive with the files by following the link below in the description.

In the download folder, from the archive, extract the files with the driver. Open the appeared folder, inside of which we run the installation file, after that, click on the install button.

First Connection of Arduino NANO to the Computer.

Snapshot_38.png
Snapshot_39.png

In connecting the Arduino NANO for the first time, the computer will automatically recognize and install the device driver software.

In the device manager, we check to which virtual port the Arduino NANO board is connected. In my case, this is a virtual COM port three.

Setting Up the Arduino IDE to Use the Arduino NANO Board.

Snapshot_42.png
Snapshot_43.png
Snapshot_44.png
Snapshot_45.png
Snapshot_46.png
Snapshot_47.png

Next, we configure the Arduino IDE to use the Arduino NANO board.

In the Arduino IDE, click the tools tab, then select the board we will work with, click on the tools tab again and select the correct virtual COM port. Next, click on the tools tab once again and select the processor model, it can be either the old or the new model of the Atmega328AU.

Before the start working with the Arduino NANO, once again make it sure that it works.

In the Arduino IDE, click the file tab, then select the examples tab, then select the basics and the blinking LED. In the opened window, click on the code compilation, after which we load the firmware into the Arduino NANO.

After the firmware has loaded, on the Arduino NANO board we can see the LED blinking once per second. This suggests that our board is in good order and ready for subsequent use for more ambitious tasks.

Connection the Control PCB to the Arduino NANO.

Snapshot_48.png
Snapshot_49.png

In order to entry the bootloader to the external microcontroller Atmega328AU, you need to connect the first connector (CON1) on the control PCB to the Arduino NANO as follows: connect the Arduino positive contact to the connector positive contact, connect the Arduino negative contact to the connector negative contact, Arduino contact (13) we connect to the (SCK) contact, the Arduino contact (12) we connect to the (MISO) contact, the Arduino contact (11) we connect to the (MOSI) contact and the Arduino contact (10) we connect to the (RESET) contact.

The Bootloader Entry to the Atmega328AU Microcontroller.

Snapshot_50.png
Snapshot_51.png
Snapshot_53.png
Snapshot_54.png
Snapshot_55.png
Snapshot_56.png
Snapshot_57.png

Next, we move on to the bootloader entry to the Atmega328AU microcontroller.

In the Arduino IDE, click on the tools tab to check the correctness of the Arduino board and virtual COM port selection. Next, click on the file tab, then click examples and select the Arduino ISP. In the opened window, click on the code compilation, and then load the firmware into the Arduino NANO.

Then open the tools tab, check the correctness of the board and virtual port connection once again, then select the Arduino as ISP programmer, then open the tools tab again to select the bootloader entry.

FTDI USB-UART Module on the FT232RL Microcircuit.

Snapshot_58.png

To entry the firmware to the Atmega328AU microcontroller, we will use the FTDI USB-UART module on the FT232RL microcircuit.

Connection the FTDI Module and the Control PCB.

Snapshot_59.png
Snapshot_60.png

Next, we move on to connecting the FTDI module and the control PCB.

We connect the positive, negative, RX, TX, DTR contacts of the FTDI module to the second connector (CON2) on the control PCB, the contacts of which have the same names.

Installing the Correct Libraries for LED Clock.

Snapshot_61.png
Snapshot_62.png
Snapshot_63.png

Before you start flashing the Atmega328AU microcontroller, you need to copy the files from the LED clock project folder and paste them into the Arduino IDE libraries folder.

Uploading Firmware to the Atmega328AU Microcontroller.

Snapshot_64.png
Snapshot_65.png
Snapshot_66.png
Snapshot_67.png
Snapshot_69.png

In the Arduino IDE, click on the tools tab and select the programmers tab, where we change the Arduino as ISP programmer to the AVRISPmk2 programmer.

Next, click on the tools tab again and check the correctness of the FTDI module COM port selection. In my case, this is virtual COM port five.

Then click on the file tab and select the file with the program code. In the opened window, click on the code compilation, after which we load the firmware into the Atmega328AU microcontroller.

3D Visualization.

Snapshot_70.png
Snapshot_71.png

To create 3D visualization and drafts of the LED clock case, we used the KOMPAS 3D program. The case parts of the device will be made of 4 mm plywood, which is for laser cut. All draft files have been converted to DWG format and handed over to the panel cutting company.

Assembly of the Control Circuit Board With the Rear Panel.

Snapshot_72.png
Snapshot_73.png
Snapshot_74.png

Next, we move on to the LED clock case assembly. We connect the control PCB and the rear panel using M3 screws and brass poles about 15 mm long. The length of the brass poles may vary as the plywood thickness varies from 3.7 to 4 mm.

Installing the Middle Panels and White Translucent Organic Glass.

Snapshot_75.png
Snapshot_76.png
Snapshot_77.png
Snapshot_78.png
Snapshot_79.png
Snapshot_80.png
Snapshot_81.png
Snapshot_82.png

On the front side of the PCB, lay three middle panels with slots in the form of seven-segment indicators. From the end sides of the parts, insert the M3 nuts into the rectangular holes.

Then we lay the fourth middle panel and 1 mm thick white translucent organic glass for light scattering. Next, put the front panel and tighten all the parts together with M3 screws, which are 10 mm long.

Installation of the Cladding Panel.

Snapshot_83.png
Snapshot_84.png
Snapshot_85.png
Snapshot_86.png
Snapshot_87.png
Snapshot_88.png
Snapshot_89.png

In order to give a more aesthetic appearance to the LED clock case, we install the facing panel from the end side of the parts tightened together and fix everything with M3 screws.

Description of the Touch Control Buttons.

Snapshot_90.png

On the backside of the clock case there are touch-sensitive control buttons. The engraved letters in the circles mean the following: P stands for power, C stands for discoloration, H stands for change of hours, and M stands for change of minutes.

Special Mounts and Stand for the Case of the LED Clock.

Snapshot_91.png
Snapshot_92.png
Snapshot_93.png
Snapshot_94.png
Snapshot_95.png

Also, there are provided special mounts for the case of the LED clock, so that it was possible to hang them on the wall. In order to install them, between the case of the device and the wall mount, plastic poles 5 mm long with an inner hole diameter of 3 mm are inserted and fixed with M3 screws 20 mm long.

In my case, I will use a clock stand consisting of two parts, one of which has a hole for fixing the case with an M3 screw 15 mm long.

Work Result.

IMG_7106.JPG
IMG_7094.JPG
IMG_7064.JPG
IMG_7096.JPG
IMG_7071.JPG
IMG_7098.JPG
IMG_7130.JPG
IMG_7128.JPG
IMG_7156.JPG
IMG_7161.JPG

Thank you all for watching the video and reading the article. Don’t forget to like it and subscribe to the “Hobby Home Electronics” channel. Share it with friends. Further there will be even more interesting articles and videos