The Clock Project


I created this clock for everyone who is interested in electronics. Even if you have never designed any electronics before, by following this step-by-step youtube tutorial you will design and manufacture this clock.
Watch and follow the tutorial here: https://youtu.be/bcvq30J4SnQ
This is a nice clock with big segments and you can set color and intesity of each segment. There are three buttons, buzzer, light sensor and RTC with battery backup. The clock is powered through USB C and has features such current time, timer and stopwatch. Feel free to add your own features!
Why I designed this clock?
- it's a very simple project, so it was fun
- I often need a clock with big display and the right color and intensity when checking time in the middle of the night without my glasses on
- I often need a simple timer or stopwatch for example when cooking
The clock has three modes: Clock, Stopwatch and Timer. To switch between the modes press the buttons. The clock has battery backed RTC to keep the time always accurate. A simple web interface can be used to change default settings. I will write more detialed manual if there is interest.
Supplies
All necessary files are available at the links below:
- Download all files of this project here (GitHub) - https://github.com/FEDEVEL/clock
- Schematic & PCB is here (OSHWlab) - https://oshwlab.com/robertferanec/clock
Software apps and online services used in the project:
- EasyEDA - https://easyeda.com/
- LCSC - https://lcsc.com/
- JLCPCB - https://jlcpcb.com/
Start With EasyEDA

No installation is needed. Just open EasyEDA in your browser, register and log in (it's free). Use the Pro edition. Instead of starting from scratch, search for Robert Feranec and open the Custom Keyboard project. Save it under a new name, e.g., "clock".
Clean Up and Rename

Rename the project and schematic to "clock". Open the schematic page, clean unnecessary parts from the original project, and rename key elements. Keep only what's relevant for the clock project. Save your work often.
Add LED Display Segments

Use addressable LEDs for the 7-segment display. Add, copy, and paste LEDs into the schematic. Rename net names (e.g., LED11, LED12...) so they are clear in PCB layout later. Add LEDs for dots and AM/PM indicators as well.
Add Header for External LEDs

Insert a header for optional external LEDs. Find the part on the LCSC website and copy its part number into EasyEDA. Add power, ground, and input connections. Mark this component as "NF" (Not Fitted) and remove it from the BOM.
Add Level Translators

Add level translators to interface 3.3V microcontroller with 5V LEDs. Connect them to appropriate GPIO pins (e.g., GPIO18, GPIO28). Rename nets accordingly and update schematic labels.
Add Buzzer Circuit

Add a buzzer and place it on a second schematic page. Use a passive 9mm buzzer with supporting components: resistor, diode (e.g., 1N4148), transistor, and optional capacitor (marked NF). Make sure to include ports for cross-page net connections.
Add User Buttons

Place three tactile switches for user input. Use standard push buttons (e.g., with various heights for enclosures). Rename them to User Button 1, 2, and 3, and connect them to GPIO pins 13, 14, and 15.
Add Light Sensor

Use a light-dependent resistor (LDR) and create a voltage divider. Add a parallel capacitor (marked NF). Add a note explaining the light sensor will be moved to the top of the board after manufacturing. Connect to an ADC pin on the microcontroller.
Add RTC (Real-Time Clock)

Add an RTC chip with built-in oscillator. Connect power, ground, and I2C lines (with optional external pull-ups). Add battery backup using a low-profile CR battery holder. Add 1 Hz output connection and label VBAT. Mark components on top layer as "NF" for cheaper manufacturing.
Customize USB Connector

Replace right-angle USB connector with a vertical one. Edit the symbol in EasyEDA library editor to match pinout. Save and reinsert the new version into the schematic.
Check Design and Import to PCB

Run a DRC check to ensure no schematic errors. Then, import changes to the PCB editor. Keep microcontroller placement and delete other parts. Unlock layers and remove old enclosure models. Proceed with updated schematic content.
Set Up PCB Layout

Change default track width from 6 mil to 8 mil. Set grid to 100 mil. Place mounting holes using exact coordinates. Draw board outline with rounded corners. Lock mounting holes and microcontroller. Move all components to the bottom layer.
Place Display LEDs and Capacitors

Place LEDs for 4-digit 7-segment display and dot indicators. Maintain order for firmware compatibility. Place decoupling capacitors near each LED’s power pin, using visual aids like net color coding and component filters.
Place and Organize Remaining Components

Place buttons, buzzer, light sensor, RTC, voltage regulator, headers, and level translators. Hide designators where distracting. Use logical grouping and layout for easier routing.
Route PCB

Start layout using standard rules. Place vias and draw signal and power tracks. Use 8 mil for digital, 20 mil for power. Follow trace width and spacing recommendations. Place ground vias first to avoid rerouting. For special signals like USB, use differential pair rules.
Draw Polygons for Power and Ground

Add copper regions for LED power and 3.3V. Use appropriate priorities in Copper Manager. Draw ground polygons on bottom and inner layers. Add stitching vias where signals change layers to ensure proper return paths.
Add Logo and Text

Place your logo on the bottom solder mask layer for a gold effect. Add copper under the logo and connect to ground. Add readable silkscreen text for button labels, versioning, project name, and a reference to your website (optional).
Generate Manufacturing Outputs

Use the "Export" tab in EasyEDA to generate Gerber files, BOM, pick-and-place files, and 3D model files. Download or send them directly to your PCB manufacturer. Ensure the correct layers and fabrication settings are selected for accurate production.
Order the PCB and Assembly

Upload the manufacturing outputs to a PCB fabrication service such as JLCPCB. Select assembly options, quantity, and desired delivery time. Review the component sourcing, confirm the BOM, and complete the order.
Build the Clock

Once the PCB is delivered, solder any through-hole components manually (e.g. battery holder, buttons). Fit the PCB into your enclosure. If you designed 3D-printed parts, assemble the full structure using screws or clips as needed.
Upload the Software

Connect your microcontroller via USB and flash the firmware using your preferred tool (e.g., Thonny, Arduino IDE, or a custom script). The firmware will control the LED display, RTC, buzzer, light sensor, and user inputs.