Improving a slow/fast digital clock

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dannyx
    CertifiedAxhole
    • Aug 2016
    • 3912
    • Romania

    #1

    Improving a slow/fast digital clock

    Good day folks. This is one of those things that just popped in my brain and doesn't serve much purpose other than to maybe learn something and get a good laugh out of it, so: I'm using a plug-in timer outlet to turn on some RGB LEDs at a specific hour. It's a cheap nasty thing, so the clock on this thing tends to run fast, that is, it's off by up to 5 minutes after around 2-3 months, so I have to go in there and turn it back again...not a big deal, since we're not talking atomic precision here, but still a chore. That got me thinking if I could do something about it.

    I learned that AC-powered clocks usually get their sync pulse from the 50Hz frequency of the mains...to begin with, is this even true ? If so, I imagine the frequency of the outlet is not perfect at all times, of course, which causes the little clock to run fast. Makes me wonder why it's just this one though - I have like 6 other clock devices in my house which remain perfectly stable and never seem to go off...they probably have a clock chip or some dedicated oscillator (?) ? This got me thinking if I could somehow feed the timer with a stable frequency as well, instead of relying on the mains frequency....just a silly little project, since I KNOW there probably exist better quality outlets for this job, or even the DIY route of building my own using a micro, which I DID think of, but consider to be way overkill for this...or maybe not - actually, let's discuss that as well
    Wattevah...
  • R_J
    Badcaps Legend
    • Jun 2012
    • 9534
    • Canada

    #2
    Re: Improving a slow/fast digital clock

    The 50hz is very accurate, and clocks DO use it for timing (almost all appliances that have a clock use this) But if the sync circuit is defective (bad cap) or is a poor design, spikes on the line can effect it. some light dimmers would effect some of the older clock circuits.
    If the 50Hz is even out of phase the power grid will likely shut down.
    Open the clock and you might see a problem
    Last edited by R_J; 10-26-2019, 10:27 AM.

    Comment

    • Dannyx
      CertifiedAxhole
      • Aug 2016
      • 3912
      • Romania

      #3
      Re: Improving a slow/fast digital clock

      I opened the timer in question a couple of times and as expected it uses a capacitor dropper to step down the mains voltage into something more usable. It even has a built-in NiMh battery so it keeps its settings when you unplug it. I think it has an epoxy blob chip to do the job, instead of an actual IC...can't remember right now. I might open it up again for fun.
      Wattevah...

      Comment

      • eccerr0r
        Solder Sloth
        • Nov 2012
        • 8687
        • USA

        #4
        Re: Improving a slow/fast digital clock

        should look at the board to see what design it uses.

        Some newer AC powered clocks use crystals and those can be notoriously inaccurate after time. Others are pretty good.

        I've heard that line frequency around the world is thinking about devolving from PPM accuracy to save generation money, which would cause serious inaccuracy to clocks depending on line frequency as a timebase. Don't know which locales have switched or never cared to begin with, but it's something to keep in mind.

        Comment

        • redwire
          Badcaps Legend
          • Dec 2010
          • 3900
          • Canada

          #5
          Re: Improving a slow/fast digital clock

          Mains frequency moves up and down but is still pretty accurate over the long term. It's better for timekeeping than a cheap quartz crystal oscillator- because they change frequency based on temperature and supply voltage and aging. So they drift around and do poorly unless the circuit has the right tuning and temperature compensation and regulated VCC. Nobody uses trimmer capacitors like they used to. So those cheap chinese digital clock kits have terrible drift.

          All the older LSI clock IC's used mains for the timekeeping reference signal and it works great until there is a power failure. Mine 1970's with MM5316/LM8361/MM5387 IC has an RC oscillator to keep timekeeping off the 9V battery and it does OK.

          A modern RTC like DS3231 has built-in crystal oscillator and tuning etc. and is very good I set mine maybe once a year.

          I also have a MM5369 using 3.579545MHz crystal (divided to give 50/60Hz) and it is perfect at 25°C but at 20°C or 30°C it goes a many seconds/week off. It's very hard to correct for temperature.

          Comment

          • eccerr0r
            Solder Sloth
            • Nov 2012
            • 8687
            • USA

            #6
            Re: Improving a slow/fast digital clock

            TCXO oven

            Comment

            • redwire
              Badcaps Legend
              • Dec 2010
              • 3900
              • Canada

              #7
              Re: Improving a slow/fast digital clock

              I can't afford the heating bill, lol. It has to be hotter than the highest ambient temp, say 35C and only HAM gear has it.

              I tried to calibrate a Casio watch, but it's cold sitting on the dresser and warm when you are wearing it, so I gave up.

              Found measurements of 50Hz mains frequency: https://wwwhome.ewi.utwente.nl/~ptde...isc/mains.html
              Attached Files
              Last edited by redwire; 10-26-2019, 03:13 PM.

              Comment

              • Curious.George
                Badcaps Legend
                • Nov 2011
                • 2305
                • Unknown

                #8
                Re: Improving a slow/fast digital clock

                Originally posted by redwire
                Mains frequency moves up and down but is still pretty accurate over the long term.

                [snip]

                All the older LSI clock IC's used mains for the timekeeping reference signal and it works great until there is a power failure. Mine 1970's with MM5316/LM8361/MM5387 IC has an RC oscillator to keep timekeeping off the 9V battery and it does OK.
                This USED to be mandated (USA) by regulation (WEQ-006). Cumulative errors of +- 600 cycles (10 seconds) used to initiate a frequency adjustment to bring the average frequency back to 60Hz (slewing about 1 second per hour). That requirement was dropped 3 or 4 years ago. As such, clocks based on synchronous motors or LFC will now drift, over time.

                This is unfortunate as I had developed a very nice clock algorithm that used the LFC as a LONG TERM timebase for a short term PLL that tweeked the local CPU oscillator to obtain precise time even while the LFC was drifting! (i.e., use the local oscillator for timekeeping in the short run -- cuz the LFC varies up to 10 seconds at a time -- and calibrate it against the LFC in the long run -- cuz the XTAL is "low quality"/uncalibrated)

                Technical read, attached.
                Attached Files

                Comment

                • redwire
                  Badcaps Legend
                  • Dec 2010
                  • 3900
                  • Canada

                  #9
                  Re: Improving a slow/fast digital clock

                  I worked in power generation, multiple 400MW coal-fired plants and they did have few hour shifts to correct (long term) frequency. If you throttle down the turbine (lower steam pressure), power output is lower but the grid frequency is just "pushed" less, so it would drop. It was usually at night when grid load is less.

                  I still find mains clocks beating cheap quartz crystals for drift.

                  Comment

                  • stj
                    Great Sage 齊天大聖
                    • Dec 2009
                    • 30956
                    • Albion

                    #10
                    Re: Improving a slow/fast digital clock

                    i bet it's not using mains.
                    post photo's

                    Comment

                    • Curious.George
                      Badcaps Legend
                      • Nov 2011
                      • 2305
                      • Unknown

                      #11
                      Re: Improving a slow/fast digital clock

                      Originally posted by redwire
                      I still find mains clocks beating cheap quartz crystals for drift.
                      That depends on the environment and application. E.g., an XTAL deployed in an environment where there are few temperature variations is relatively stable (like a wristwatch that is ALWAYS worn).

                      I have used an LFC in virtually all of my designs (medical instruments, process control systems, etc.) going back to the early 80's as an accurate (stability != accuracy) and (long term) stable time/frequency base. There's very little cost/space to implementing it. It also gives you an early warning indicator for power failure and, for battery-backed devices, lets you know when you're operating off that battery (without requiring a separate signal from the charger)!

                      I knew that I could accurately measure time intervals with it (using the local oscillator as described above for fine granularity and to eliminate short term drift) and base measurements/controls on those observations -- without the cost/space that a TCXO would require.

                      [TCXOs primarily find use in my maritime products -- huge temperature extremes, poor power quality, absence of local technical support]

                      Knowing the utilities were required to provide this level of service made it a safe design bet.

                      Now, the LFC only has value in frequency locking to the instantaneous mains frequency (to improve SNR, reduce display beating, etc.) -- i.e., I want to SEE the actual variations in line frequency and exploit them!

                      Thankfully, there are other inexpensive sources of time (inverse frequency) information that are now available for many applications (e.g., NTP and PTP for network-connected devices) so you can still avoid the need for a LOCAL precision timebase. (I use a bastardized PTP here to ensure the clocks in my devices track to within a fraction of a microsecond across scores of nodes)

                      Comment

                      • petehall347
                        Badcaps Legend
                        • Jan 2015
                        • 4425
                        • United Kingdom

                        #12
                        Re: Improving a slow/fast digital clock

                        does the timer involve mechanical parts ?

                        Comment

                        • Dannyx
                          CertifiedAxhole
                          • Aug 2016
                          • 3912
                          • Romania

                          #13
                          Re: Improving a slow/fast digital clock

                          Originally posted by petehall347
                          does the timer involve mechanical parts ?
                          No, it doesn't. In fact, here's some pictures of it...not much going on inside. There's a cap dropper, a relay and a couple of capacitors as far as the power side is concerned, so I reckon the brain of it all is on the board on the left where the buttons and display are. The flex cable going between the boards has its pins labeled "VDD, GND, J and PWR". Three of those make sense right away: VDD power for the chip, GND and I would surmise PWR stands for the signal going to the relay trigger circuit. That J is a bit of a mystery and although I haven't taken the board out to see where it leads, I think it might be where it's grabbing the 50Hz sync pulse for the clock ?

                          This particular one is not the one currently in service, but an identical one I had laying around for some unknown reason (I actually had no idea I bought TWO ), so I'll pop this one in to see if it drifts as well over, say, one month's time.
                          Attached Files
                          Wattevah...

                          Comment

                          • eccerr0r
                            Solder Sloth
                            • Nov 2012
                            • 8687
                            • USA

                            #14
                            Re: Improving a slow/fast digital clock

                            One thing that's weird is that the battery is on the power board, does the controller know whether or not AC is applied (when you unplug it, does the LCD go blank?)

                            Comment

                            • Dannyx
                              CertifiedAxhole
                              • Aug 2016
                              • 3912
                              • Romania

                              #15
                              Re: Improving a slow/fast digital clock

                              Originally posted by eccerr0r
                              One thing that's weird is that the battery is on the power board, does the controller know whether or not AC is applied (when you unplug it, does the LCD go blank?)
                              No, it doesn't go blank when you unplug it, so it's a backup battery to save the clock and settings. However, when the battery finally dies out, like this one has after it's sat in a drawer for so long, the next time you plug it in, the display doesn't come on right away like you'd expect, so when I first bought it and brought it home I thought it was defective, but it turns out that battery must reach a minimum lever first before the thing can run, so maybe the capacitor dropper is only charging the battery and the IC runs ON the battery itself rather than on mains...I'll have to do a bit of a dig to find out how the traces are connected to find out for sure.
                              Wattevah...

                              Comment

                              • eccerr0r
                                Solder Sloth
                                • Nov 2012
                                • 8687
                                • USA

                                #16
                                Re: Improving a slow/fast digital clock

                                Ah okay, so it charges the battery and powers to the microcontroller, so that J wire remains a mystery that could be some sort of sync pulse. Need photos of the bottom side of the board, and/or see if there's a crystal on the LCD board...

                                Comment

                                • redwire
                                  Badcaps Legend
                                  • Dec 2010
                                  • 3900
                                  • Canada

                                  #17
                                  Re: Improving a slow/fast digital clock

                                  It would need to use a crystal for timekeeping from the battery. This unit looks like good quality.
                                  I think there is no voltage regulator (maybe just zener Z2) and they wear out the NiMh battery because it's always charging. J might be the battery. It's big at 80mAh for some reason.

                                  It could be the crystal needs tuning or that VCC moves up when the relay is off.

                                  Comment

                                  • eccerr0r
                                    Solder Sloth
                                    • Nov 2012
                                    • 8687
                                    • USA

                                    #18
                                    Re: Improving a slow/fast digital clock

                                    Well, not necessarily, those old alarm clocks used RC oscillators to "keep" time when the power is out...they are HORRIBLE in accuracy when power is out, but better than if it didn't have an RC oscillator. It'd have a clock error equal to at least the amount of time the power has been out...

                                    Comment

                                    • Dannyx
                                      CertifiedAxhole
                                      • Aug 2016
                                      • 3912
                                      • Romania

                                      #19
                                      Re: Improving a slow/fast digital clock

                                      Originally posted by eccerr0r
                                      Well, not necessarily, those old alarm clocks used RC oscillators to "keep" time when the power is out...they are HORRIBLE in accuracy when power is out, but better than if it didn't have an RC oscillator. It'd have a clock error equal to at least the amount of time the power has been out...
                                      Yes, I can fully confirm this with two alarm clock radios I've got which have a 9v backup battery and "keep" the time when their power is cut, though like you said the accuracy is terrible over anything more than a few minutes at best
                                      Wattevah...

                                      Comment

                                      • eccerr0r
                                        Solder Sloth
                                        • Nov 2012
                                        • 8687
                                        • USA

                                        #20
                                        Re: Improving a slow/fast digital clock

                                        I didn't know until fairly recently that crystal controlled (but not TCXO) clocks are fairly common nowadays. I have a few now. I haven't kept track of their drift.

                                        And of course the WWVB clocks... I have one that drifts really badly when it can't pick up WWVB.

                                        On another note, don't forget about all those analog clocks that are "quartz crystal" ... these too are of course use crystals. Don't need to wind them, but are they more accurate than mechanical detent clocks?
                                        Last edited by eccerr0r; 10-27-2019, 06:30 PM.

                                        Comment

                                        Related Topics

                                        Collapse

                                        • SluggerB
                                          Digital desk clock runs fast
                                          by SluggerB
                                          I picked up an old school Timex T121 desk clock from a garage sale. It runs fast, it picks up about a minute or 2 minutes a week.

                                          I wanted to see if there was some sort of crystal or something I could replace that would correct that. I opened it up, however I don't see any type of crystal on the board, although truth be told I am not sure what I am looking for. The only thing that looks like a crystal is a small silver cylindrical component, but that is on the LCD board, not the main board, so I don't think that has anything to do with keeping the time.

                                          I know some...
                                          07-01-2022, 07:25 AM
                                        • socketa
                                          Bestec ATX0300F5WA - fast,or slow blow, fuse?
                                          by socketa
                                          I bought a dead motherboard, and connected it to this PSU,
                                          Was checking the standby voltages on the motherboard, and, whilst doing so, the PSU made a loud bang with a flash of light.
                                          So now i truly got a bang for my bucks, and something else to try and fix.
                                          The fuse was blowen, and the top was blowen off of a TNY276PN chip
                                          The glass fuse didn't have any marking to say if it was fast or slow blow
                                          So i checked the marking on the PCB thinking that that would tell me,
                                          but it 's got a T/F8A printed on the board
                                          So should i get a fast blow fuse, or should...
                                          05-17-2022, 01:22 AM
                                        • joblo37pam
                                          Sharp LC-80LE844U Blinks 2 slow, 5 fast
                                          by joblo37pam
                                          It's been a while since I've checked in here or needed input on narrowing down what to replace on a TV repair, but I've got one on my bench now that has me wondering. The lack of part (board) availability means I may need to do some component-level diagnostics, and a second opinion is always good when it comes to that.

                                          The issue - Sharp LC-80LE844U does not display. Power light comes on for a while, then you can hear a relay click off and the light blinks twice slow, then five times fast. Service manual points to 'Panel Power Supply Error' with this code, but isn't much more help...
                                          10-26-2023, 02:17 PM
                                        • Comp_Pro
                                          820-01949 Running Slow Fast Fan ASD Software Download?
                                          by Comp_Pro
                                          Hello all,

                                          I'm trying to repair this A2251 macbook pro. Board is 820-01949. The original issue was liquid damage which all cleaned up well and the board was not heavily damaged. Unfortunately after liquid damage cleaning the computer is running extremely slow and the fan is running at full speed. Even the cursor is lagging. Because of this I can't use the built in hardware diagnostic to give me a clue as to what is happening. Does anyone know if Apple Service Diagnostic software is available for this model? Any other clues which could help me out? Seems to me there is an issue with...
                                          11-30-2023, 05:33 PM
                                        • Stephen
                                          A1990 MacBook Pro 15" Turning on, loads then boot loops, fan spin slow and then fast
                                          by Stephen
                                          Got a MacBook Pro 15" A1990 with a board issue, The board turns on, I did a DFU revive to see if it needed a firmware patch, that was successful, however the board just keeps boot looping and turning off and on very quickly. Obviously the DATA Is there, but it wont even launch into recovery, it will just die and turn back on with Apple logo, once it gets really hot it dies, if the laptop sits for the day and is cool, it will turn on then get hot within 1 min then die and turn itself on and repeat. Once it does that it turns itself on and off repeatedly in seconds. I put a thermal camera...
                                          10-04-2024, 02:50 PM
                                        • Loading...
                                        • No more items.
                                        Working...