7 Segment Led Clock
.png)
This is a simple seven segment clock using leds and controlled by an arduino
Supplies
.png)
.png)
.png)
.png)
If you have hard-time 3d printing stuff and other materials which i have provided in this project please refer the professionals for the help, JLCPCB is one of the best company from shenzhen china they provide, PCB manufacturing, PCBA and 3D printing services to people in need, they provide good quality products in all sectors
Please use the following link to register an account in JLCPCB
Pcb Manufacturing
----------
2 layers
4 layers
6 layers
PCBA Services
JLCPCB have 350k+ Components In-stock. You don’t have to worry about parts sourcing, this helps you to save time and hassle, also keeps your costs down.
Moreover, you can pre-order parts and hold the inventory at JLCPCB, giving you peace-of-mind that you won't run into any last minute part shortages. jlcpcb.com/RNA
3d printing
-------------------
SLA -- MJF --SLM -- FDM -- & SLS. easy order and fast shipping makes JLCPCB better companion among other manufactures try out JLCPCB 3D Printing servies
JLCPCB 3D Printing starts at $1 &Get $54 Coupons for new users
Parts Needed
Arduino nano
Leds
Board
Wires
Soldeing iron
Switch
Female Headers
The clock is made using arduino and other components as mentioned the files and all pictures are attached below
the control of the clock is done by arduino or you can use 74HC595 Drivers for easy control
In this case, I used it to simulate an analog clock without its hands, with very interesting results. The hours and minutes are placed around the center of matrix giving a familiar look of analog clocks. The code I have developed applies a little of trigonometry (sine and cosine) to calculate the coordinates of hours and minutes to be shown into LED matrix. With that I saved many lines of coding.
Every time you reset or restart the Arduino, the time mode will change.
The first four digits at left of display show the hours and minutes in decimal numbers. The next three digits show the hours, minutes and seconds in binary notation and the last digit at right inform the weekday.
About the code, I had to develop a way to use the "LedControl" library to turn conventional 7-Seg decimal display into a Binary display. The solution is to use "setRow" function that is usually applied for dot matrix display.
Assembly
.png)
.png)
.png)
.png)
24-hour clock display need six seven segment displays. But for building digital clock we have to use only a single microcontroller. The problem we face is the lack of input pins on the microcontroller. In Arduino UNO it contain ATMEGA328p microcontroller which has 23 input pins only. Whereas for making clock we require six displays. As one display would take 8 pins and so three SSD would take 24 pins. For making the connections we have to use multiplexing all the seven segment displays.
Soldeing
.png)
.png)
.png)
.png)
The display should be such that SU will count from 0 to 9 for every second, ST will count 0 to 5 for every 10 seconds. Similarly, MU for every 60 seconds and for MT for every 10minutes. HU should also be same as SU and MU but for every 60 minutes and MT for every 10 hours. Keep in mind when the display shows 23:59:59 it should reset to 00:00:00 and again run. For making the digital clock first we need to execute the program for a single display to run decade counter in a seven segment displays The breadboard can be divided into 5 segments. In each of the green segments the pins are internally connected so as to have the same voltage. Similarly, in the central segments the pins in each column are internally connected in the same fashion as the blue columns
.png)
.png)
.png)
.png)
In the control of display I have used an Arduino Uno R3 and 02 ICs of 74HC595 (8 bit shift register with output latches).
The use of shift register is important to save output ports of Arduino and with it is necessary only 3 outputs of Arduino to control the display.
There are two breakouts: one for the sensor of temperature (ºC - Celsius / ºF - Fahrenheit degrees) and humidity (in %) and another one for the RTC (Real Time Clock).
The assembly is very simple, but is necessary to pay attention with the jumpers connections.
.png)
.png)
.png)
.png)
The assembly of components is very simple but you need to follow the schematics with care due to the wire connections. There are 2 shift registers in this project: one to control each segment of the display and another one to control what is the display on.
Important: If you want to use another kind of LED display, you need to check its datasheet in order to update the output wiring (jumpers) of 74HC595 and also you must update the corresponding logics of Arduino's software.
.png)
.png)
.png)
.png)
The following binary data represent the relation between the digits (0 to 9) and the segments (A to G) of LED display:
- B01111110 - 0
- B00110000 - 1
- B01101101 - 2
- B01111001 - 3
- B00110011 - 4
- B01011011 - 5
- B01011111 - 6
- B01110000 - 7
- B01111111 - 8
- B01111011 - 9
To show in the LED display all the data in sequence for the time, temperature and humidity, I have used a "timer" with the functions millis() and while(). In this case, each information is presented on the display in sequence after 03 seconds of each one. Simple and very efficient.
You can apply this function millis() in several different ways to manage the time during the program running. In many situations you can use it in the place of some timer library.
Another usefull function is digitalWrite() that can simplify the writting of data into the shift registers.
This project uses the Arduino internal clock. It is not so accurate as an external RTC (Real Time Clock), but for the purposes of this project, it works very well.
Just keep it pressed for adjustments.
The hours are shown in the display by numbers between 1 and 12. The minutes are shown by numbers between 0 and 55 in steps of 5 minutes.
In the last column of display is shown the fractional minutes from 1 to 4 that must be added to the minutes shown in the main template of clock.
In the middle of display, there is an LED blinking each second and there are also two LEDs for AM and PM indication.
Files
These are the files for the project