Oscillator for discrete digital clock - Page 1
Forum section: electronics / projects

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 05:13:53 pm
content: Hello.I'm wondering and pondering a new project. An all discrete digital clock. Can someone suggest me some approaches for the oscillator part of the circuit as obviously it should be fairly slow, but stable. Am I right? Or is there a nice trick to drop the typical quartz kHz oscillator pulse to something more useful for a minute counting, without piling a hundreds of parts just for that.

author: zztech
author_rank: Newbie
timestamp: February 18, 2018, 05:39:26 pm
content: You can build oscillator with quartz and CMOS or TTL IC's. You have to divide frequency to 1Hz.http://www.electroschematics.com/225/1hz-generator-and-2hertz-oscillator/This is one typical circuit. You can use also microcontroller.

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 05:45:37 pm
content: Hmm... Too many ICs..Thank you for that idea, but no I try to avoid using any ICs even if "old" ones. All discrete basic parts crystals, diodes, transistors etc.Is the 32kHz the minimum frequency of commercial crystals?

author: Kalvin
author_rank: Super Contributor
timestamp: February 18, 2018, 05:50:44 pm
content: Looking for something like this?https://upload.wikimedia.org/wikipedia/commons/6/6d/Transistor_Clock.jpgNo ICs included

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 05:51:42 pm
content: Quote from: Kalvin on February 18, 2018, 05:50:44 pmYes... But with better implementation.That one seems to take the base clock signal from the mains. Not too exited.

author: iMo
author_rank: Super Contributor
timestamp: February 18, 2018, 06:02:04 pm
content: QuoteFor a "minutes counting" (60secs period) and built with discrete components search for "fet astable multivibrator". Carefully designed (voltage stabilization, quality foil capacitors, stable resistors, transistors kept at same temperature) you may achieve +/- few minutes a day

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 06:04:13 pm
content: Quote from: imo on February 18, 2018, 06:02:04 pmThat wouldn't be a clock, but a counter.

author: Kalvin
author_rank: Super Contributor
timestamp: February 18, 2018, 06:08:55 pm
content: Quote from: Vtile on February 18, 2018, 05:51:42 pmIt should be quite easy to build a 32.768 kHz xtal oscillator and build 15 divide by two flip-flops giving 1 Hz.

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 06:19:18 pm
content: ... It would take ~250 parts if I'm not terribly mistaken....But this project doesn't make a much sense anyway.

author: Kalvin
author_rank: Super Contributor
timestamp: February 18, 2018, 06:23:53 pm
content: Using 0201 size passives and SOT-723 transistors it might be surprisingly small, though. Wristwatch made using discrete components!

author: iMo
author_rank: Super Contributor
timestamp: February 18, 2018, 06:27:32 pm
content: You may buy thisWatch, glue a piezo sensor on it, follow with a single fet pre-amplifier, and you get a quite precise ~few pulses per second. The cheapest way to continue with your project as far as the discrete components number is concerned

author: daqq
author_rank: Super Contributor
timestamp: February 18, 2018, 06:28:47 pm
content: QuoteCertainly these days. You might find some old lower frequency ones, or have custom ones made.QuoteI suppose that if you desperately want to avoid using a binary prescaller (32768 Hz / 32768 = 1 Hz) you could try something more exotic, like get to precission oscillators, 1 Hz apart, do the XOR of their outputs, run it through a low pass filter and get the difference. Maintaining that difference would be pretty critical and difficult. But it's possible.You can't beat the stability of a crystal by any simple means. Sure, you can use an RC oscillator as a timebase, but that's just silly. Or, go the electro mechanical route, use a tuned fork oscillator. Or something similar.

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 06:32:35 pm
content: Quote from: Kalvin on February 18, 2018, 06:23:53 pmI had actually something like, which I just found in mind:https://hackaday.io/project/27410-uncon-talk-discrete-d-flip-flops

author: Kalvin
author_rank: Super Contributor
timestamp: February 18, 2018, 06:33:51 pm
content: 50 Hz is everywhere. Just make a high gain amplifier and you have a timebase. No pesky xtals needed. It won't work outside nearest power line, though. But if you make a self-oscillating circuit with 50 Hz resonance and inject the amplified 50 Hz mains, it will keep accurate time near power lines, and it will keep time as "best effort" outside 50 Hz mains.

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 06:34:06 pm
content: Quote from: daqq on February 18, 2018, 06:28:47 pm.. Or some form of PWM to voltage conversion and comparator. Outcome again would be something more like a counter. I would assume....part count unknown.

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 06:35:47 pm
content: Quote from: Kalvin on February 18, 2018, 06:33:51 pmThat is interesting approach. Is that called a locking oscillator.

author: Kalvin
author_rank: Super Contributor
timestamp: February 18, 2018, 06:37:41 pm
content: Quote from: Vtile on February 18, 2018, 06:35:47 pmhttps://en.wikipedia.org/wiki/Injection_locking

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 18, 2018, 06:42:22 pm
content: I stumbled across this...http://wwwhome.cs.utwente.nl/~ptdeboer/misc/mains.htmlwhich was quite interesting i.r.o. mains frequency derived clocks."discrete"? is that really what you meant?

author: daqq
author_rank: Super Contributor
timestamp: February 18, 2018, 06:42:45 pm
content: QuoteWell, if you want an RC oscillator of that kind, you're going to have to go into really precision components. It would be interesting to see how accurate and stable you could make an RC (or similar) oscillator, if you used really high end parts, such as the LM399/LTZ1000, precision few ppm resistors, exotic comparators... the greatest problem would probably be a stable enough capacitor, though you could thermostat (and maintain precise humidity) it.

author: Vtile
author_rank: Super Contributor
timestamp: February 18, 2018, 07:02:14 pm
content: Quote from: NivagSwerdna on February 18, 2018, 06:42:22 pmThe mains synchronized clock would be the easiest and since it of course will be pretty power hungry contraption the mains power (and base clock pulse) would be there anyway. Interesting article, If they really do synchronize the grid to the reference time and frequency and not just to 50 Hz.Just AC 12V or so transformer feed to the clock itself and then there is many easy ways to get the clock pulse from it. Crystal oscillator approach would be nice and allow use this as boat clock middle of the ocean.Discrete yes, discrete transistor / diode design.I think the stable capacitor would be the most difficult part in the analog / digital hybrid. Let see this have been really a great help already to get my thoughts a bit more oriented.I need to make my mind of I go for CMOS or TTL chip driven precision crystal or mains synchronized design, I think the D-flipflop divider from 32k crystal with discrete transistors screams a bit too much a lifetime project. Need to check my junk part box as there is all sort of old junk .. in hope of slow crystal.edit. some missing words added.

author: David Hess
author_rank: Super Contributor
timestamp: February 19, 2018, 12:24:06 am
content: If Kalvin had not linked that I would have. A series of injection locked oscillators can divide the 32,768 kHz crystal oscillator down to 1 Hz. Since injection locked oscillators can divide by more than 2, fewer stages are required.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 19, 2018, 10:11:47 am
content: Quote from: Vtile on February 18, 2018, 07:02:14 pmI wonder if you will ever finish.

author: TomS_
author_rank: Frequent Contributor
timestamp: February 19, 2018, 10:30:54 am
content: Quote from: NivagSwerdna on February 19, 2018, 10:11:47 amI built one using discrete NOR logic. I blogged about it, and all of the schematics are available on github: ornotblog.blogspot.comMine took about 5 months of reasonably intense work during evenings and over weekends to complete, and uses about 1500 transistors (roughly 2400 components in total).You really do need to be committed...

author: Zero999
author_rank: Super Contributor
timestamp: February 19, 2018, 11:25:34 am
content: Quote from: Kalvin on February 18, 2018, 06:08:55 pmQuote from: Vtile on February 18, 2018, 06:19:18 pmIt's possible to build a divide by two counter with just two transistors.

author: David Hess
author_rank: Super Contributor
timestamp: February 19, 2018, 11:50:43 am
content: I like the idea of usingdiscrete injection logicwith the base resistors replaced with emitter resistors but it requires more transistors. The bias voltage to the current sources can be adjusted for the lowest speed and power.

author: richard.cs
author_rank: Super Contributor
timestamp: February 19, 2018, 12:10:12 pm
content: If you want to avoid lots of dividers I think your options are either a mains-derived timebase (implemented as either a receiver injection locking an oscillator or a direct connection), or a tuning fork oscillator.If you wanted to go for the tuning fork approach the oscillator only needs one transistor. 440 Hz tuning forks are most common but a quick google search found these:https://colourofsound.org/shop/sound-therapy-instrument-shop/tuning-forks/otto-tuning-forks-32-hz-64-hz-128-hz/which go down to 32 Hz. Convenient as both a low frequency and a simple binary division to 1 Hz. They would probably need calibrating.

author: ogden
author_rank: Super Contributor
timestamp: February 19, 2018, 12:11:26 pm
content: Electromechanical pendulum running at > 1Hz, like 4Hz? IMHO it will add eye catching value to the thing you are building.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: February 19, 2018, 01:23:18 pm
content: Quote from: TomS_ on February 19, 2018, 10:30:54 amQuote from: From Quoted Blog

author: Zero999
author_rank: Super Contributor
timestamp: February 19, 2018, 01:54:17 pm
content: The lowest frequency crystal, commonly available is 20kHz.Here's a transistor clock project, which uses the mains frequency and a similar frequency divider circuit, to the one I posted previously.http://ch00ftech.com/2012/07/10/transistor-clock-part-2-prescaler/

author: TomS_
author_rank: Frequent Contributor
timestamp: February 19, 2018, 02:43:24 pm
content: Quote from: NivagSwerdna on February 19, 2018, 01:23:18 pmThat project took more than enough of my life away.

author: BrianHG
author_rank: Super Contributor
timestamp: February 19, 2018, 02:48:08 pm
content: If you are looking for a low frequency crystal, I dont know if it would work or how stable it would be, but, maybe, as an experiment, try using that large crystal from one of those BBQ spark igniter. It's got to be low frequency, and high voltage.

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 05:57:05 pm
content: What drive me to do something like this is that I do want to dive to the diode logic circuits, just for fun. So basically my plan were to first design it with common logic gates (clock is basically just counters and some resets) and then design one of each in diode logic or diode transistor logic (inverted) gates. The rest should be "just" assembling with the standard parts.How one would turn that mechanical tuning fork as electromechanical oscillator. edit:http://kt4qw.com/shortstories/project.htmThat actually might be a cool thing, gets the constant buzz for free.

author: Ian.M
author_rank: Super Contributor
timestamp: February 19, 2018, 06:46:17 pm
content: If you are really dead set on not using mains frequency for a reference, you can get 128Hz tuning forks, though you''l need an ordinary tempered steel one not a stainless steel or non-ferrous one. However that's still 7 stages of binary dividers + the oscillator itself ad a buffer transistor to get a squarewave, so 16 transistors just for a 1Hz clock signal. Then you will need to ovenise it as the tuning fork frequency will be significantly temperature sensitive, and purge the oven with inert gas and hermetically seal it to reduce long term drift.

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 06:53:17 pm
content: Quote from: Ian.M on February 19, 2018, 06:46:17 pmNo easy route to perfection. Yeah, these cheaper forks seems to be all aluminium or stainless, found one 128 Hz fork made from steel, but the cost is around 40€ .. I did hope there would have been some sand crystal oscillator down to some kHz, but nope. The time nuttery of mine is only for a few weeks per minute. Not a millenia.Maybe I should first make my own tuning fork.PS.. Or cannibalize Omega Constellation Chronometer they seems to have 300Hz electromechanical vibrator (tuning fork).

author: richard.cs
author_rank: Super Contributor
timestamp: February 19, 2018, 07:07:35 pm
content: I found some German-made steel 128 Hz tuning forks on ebay for £17 when I looked earlier. It is possible to couple into a non magnetic one but the conventional design assumes magnetic. The alternative methods include acoustically coupling in through the air next to the tines or a direct mechanical coupling into the bottom of the fork with something like a piezo transducer. You can couple out acoustically or optically.

author: Zero999
author_rank: Super Contributor
timestamp: February 19, 2018, 07:14:25 pm
content: Quote from: BrianHG on February 19, 2018, 02:48:08 pmI don't think that would be suitable. The crystal inside a BBQ igniter is long and cylindrical and is completely the wrong shape for a timing crystal, which should be tuning fork shaped or a thin bar.

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 07:27:40 pm
content: Quote from: richard.cs on February 19, 2018, 07:07:35 pmBut isn't one important part of the traditional magnetically coupled design that it also gives energy to the fork to continue vibration? At least that is what I think what is happening there, with piezo or acoustic coupling that re-arming energy would be much more complex to get it right I would assume.

author: Kalvin
author_rank: Super Contributor
timestamp: February 19, 2018, 07:30:07 pm
content: In the 80's this oscillator problem would have been very easy to solve. It didn't matter what kind of crystal radio you built, the Radio Moscow was the loudest station to be heard anyway. It was like 50 Hz hum which was everywhere. Nowadays, there may be some other more useful radio stations available which could be used as a timebase. So, a simple 60 kHz regenerative receiver and a divider could be used as a timebase yielding a frequency uncertainty of less than 1 part in 10E12?https://en.wikipedia.org/wiki/WWVB

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 07:33:30 pm
content: ..This is getting out of control..Hmm... I wonder if one could build a electromechanical capacitive vibrator, like a tuning fork kind of..Hmm... Hmmmmm....

author: ogden
author_rank: Super Contributor
timestamp: February 19, 2018, 07:39:46 pm
content: Quote from: Vtile on February 19, 2018, 07:33:30 pmIt's 32KHz watch crystal oscillator. They are tuning forks and they are capacitive vibrators:

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 07:40:52 pm
content: Quote from: ogden on February 19, 2018, 07:39:46 pmOh dang.Circle is closed.

author: ransonjd
author_rank: Contributor
timestamp: February 19, 2018, 07:43:29 pm
content: You might be able to get two crystals separated by a few tens of hertz, mix their outputs, and get a nice low frequency out. The timing accuracy won't be great, but it would be pretty easy to do with discretes.

author: ogden
author_rank: Super Contributor
timestamp: February 19, 2018, 07:49:32 pm
content: Quote from: ransonjd on February 19, 2018, 07:43:29 pmIt will not work. Crystals happen to drift, one could drift faster than another. Could be so that one day clock is running 2x faster and another it is running 20x slower

author: Rerouter
author_rank: Super Contributor
timestamp: February 19, 2018, 07:50:05 pm
content: While sacrificing accuracy compared to a crystal, a few automotive clocks used a pendulum oscillator, this was a ring with a magnet attached at 1 point, it had 2 drive coils and 1 sense coil, and a restoring spring.When the magnet went past the sense coil in 1 direction it gave a positive pulse, in the other a negative pulse, which drove the transistors operating the drive coils which gave it a small kick to keep it moving.I have only repaired 5-6 of these in the past, however almost all of them operated at 2 Hz,

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 07:51:25 pm
content: Quote from: ogden on February 19, 2018, 07:49:32 pmThat would be like the compass of Cpt. Jack Sparrow. Hmm... Peanuts.What about quartz oscillator... A hourglass with electromechanical motor to turn it over.

author: ransonjd
author_rank: Contributor
timestamp: February 19, 2018, 08:03:06 pm
content: QuoteIt's probably not that bad. I'm betting you could keep it within 20% of ~50Hz. And your next project could be a temperature chamber to stabilize your clock.

author: Zero999
author_rank: Super Contributor
timestamp: February 19, 2018, 08:09:54 pm
content: Quote from: ogden on February 19, 2018, 07:49:32 pmYes that won't work. I actually thought of it before but didn't post it because it was a dud idea. Look at the stability figures for a crystal. A reasonable one would be +/-3 ppm. Now take two crystals, say 30000Hz and 31000Hz, in the hope you can mix them to get 1kHz. Suppose the 30kHz one is just 1.5ppm too slow, that would be 29999.955Hz and the 31kHz one is just right. That gives a beat frequency of 1000.045Hz, which is 0.045Hz or 45ppm off 1kHz: much worse than the 30kHz crystal. In reality, it's likely to be much worse than this!

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 08:10:06 pm
content: Actually, could the mass of the d'arsonval movement be used as a pendulum... It could work. It should.

author: Kalvin
author_rank: Super Contributor
timestamp: February 19, 2018, 08:13:46 pm
content: Use your pulse as time base, and relax. If you notice that the clock goes too slow, your pulse will automatically go up anyway and it will catch up.

author: jmelson
author_rank: Super Contributor
timestamp: February 19, 2018, 08:21:57 pm
content: Quote from: Vtile on February 18, 2018, 06:19:18 pmLook in VERY old transistor databooks for diode-steered capacitor-coupled flipflops. When distilled down from the universal JKT for to just a toggle (T) FF, I think it can be done with 10 components per FF, so that would be 150 parts for a 15-stage binary divider. This technology was not used after, maybe, 1965 or so, so you need something like the GE transistor databook from before that. They had a bunch of sample circuits in the back.I tried to build one of these when I was a kid, but didn't really have the test gear to even tell if it worked. So, I built one a few years ago with modern components, and it works fine. Pretty slow, but I think the rise time was about 50 ns, fall time (with transistors conducting) was better.Jon

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 08:29:07 pm
content: Quote from: jmelson on February 19, 2018, 08:21:57 pmThat is/were my original plan to use diode gates and some transistors for buffers and inversions.

author: Zero999
author_rank: Super Contributor
timestamp: February 19, 2018, 09:16:57 pm
content: Quote from: jmelson on February 19, 2018, 08:21:57 pmNo, it's much simpler than that. As I said in another post, the basic divide by two stage only needs two transistors. Here's another schematic and link to a tutorial.https://www.electronics-tutorials.ws/waveforms/bistable.html

author: Vtile
author_rank: Super Contributor
timestamp: February 19, 2018, 09:21:34 pm
content: 14*15 = 210 parts.

author: Zero999
author_rank: Super Contributor
timestamp: February 19, 2018, 09:39:32 pm
content: Quote from: Vtile on February 19, 2018, 09:21:34 pmWhere do you get 14*15 from, or is a joke I don't get?Each flip-flop divides by two. If you have a 32768Hz oscillator, then you need to divide by 32768 or 215to get 1Hz. If you put 15 divide by two counters in series, you'll get a divide by 32768 counter. 15 flip-flop and using the above design, would only require 30 transistors.

author: glarsson
author_rank: Frequent Contributor
timestamp: February 19, 2018, 09:47:52 pm
content: 14 parts including two transistors.15 * 14 is no joke.

author: Zero999
author_rank: Super Contributor
timestamp: February 19, 2018, 10:48:21 pm
content: Quote from: glarsson on February 19, 2018, 09:47:52 pmOf course. I was just counting the transistors. Silly me.How about this circuit instead?Use a dual diode for D11 & D12 and D10 & D13 and now it's only 10 parts, or would that count as an IC which is cheating?http://ch00ftech.com/2012/07/10/transistor-clock-part-2-prescaler/

author: duak
author_rank: Super Contributor
timestamp: February 20, 2018, 03:30:30 am
content: Look up "astable multivibrator frequency divider". There is at least one patent describing it. This circuit will give a greater divide ratio per stage than a purely digital divider. The principle is that each stage is an oscillator tuned to have a free running frequency just a bit lower than the desired frequency. Each stage will then lock to an exact sub-multiple of the frequency applied to its trigger input.I first ran across this concept in an article in Scientic American from the 50's where vacuum tubes were used for the active devices.You might also want to look at some digital instruments built in the 50's & early 60's before integrated circuits. hp built counters with really efficient designsCheers,

author: BrianHG
author_rank: Super Contributor
timestamp: February 20, 2018, 04:53:41 am
content: Well, as others have cited, just like you can have a third overtone & 5th overtone crystals, which are crystals at 1/3rd, or 1/5th their written value with a LC tuned oscillator just running at 3x or 5x speed, it might be possible to go in the opposite direction. Get a 32.768 Khz crystal, connect it to an LC oscillator tuned at some odd number dividend, the further away, the more difficult to retain lock, and it should work. This means you basically use a 1 transistor LC oscillator tuned to, example 1/9th 32.768k = 3.640888889 Khz. Then use that oscillator as a reference for the next stage 1 transistor oscillator to divide by 9 again = 404.5432099 hz, then /9 again = 44.94924554 hz. That's 3 transistors to go from 32k to 44.949hz. But, you also need 3 ferrite tunable inductors or 3 varicaps which may drift with temperature and time.A divide by 3 or 5 per stage would be more tolerant. In theory, maybe even a divide by 15 or even bigger may work. At that level, I would breadboard a 1 transistor fundamental 32Khz, with it's output going through a 5pf to 100pf feeding the base of a second 1 transistor LC oscillator tuned to something like 1/101 the frequency and fiddle around with the inductor's tuning just to see if there is any harmonic locking. It will stand out on a scope as you adjust the frequency (ie tune the inductor), there will be zones where the frequency seems to snap to a fixed value. If you have a REAL frequency counter, it's reading will stabilize in these zones while anywhere else, the frequency will be unstable or drift. This would give you a 32Khz / 101 with only 2 transistors... Or try smaller divisions. A smaller divide by 3 or 5 would snap/lock very hard.This should be bread-board-able with a couple of 2N3904, 1 watch crystal, some caps, resistors and a TOKO 7 style 2mh adjustable inductor. Maybe buffer the output with a third 2N3904 to isolate your scope probe's capacitance, and as a LPF to remove any 32Khz from the source, as tuning to a /101 will be really touchy.