[Updated]
06/05/2018 - Added Month and Date Reset Feature
This is my first clock project, and used logic IC such as 4017, 4026 to build this clock circuit. Its include Date, Day, and Hourly alarm.See below picture.
It’s very complicated at first sight. But it is not. First of all you can build main circuit and check it work or not.If the circuit work fine, then add other parts step by step to the circuit.
If it’s not work check all component and connections are correct and also check Seven Segment Displays. In my circuit I used LEDs but it is possible to use Seven Segment Displays.
Add &transistors if you use LED or big Seven Segment Displays because this logic ICs can not handle large current. I connect this circuit with 6v backup battery to prevent time lost when the power is fail. In power failure displays are turned off but time is running using battery power.
The reset input should be low (0V) for normal operation (counting 0-9). When high it resets the count to zero (Q0 high). This can be done manually with a switch between reset and +Vs and a 10k resistor between reset and 0V. Counting to less than 9 is achieved by connecting the relevant output (Q0-Q9) to reset, for example to count 0,1,2,3 connect Q4 to reset.
The disable input should be low (0V) for normal operation. When high it disables counting so that clock pulses are ignored and the count is kept constant.
The ÷10 output is high for counts 0-4 and low for 5-9, so it provides an output at 1/10 of the clock frequency. It can be used to drive the clock input of another 4017 (to count the tens).
The reset input should be low (0V) for normal operation (counting 0-9). When high it resets the count to zero.
The disable clock input should be low (0V) for normal operation. When high it disables counting so that clock pulses are ignored and the count is kept constant.
The enable display input should be high (+Vs) for normal operation. When low it makes outputs a-g low, giving a blank display. The enable out follows this input but with a brief delay.
The ÷10 output (h in table) is high for counts 0-4 and low for 5-9, so it provides an output at 1/10 of the clock frequency. It can be used to drive the clock input of another 4026 to provide multi digit counting.
The 4073 has three separate 3-input AND gates which you can use independently.
The inputs of the gate must be connected, either to LOW or to HIGH, and must not be left open circuit. This is the function of the input switches with their pull-down resistors. To avoid loading the output of the gate, a transistor switch indicator circuit should be used. It is good practice with CMOS circuits to insert a decoupling capacitor, 47µF or 100µF, across the power supply. (This helps to prevent the transfer of spikes along the power supply rails.)
The devices also included a per-amplifier which provide simple interface to the driver circuit. The UM348X series is intended for applications such as toys, door bells, music boxes, melody clock/timers and telephones
This is a newly added circuit and use 16F628A micro-controller. you have to program it before use. the purposes of this circuit are show month and reset date according to the month. Ex: Jan 31, Feb 28, Etc. PIC use its internal oscillator and circuit is very simple. To save pins, Month shows binary format.
Ex: 1=0001, 2=0010, 3=0011, etc.
For power supply and more details please refer device datasheet.
/*******************************************************************************
Month and Date Reset - 16F628A
Copyright (C) 2014 Praneeth Kanishka
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses
>> Email: scorpionzblog@gmail.com
>> Web : http://scopionz.blogspot.com
*******************************************************************************/
int count=1, month=1, date=1;
const char day_month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
// Interrupt Service Routine (ISR)
void interrupt()
{
if (INTCON.INTF) // Check for interrupt
{
PORTA.F2=1;
count=count+1;
delay_ms(5);
PORTA.F2=0;
if(count>day_month[month]) {
count=1;
if(++month>12) month=1;
PORTA.F3=1;
Delay_ms(5);
PORTA.F3=0;
PORTA.F2=1;
Delay_ms(5);
PORTA.F2=0;
}
PORTB = month<< 0x07="" a0="" clear="" cmcon="" comparators="" delay_ms="" disable="" flag="" if="" intcon.intf="0;" intcon="0b10010000;" interrupt="" interrupts="" main="" month="" nable="" option_reg.intedg="0;" pcon.oscf="1;" porta.f2="0;" porta="0x00;" portb="month<<4;" rb0="" trisa="0x03;" trisb="0x01;" void="" while="" z="">12) month=1;
PORTB = month<< count="" delay_ms="" if=""> day_month[month]) {
count=1;
PORTA.F3=1;
Delay_ms(5);
PORTA.F3=0;
}
PORTA.F2=1;
Delay_ms(50);
PORTA.F2=0;
Delay_ms(400);
}
}
}
06/05/2018 - Added Month and Date Reset Feature
This is my first clock project, and used logic IC such as 4017, 4026 to build this clock circuit. Its include Date, Day, and Hourly alarm.See below picture.
Preview |
It’s very complicated at first sight. But it is not. First of all you can build main circuit and check it work or not.If the circuit work fine, then add other parts step by step to the circuit.
If it’s not work check all component and connections are correct and also check Seven Segment Displays. In my circuit I used LEDs but it is possible to use Seven Segment Displays.
Add &transistors if you use LED or big Seven Segment Displays because this logic ICs can not handle large current. I connect this circuit with 6v backup battery to prevent time lost when the power is fail. In power failure displays are turned off but time is running using battery power.
Full Circuit Diagram |
1Hz Signal Generators
To generate 1Hz clock pulse for this circuit here I used circuit of a ordinary clock machine. you can buy a clock machine very cheap price at electronic shops or you can get it from old clock. In below picture you can see most common circuits of clock circuits. By giving power to this circuit we can able to get 1Hz output across the pins that are connected to coil (motor). (But actually we can get only 0.5Hz pulse in one pin. So get 1Hz we need to connect those pins by two diodes. you can see that in the diagram).Clock circuits |
4017 decade counter (1-of-10)
The count advances as the clock input becomes high (on the rising-edge). Each output Q0-Q9 goes high in turn as counting advances. For some functions (such as flash sequences) outputs may be combined using diodes.The reset input should be low (0V) for normal operation (counting 0-9). When high it resets the count to zero (Q0 high). This can be done manually with a switch between reset and +Vs and a 10k resistor between reset and 0V. Counting to less than 9 is achieved by connecting the relevant output (Q0-Q9) to reset, for example to count 0,1,2,3 connect Q4 to reset.
The disable input should be low (0V) for normal operation. When high it disables counting so that clock pulses are ignored and the count is kept constant.
The ÷10 output is high for counts 0-4 and low for 5-9, so it provides an output at 1/10 of the clock frequency. It can be used to drive the clock input of another 4017 (to count the tens).
4026 decade counter and 7-segment display driver
The count advances as the clock input becomes high (on the rising-edge). The outputs a-g go high to light the appropriate segments of a common-cathode 7-segment display as the count advances. The maximum output current is about 1mA with a 4.5V supply and 4mA with a 9V supply. This is sufficient to directly drive many 7-segment LED displays. The table below shows the segment sequence in detail.The reset input should be low (0V) for normal operation (counting 0-9). When high it resets the count to zero.
The disable clock input should be low (0V) for normal operation. When high it disables counting so that clock pulses are ignored and the count is kept constant.
The enable display input should be high (+Vs) for normal operation. When low it makes outputs a-g low, giving a blank display. The enable out follows this input but with a brief delay.
The ÷10 output (h in table) is high for counts 0-4 and low for 5-9, so it provides an output at 1/10 of the clock frequency. It can be used to drive the clock input of another 4026 to provide multi digit counting.
4026 display chart |
CD4073 triple 3-input AND Gate
The 4073 has three separate 3-input AND gates which you can use independently.
Truth table
The truth table of each individual gate is:
C B A Output
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
where '0' represents a LOW voltage, and '1' represents a HIGH voltage.
Basic operation
You can investigate the behavior of a single 3-input AND gate using this circuit:The inputs of the gate must be connected, either to LOW or to HIGH, and must not be left open circuit. This is the function of the input switches with their pull-down resistors. To avoid loading the output of the gate, a transistor switch indicator circuit should be used. It is good practice with CMOS circuits to insert a decoupling capacitor, 47µF or 100µF, across the power supply. (This helps to prevent the transfer of spikes along the power supply rails.)
UM348X
The UM348X series is a mask-ROM-programmed multi instruction melody generator, implemented in the CMOS technology. They are designed to play the melody according to the previously programmed information and capable of generating 16 songs with 3 instrument sounds, the piano, the origin and the mandolin.The devices also included a per-amplifier which provide simple interface to the driver circuit. The UM348X series is intended for applications such as toys, door bells, music boxes, melody clock/timers and telephones
Month and Date Reset
Month and Reset Circuit |
Ex: 1=0001, 2=0010, 3=0011, etc.
For power supply and more details please refer device datasheet.