Big Digital Clock using Arduino Atmega328 with Weather

In this project, I will make Big Digital Clock using Arduino Atmega328p DS1307 DHT22 & 4 Digit 7 segment display made from normal LEDs. This clock is homemade with zero PCB.

Big Digital Clock using Arduino Atmega328p DS1307 RTC DHT22

Components for Digital Clock using Arduino

  • ATmega32p Microcontroller
  • DS1307
  • Crystal 32.768KHZ & 16 MHz
  • 4 Digit 7 segment Display (Ownmade)
  • DHT22
  • MicroUSB Pinout
  • USB TTL
  • Female Headers
  • BC547 (4pcs)
  • 10K Resistor (7 pcs)
  • 5.1K
  • 100 ohm /1W
  • Push Button
  • IC Base (8 & 28 pins)
  • 0.1uf Ceramic Disk Capacitor
  • Cr2032 Battery with holder
  • Zero PCB (100 X 150 mm)
  • RED Led (114 pcs)
  • 2mm PVC Corrugated Sheet
Big digital clock using atmega328p

What is Digital Clock?

The digital clock is a clock where time is shown in a digital 4 digit 7 segment display. In this clock time is very accurately calculated because of here Crystal is used.

What is 7 Segment Display?

7 Segment display is a special type of display mainly made of LEDs to show English Digits. Here no LCD or LED pixel-like display is used. We use cheap 5mm LED bulbs to make it. This display is mainly capable of showing English digits. Though many English alphabets it supports. This type of display mainly used in the digital clock for example in Railway station.

7 segment display have 7 segments i.e. A, B, C, D, E, F, G to show a digit.

7 segment digit display

How does 7 Segment display work?

In the display, we connect LEDs in parallel for a single segment. All the LED’s one leg i.e. Anode or Cathode is commonly connected.

When we send a voltage signal for the particular segment to glow it will light up only that segment.

Types of 7 Segment Display

There are mainly two types of 7 segments display.

Common Cathode 7 Segment Display

In this type of display, all the negative legs of the LEDs of a digit are connected to the Ground or negative point of a battery.

Common Cathode  7 Segment Display

Common Anode 7 Segment Display

In this type of display, all the positive legs of the LEDs of a digit are connected to the Positive VCC or positive point of a battery.

Common Anode  7 Segment Display

How to make 4 digits 7 Segment Display at Home?

Here I have used 114 Red LEDs in making this display.

4digit 7segment display DIY

Connection of Common Anode 4 Digit Display

I have connected all the positive legs of one digit to all LEDs and took a wire out from it. So a total of 4 wires from 4 digits. I will connect it in Digital pins 1, 2, 3 & 4 of Atmega32p.


I have used 4 LEDs for all the segments. Then I have connected all the same segments of 4 digits with each other. That’s mean all the 4 A segments of 4 digits will be connected internally. In this way, a total of 7 wires will be coming out for segments i.e. A, B, C, D, E, F & G.

4digit 7segment display pin out

These 7 Wires I will connect with Digital pins 5, 6, 7, 8, 9, 10 & 11 of atmega32p Arduino IC.

Next, there are 2 single LEDs for Colon or Decimal points. From there 3 wires will come out i.e. 2 positive legs for 2 LEDs & one common Ground.

These two LED’s positive legs will be connected to Digital Pin 12 & 13 or Arduino atmega32p IC.

Atmega32p with Bootloader

The atmega32p Microcontroller here I am going is already bootloader loaded. So if you have newly purchased atmega32p make sure you have burned the bootloader in atmega32p.

Atmega32P Pinout

Atmega32P Pinout

Digital Clock using Arduino Atmega328p Circuit Diagram

As discussed earlier in the circuit we have connected 4 digit pins between Digital 1 & 4. Segment pins are connected between digital pin 5 & 11. Colon LEDs are in digital pin 12 & 13. DHT22 Sensor data pin connected at the A1 pin.

Big Digital Clock using Arduino Atmega328p DS1307 DHT22

Here we also made 5 pins opened via female headers for the code uploading. You may discard that if you upload the working code given below. I made this for experimenting with codes.

Required Libray for Digital Clock using Arduino

DHT22 Temperature & Humidity

I have used the DHT22 sensor to get the present temperature & humidity reading. This sensor gives very accurate data.

DS1307 RTC Module

To keep the real-time clock data when there is no external 5V DC power source, we used the DS1307 RTC module. In fact, I made my own module using DS1307 IC. There is also one crystal of 32.768 kHz & CR2032 battery needed to keep the clock up to date.

Code for Digital Clock using Arduino Atmega328p DS1307 DHT22

Hex Code of Big Digital Clock using Atmega3282P

Code explains of Big Digital Clock using Arduino

Basically in the code, after every 4 seconds display changes its values from date, time, year, temperature & humidity.

Caution

Do not use the delay function with this 7 segment display. To use delays we used millis() function smartly in the main function inside for loop.

We have done all the required calculations and setting output in switch cases & all the output values kept in character array.

In the code, you may see I have written “N” in the place of “M”. This is not by mistake. Because 7 segment displays can not show alphabets like M, W, etc. as N nearly looks the almost same as M, I did it so. If you do not like it, you can skip it.

Project Outcome of Digital Clock using Arduino Atmega328p DS1307 DHT22

Big Digital Clock using Arduino Atmega328p DS1307 DHT22

Here you can see in the image the time is showing in 24-hour format.

Video Tutorial for Digital Clock using Arduino

Conclusion

This may be a very cool project for college. You can make it very easily at home at very low cost.

You can add a 5V step-up circuit with lithium ion battery & TP4016 circuit to make it a rechargeable clock. Alternatively, you can attach a power bank to power up it. I use an old mobile charger to power it up.

Share with Friends
2 2 votes
Rating
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments