Binary clock

Discussion in 'General Electronics Chat' started by arthur92710, Jan 19, 2008.

  1. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    so it is 1Hz.
     
  2. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    Wait... You want a Hour:Minutes.Seconds clock? If yes it is a 1Hz clock. But if you want Hour:Minutes clock you have to calculate the frequency based on the period, where the period is somehow the time needed for a change in the counters (i.e.: passing form 23 minutes to 24 minutes).
     
  3. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    H:M:S would be the best they way you describe it. 1Hz is easier then calculating the period... This will need more logic gates right?

    Im trying to make this in electronics workbench (or National instruments 10)
    They have the 163 counter but I have no clue what to do.
     
  4. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    You are not understanding what I'm telling you...

    I'll try to explain what you need to do and how it happens...


    A clock is made by various counter where in general a counter corresponds to a digit. But a counter doesn't work by himself it need a signal to tell him when to update its state and that signal is the clock signal (do not confuse this), also called CLK. By far you know that counter update based on a signal so if you want H:M.S clock it needs to be updated every... one second right?! So if you want to make a H:M clock (this option is simpler) it needs to be updated every... sixty seconds.

    So far you have the counters and gates for interconnecting them but there's one thing missing... and it is the clock signal (or CLK) before you buy any IC (the 555 timer) you need to know what kind of CLK you need but you may ask: how do I know which kind of CLK I need? That depends on the period/update time of the counters.

    Example: if you need an update every 1s you will need a 1Hz CLK, but if you want an update every 1min (60s) CLK you will need a 16,6(6)e-3Hz CLK, again you may ask how do I get those values? Using this formula:

    frequency (Hz) = 1 / Period (seconds)
    1Hz = 1 / 1 second
    16,6(6)e-3Hz = 1 / 60 seconds

    Wow... That as exhausting...
    Hope helped...
     
  5. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    I forgot to tell you that the calculation of the clock is made by you and not by the circuit...
     
  6. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    Right so the 555 will make a 1Hz signal. That will go to the counter, on the CLK pin, right?
     
  7. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    Yes, but you really want a H:M.S clock or a H:M clock?
     
  8. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    Yes an H:M.S
     
  9. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    [​IMG]

    It counts to 12(1100) and resets. This will be the hours. but there are not 12 in a day there are 24. So i need a AM/PM led. How would I get that to work?

    So I just have to make 2 more. one for minutes and one for seconds. They will be the same but minutes and seconds go up to 59. So how do i get a 4 bit counter to display 59, a 7bit number?
     
  10. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    About the LED you can make that when you go to the 12:00 it inverts the LED. You can make this a single Flip-Flop (use a Tlip-Tlop or T Filp-Flop).

    About the minutes issue: that isn't possible you need two counters.
     
  11. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    About the circuit you provide it is incorrect. You can't connect the RCO pin to the LOAD pin (you can but I don't see any logic in). Left RCO pin unconnected and connect LOAD pin to Vcc.
     
  12. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    Right I deleted it now.

    So i will need 2 counters for the minutes and 2 for the seconds. and one for the hours.
     
  13. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    Yes, but two bits will be discarded because to represent 59 you will need only six bits.
     
  14. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    Ok ill try to get that to work.
     
  15. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    I have tried to make the counter count from 0 to 15 but it keeps skipping numbers. I have uploaded a video to youtube so you can see, but its verifying.
    I have the 555 making a clock of about 1hz and i have tried 3 different chips, they all count the same. Could the chips be bad? What can/should I do?

    Heres the video
     
  16. SgtWookie

    Expert

    Jul 17, 2007
    22,201
    1,809
    I see a LARGE electrolytic cap near the 555 - is that your timing capacitor? :eek:

    If so, I suspect you have very low values for your timing resistors. When the 555 toggles states, that big cap across the low resistance is likely pulling Vcc down quite a bit. This could cause all kinds of problems, including lost/multiple counts.

    You must maintain Vcc on TTL devices between 4.75v and 5.25v at all times to ensure reliable operation.

    I don't think the counter has Schottkey inputs. This means a slow-rising input may cause multiple counts, particularly if you do not have bypass capacitors on each IC between Vcc and ground. Bypass capacitors are typically 0.1uF to 2.2uF. Adding a Schottkey-input TTL gate between the timer and the counter will help a great deal to "square up" the waveform.

    I've attached a 555 timer circuit with smaller values of R and C. Keep in mind that such a timer won't ever be really accurate, as even a small change in temperature will cause component values to change enough to throw the timing off. If you wanted your clock to be at least somewhat accurate, you would need to use a crystal oscillator and a divide-by counter circuit. If you wanted it to be even more accurate, you would need to temperature-stabilize the crystal oscillator.
     
  17. adrian.dmc

    AAC Fanatic!

    Feb 22, 2007
    53
    0
    I think the timer is correct because number change at a constant rate.
    The problem can be in the way you drive the LEDs try connecting then via a resistor (330 ohms).
     
  18. SgtWookie

    Expert

    Jul 17, 2007
    22,201
    1,809
    good call on the LEDs being part of the problem, adrian.dmc

    However, this IC isn't designed to source much current; just 800uA. It can SINK up to around 15mA, but that leaves the validity of the TTL signal level in question.

    But by sinking the current instead of sourcing it, the LEDs would be off when they need to be on. An open-collector inverting buffer could handle that. A 7405 or 74S05 would be a likely choice; it will sink up to 20mA per gate. The 74L05 or 74LS05 would not be suitable, as it's limited to around 2mA sink per gate.

    Even at the low level output, a 7405 would have somewhere around 0.4v to 0.5v, that would need to be taken into consideration when figuring the LED current. It looks like he's using blue LEDs, which seem to require 3.8 to 4v to get the rated current.

    But, let's just throw some numbers out there. If they are in fact blue LEDs rated for 3.8V @ 15mA (perhaps conservative, but that's OK) let's get the voltage to drop remaining after the LED and gate drop.
    Vdrop = 5V (Vcc) - 3.8v (LED) - 0.4v (7505 output V when low)
    Vdrop = 5 - 3.8 - 0.4
    Vdrop = 0.8
    Calculate the resistance to limit current to 15mA across 0.8V using Ohm's Law:
    R = E / I (Resistance = Voltage / Current)
    R = 0.8V / 15mA
    R = .8 / .015
    R = 53.33 ... Ohms
    The closest standard value is 51 Ohms. Let's see what happens to the current:
    I = E / R
    I = 0.8 / 51
    I = 15.7 mA - that's within 5% tolerance; not bad.
    Let's check resistor wattage:
    P = E x I (Power in Watts = Voltage x Current)
    P = 0.8 x 0.0157
    P = 0.01256 Watts
    A 1/10 Watt resistor would be more than sufficient.
    (I'm going through this exercise so that the OP can calculate it for themselves.)
     
  19. arthur92710

    Thread Starter Active Member

    Jun 25, 2007
    307
    1
    Ok if the 555 is to in accurate how can I use a crystal? I have no experience with them.
    would I just connect the crystal to the clock and battery?
     
  20. SgtWookie

    Expert

    Jul 17, 2007
    22,201
    1,809
    No, it's a bit more involved than that.

    You can make a reasonably stable timebase using a Texas Instruments' CD4045 IC, a 2.097152 MHz crystal, and supporting components.

    There is a vendor on Ebay who sells a 1-Hz clock kit using the above described components; the kit is here:
    http://cgi.ebay.com/ws/eBayISAPI.dl...tToStoreCat&refwidgettype=cross_promot_widget
    The above kit does not include the IC; that is in another auction:
    http://cgi.ebay.com/ws/eBayISAPI.dl...tToStoreCat&refwidgettype=cross_promot_widget

    I have done no business with that seller, so I can't tell you anything more than the information being supplied appears to be accurate. I don't know if this seller combines shipping, but even if they do, your cost for a complete 1 Hz clock kit will set you back a minimum of $8.61. I would not buy them at those prices, but at least you can see what is needed.

    There ARE other ways to get an accurate clock. Your binary clock is going to need a power supply, right? If you run it from batteries, they'll get discharged pretty rapidly due to the LED's current draw and the TTL circuitry sucking up power. You could use the 60Hz output from a transformer's secondary winding as a clock to a Schottkey-input divide-by-60 counter to get a very accurate timebase. You would need to use a voltage divider network and clamping diodes to keep the sine wave within specified limits of the IC.

    You could keep the 555 timer circuit to use in the event of a power failure, to keep time in reserve (LEDs off, of course.) SOME clock is better than no clock at all, right? You don't want to miss your alarm, do you?

    Oh yes, no alarm programmed yet... well, give it time - this project could become quite complex, and eat up all the ICs on the planet ... ;)
     
Loading...