Introduction
In this tutorial we will be making digital clock using “TM1637” 4-digit display and “RTC PCF8563” real time clock module , First we will get “Hour” and “Minute” from real time clock module and then we will use this Hour and minute to display timing on TM1637 4-digital display.
TM1637 4-digit display
TM1637 is used to drive seven segments display , there are many modules available which countain TM1637 chip to form a 4-digit numerical display module.
Features
- Use either the raw segment value or decimal number
- Set either the whole display or any digit independently
- Control the brightness
- Pure software impelementation
Pin description
TM1637 4-digit display have 4 pins
- VCC
- GND
- CLK (clock pin for I2C communication )
- DIO ( Data Input output pin )
Circuit diagram
- Connect ‘VCC’ of ‘TM1637’ module to ‘VCC’ of evive
- Connect ‘GND’ of ‘TM1637’ module to ‘GND’ of evive
- Connect ‘CLK’ of ‘TM1637’ module to pin number 2 of evive( Yellow wire in circuit diagram given below)
- Connect ‘DIO’ of ‘TM1637’ modue to pin number 3 of evive(White wire in circuit diagram gien below)
Steps for setting time
- First connect evive with computer ( using USB A -B cable ) , then upload the code which is given below
- Then move slid switch-1 in “UP” position and use Potentiometer-1 and Potentiometer-2 to set Hour and minute as show above
- Potentiometer-1 and Potentiometer-2 are connected internally to analog pin A9 and A10 of evive respectivly , they will give digital reading (from 0 to 1023) ,we will use map function to convert them (form 0 to 59 and 0 to 12 ) for minutes and hour
- After setting time using potentiometer-1 and potentiometer-2 , move slid switch-1 in “Down” position , this will start to display timing on TM1637 4 digit display module
Arduino code
Libraries used in the code
Expected Result