Designing a discrete oscillator for a 32KHz Tuning Fork Crystal - Page 1
Forum section: electronics / projects

author: Globe Collector
author_rank: Contributor
timestamp: December 11, 2018, 10:56:01 am
content: I wish to document my construction of a crystal oscillator using discrete components, partially so others faced with similar problems can find this on the web to assist them in their endevours.I have already read Ali6x944's request and journey to understand how to achieve the same result using a TTL 7400, and quite helpful it was too.https://www.eevblog.com/forum/beginners/is-it-possible-a-crystal-oscillator-from-sn74ls04-ttl-hex-inverter/My ultimate goal is to build a gadget to measure the capacity of Ni-MH hybrid vehicle battery packs out of whatever I find in the "junk" box! Basically these are six cell 7.2v, 6Ah (When Unused) packs about the size of a book. The aim is to charge them up, (28-32 of them in parallel) off solar panels for a few weeks using the panels' internal resistance as a current limit. End-of charge is difficult to detect with this cell type so I'm being as "rough as guts" in this regard and assuming they still retain their original full 6Ah capacity and simply punching 6Ah into them from the Solar Panels...there is definitely a risk they will be over charged at the latter parts of the process and placing many of them in parallel allows the stronger ones to take the excess charge once the weaker ones are full.The 32KHz crystal is needed in an oscillator in the discharging gadget. This consists of an old digital clock with a V.F.Display (and based around the Toko MK50375N clock chip and) cabbaged from a Vulcan Quasar heater. The battery is connected to a 1A constant current sink, (a greater discharge current was not chosen because one did not wish to too aggressively reverse charge the weakest cells in the battery under measurement), when the battery is connected the clock is started. When the battery, or actually the weakest cell) reaches the end of its capcity its voltage drops a bit and this is detected by a comparator and disconnects the current sink and at the same time cuts the 50Hz clock signal to the MK50375 freezing the display of the clock at the battery's capacity in Ahs. Ultimately I wish to run the clock and everything else from the battery under test and have it all shut down at the end, but just keep the MK50375 alive to retain the value of the battery tested. A push button will connect the cathodes of the V.F. Display to read the value, but the cathodes will be turned off at the end of discharge as they draw 80mA and it could be some time before I come to check the value.In light of this, the MK50375 requires a 50Hz square wave applied to pin 30 from the collector of an NPN transistor (Active pull-down input)...when this stops, the display freezes. In the original heater this 50Hz was derived from a small power transformer used to power the clock via a "squarer" limiter to get the square wave. In this application it will be derived from the 32KHz oscillator by dividing its output by five (probably with a 4017 Johnson counter), then by two, seven times, (probably with a 4040, 4060 or 4020 ripple counter) to get the 50Hz independent of the mains.Now many of you way well ask, why not use the standard UB CMOS Pierce Oscillator arrangement....well the answer is a pretty illogical one, ....but I like building analogue stuff, this is my first design project in a long time and I want to give the "grey blancmange" in my head some exercise AND I would like to share with others, especially "newbies", the process of designing such a circuit without the use of maths...which I could do, but I'm just too lazy and prefer to do it by the hands-on, "suck-it-and-see" method instead. With discrete components one can see the design process from the "bottom up", whereas with a CMOS Unbuffered inverter the gain stage has already been built for you.So, I started with the most basic oscillator premise, that it consists of an amplifier with positive feedback. At this stage I did not really understand that the crystal only needs "fleapower" and that the input impedance must be very high not to "bog" the crystal down. I also did not really comprehend the phase shift through the crystal.As I had initially "cut my teeth" on simple audio circuits, I simply built a basic class-A stage around the very common BC107 transistor and put the crystal in the feedback path. I had heard that the crystal has an inductive component in its equivalent circuit and needs a capacitive component to make it resonate, so I slapped a 27pF in parallel with it, the value was deduced from the two 56pF capacitors seen in the Pierce arrangements used with CMOS inverters as the gain stage. A 1.8K resistor was put in series in the "input" (crystal circuit's input) side to "limit the power" as it was initially thought these "bulky" tuning fork crystals need loads of drive from a relatively low source impedance.So the circuit starts with this simple gain stage, 330K up from base, 33K down bias stack, 1K in the emitter and 6K8 in the collector. 1K8 from collector to crystal, 27pF in parallel with crystal, 4n7 (not really needed) to couple it back to the base. I built it up, "Manhattan Style" on a tinplate Milo tin lid, and guess what! No oscillation, however the transistor was just in its linear region! So, I wasjustinside the ball-park, but still a long way to go!Here is the circuit...It is small because I don't wish to fill up Dave's Server HDD with rubbish, a bigger version is at the foot of the post.I felt that there was a phase shift issue so I removed the 27pF and put two 56pF's down to deck, either side of the crystal as normally seen in the Pierce arrangements with CMOS inverters. I felt that these would force a phase shift because they act as a seesaw, two caps in series, earthed in the middle. POWER UP...NOTHING!I soon realized that the capacitice reactane of the 56pF on the input side would be quite large at such a "low" frequency so I decided to increase the source impedance of the amplifier, so I replaced the 1K8 with 330K. By this stage I was reading Ali6x944's post on the Blog! This is where the idea for the 330K came from. POWER UP....NOTHING.Again, a circuit is worth a million words...I connected the signal generator to the emitter of the transistor via a 100nF cap and tried to see if it had any bandpass filter qualities, any peakimg at the collector as I swept across 32KHz...NOPE, just acted as a grounded base amplifier with flat frequency response.At this stage I felt it was time to "get serious" so I split the circuit into its A.C. (feedback containing the crystal) and D.C. (amplifier) parts. Gut instinct told me that the now high output impedance (the 330K between the collector of the transistor and the crystal) would mean anatomically smallloading on the output side of the crystal, so the amplifier needed amuch higherinput impedance and possibly a hell of a lot more gain.....this meant one thing, two stages...the first one being a j-FET.I had lots on 2N4093's in the bits box so I dragged one out, put a 10Meg resistor from its gate to ground to "hold the gate down" and a 12K resistor from the source to ground to provide a positive voltage on the source (hence a negative bias) just like the valve guys did with triodes. The source resistor was chosen high because the drain resistor was to be high also, so the current through the device would be quite small, hence Ohm's Law decreeing that the source resistor be quite high too to get the required negative bias to get the device into its linear region. The drain of the 2N4093 was connected to the base of the BC107 and the 33K lower bias resistor removed and the upper bias resistor reduced from 330K to 47K. Leaving the 330K would have meant just atinycurrent through the FET, really too small to manage sensibly. The crystal and its components were disconected for now. I was just going to concentrate on getting the two active devices in the amplifier coupled together and running in their linear regions, preferably themiddleof their linear regions if possible. Again it was powered up, measuring voltages soon told me that the drain and source voltages of the FET were nearly the same, so it was saturated hard-on.The circuit so far...I increased the source resistor to get more bias, 22K and it was just entering its linear region...the drain and source voltages were starting to diverge, 33K and it seemed to be about right with about 3v between the drain and source. The BC107 was still nearly saturated though and it was not allowing enough voltage for the drain of the FET due to its vbe drop and lowish 1K emitter resistor, I increased the emitter resistor to 2K2 and then to 4K7 and this gave another 800mV of headroom at the drain of the FET but I was boxing myself into a corner with only a 12v DC rail to run it all off. If you have two "N" devices, directly DC coupled, you generally need to use mathematical techniques to speed the process up and plenty of headroom. I have a microphone pre-amp with two DC coupled NPN transistors, but it runs off a 30v DC rail! There was nothing to it, the NPN BC107 had to go and a PNP needed to be put in there with its low impedance emitter circuit at the top near the rail and a good deal of its base current going down through the (N-Ch) FET.So, again I re-cobbled the circuit, left the 47K in the drain of the FET, connected the base of a PNP 2N3281 to the drain of the FET. (Why a 2N3281? I had lots in the junk box, cabbaged from old Ampex AVR-1 and AVR-2 video tape machines where their number was 014-505.) I could have just as easily used a BC177, but I felt the 2N3281 had better H.F. response....not that this was really "H.F." though! I put a 1K in the emitter and a 6K8 in the collector down to ground. Powered it up, the FET had lots more headroom and the output at the collector of the 2N3281 was at about 8-9v, so it was middling in the linear region.The circuit at this stage....I put the C.R.O. on the collector and decided to test to see just how high the input impedance would be...I put my big fat finger on the gate of the FET, a 50Hz square wave appeared at the output, so it was now amplifying and swinging from saturation to cutoff....well at least one of the devices was! I reduced the input voltage by gently putting another finger on the tin lid groundplane, a dirty, mains-like sine wave appeared and the harder I pushed my other finger onto the groundplane the less its amplitude got, but it also "slipped positive" and was clipped at the 8-9v observed as the static DC output. I reduced the emitter resistor from 1K to 330 Ohms and the collector load from 6K8 down to 2K2, this improved things a bit and the output DC voltage fell to around 6v, the ideal quiescent value, half way between the rail and ground.This suggested I had got at least one device at the "sweet spot" in the centre of its linear region, but touching in input again revealed an uneven clipping, so I "attacked" the 47K in the drain/base circuit, I dabbed a 33k across it and things "perked up" nicely...so I was going in the right direction. A 22K dabbed across it was nearly perfect...both devices now seemed in the centeres on their linear regions, "no DC component" (signal was now "centered" on the 6v D.C. at the output) of the signal with reduction in amplitude and even clipping at near rail and ground top and bottom. I calculated the 47K-22K parallel combination with reciprocal addition and it came out almost smack-on 15K...so I was scratching in the resistor drawer again.Things were looking good, both devices at their linear "sweet spots", loads of gain and high input impedance...just the ticket to tickle a signal out of that crystal! So all the DC stuff was done...now the AC stuff.I whacked a signal from the signal generator into the gate of the FET via a 27pF ceramic capacitor, the generator was in the "high 10's of mV" and at about 3KHz. It came through nicely, with about a pk-to-pk amplitude of 3v. I dropped the input frequency to 300Hz to see of I could get anything through that 27pF onto the Hi-Z imput, yep, the output voltage dropped to about 300mV, so the overall gain was about roughly unity...but 300Hz through 27pF??!!So doing what the valve guys did before I decided to bootstrap the source of the FET and the emitter of the 2N3281. I dabbed a 100nF across the 33K in the source of the FET and WHOOP, 10 times the amplitude at the output, then I dabbed another 100nF across the 330 Ohm in the emitter 2N3281...not much change considering the capacitive reactance of 100n at 300Hz and the low impedance nature of this part of the circuit. In the early days there would have been a 10uF electro there, one of those two ended blue Philips ones! So I got out a BIG, 1.5uF polyester cap and dabbed that there and got a bit more...about 6v pk-to-pk....BUT this thing was going to be working at 32KHz, so I knocked the generator back up to 3KHz, and the output went into clipping. I turned the generator down to the units of mV and upped the frequency to 30KHz, a 100n bootstrap across each resistor gave loads of gain, I did not measure it, but I'd say a voltage gain of 3-500. I was ready to try the crystal!I connected up the crystal again...the 330K to the collector of the 2N3281 and the other end to the gate of the 2N4093, and powered up...THIS TIME we "got some Dinah-Moe-Humm". A high amplitude clipped sine wave appeared on the C.R.O. screen, I'd say 25v pk-to-pk with the top and bottom 7v chopped off. I thought I had it, but something looked "fishy", I had a look at the generator output again, it was a lot higher in frequency and it was a c30KHz...the period of the oscillator waveform was 65us, so about 14kHz...the crystal was oscillating in some mode other than the way it was intended to.I decided to "fiddle the gain" so I took out the 100n bootstrap in the 2N3281's emitter...it stopped dead. I put this back and took out the other 100n in the 2N4093's source...again, it stopped dead. The 4n7 I had initially used to couple the crystal to the amp's input was still lying there, so I dabbed it across the 33K source resistor and VOLIA! there it was, a high amplitude clipped sine (or "dirty" square wave) at c20us period, looked the same as the signal generator set to 32kHz. I wanted to use the frequency counter, an old HP 5326A, but it died when I turned it on, gate worked, inputs worked, but the counter just counted to "0001" ...so there's next week's job...lots of 7400 TTL and maybe some ECL..."Goody-goodie!"There's an interesting point to be made here, that "fiddling" of the gain shows just how little power these crystals require, its driven through a 330K from about 4v R.M.S. and that AINT MUCH, and still it was forced into a lower frequency mode...that little fork must have been banging around in that little can like a European Wasp/Yellow Jacket in a jar of sulphur dioxide... pushing components to the point of releasing the "magic smoke" (or in this case not releasing any smoke) gives you the feel for the limitations of these things and these are the sorts of experiences you just DON'T get in a Uni EE lab, sitting in front of a computer running a "Spice" model...this "suck-it-and-see" method develops you confidence and "gut instinct", something that seems quite lacking in this new millennium! Through this process I have gained anunderstandingof these little tuning fork low frequency crystals and a sort of "friendship" and respect for them.....they were aloof little buggers before, now they feel more like my little mates! This is the difference betweenknowledge(just knowing these types of crystals exist,) andunderstanding(some sort or rapport or interaction with them)...I'm invoking the Dunning-Kruger effect here and sayingnot muchunderstanding, but enough to get what I came for and enough to build on in the future if I can find the time.Here's the final functioning circuit. I don't believe the transistors are critical and the FET could just as easily be an MPF102 or 2SK30, and likewise for the bipolar, in the U.S. you might reach for a 2N2906 , a 2SA1015 in Viet Nam and here in AUS a BC557...you may need to fudge the bias a bit to keep in in the centre of the linear region, but that's the beauty of this method...you "puddle around" until you getsomethingthen tweak component values up or down a bit to see what improves the little something you have in the direction of the something you actually want.Now "yaffle text" and circuits are good, but did Ireallybuild it, or am I "blowing it all out my bum"?. Well. here's a picture as proof!Yes, its a scruffy "proof of concept" pile of components...so now I need to make it nice and pretty. I will post again once that is done!Oh, one last thing...the output on the C.R.O. screen....into the 2K2 collerctor load of course...none of this "only drives thin air" stuff here...we want some meat in our Sandwiches!!So that is how I "fudge-up" a circuit. I will probably add a saturating third stage NPN to "square it up" before feeding it on to the 4017. Yes, I know the 4060 can have it's input stages configured as an oscillator, but I love linear stuff and I will try to fiddle it to get a sine wave out of it for fun before I go on to build the dividers. All crystal oscillators I know of, (that don't have a tuned circuit load on the final device) produce these harmonically "dirty" outputs but a 32KHz tuned circuit...where would I find one of those...in an old Organ perhaps, but can I do it without one? How low can I get the gain before it just stops? The 330K and first 56pF in the feedback path I suspect act as the necessary phase shift to kick the whole lot into life. I suspect that the crystal does not vibrate with a sinusoidal motion anyhow...but dosn't a tuning fork....so can this be fudged to do so too as it is a miniature tuning fork?Just a quick statement on a similar topic....I have this 3.2KHz crystal here....Yep, 3.2KHz, you canhearit whistling. Its a huge thing, in a valve bulb like a 6E5 "magic eye" with an octal base. The crystal is a square rod of quartz mounted axially inside about 5mm x 5mm and 70mm long. It has vapour deposited silver plates on it and three connections, ground, in and out. The oscillator is surprisingly simple, just an old OC71 and a few passives. When it is powered up it takes a few seconds for the whistle to be heard. When I find it I will post pictures, circuits and waveforms."A token of my extremes", my highest and lowest frequency crystals. Does anybody have any more extreme than this? (No dielectric "puck" microwave oscillators in similar cans!)

author: Globe Collector
author_rank: Contributor
timestamp: December 17, 2018, 12:08:06 pm
content: UPDATE:Actually it is very fussy about loading and a three foot piece of shielded wire to the frequency counter was enough to stop it. Also the high impedance input is an issue as the gate of the 2N4093 is connected to its can and the long leaded 10M resistor hanging out was not helping either.There is a phase issue and the phase is only being turned just enough to make it oscillate, poking ones big fat finger anywhere near the can of the jF.E.T. or 10M hold down resistor will stop it, removing the finger, it starts again. I figure this is due to increased capacitance, so the 56pF on the input side of the crystal may need to be decreased.I tightened up the high impedance input by moving the crystal very close to the gate and shortening the leads of the 10M resistor...actually I dropped its value to 5M1.To get an output signal into the shielded wire, I put an emitter follower on the output, basically 10K from the output of the last circuit above into the base of the BC107, which has been pulled back into service. The collector goes up to +12 and the emitter 1K to deck. From the emitter there is a 100 Ohm "dum-dum" resistor in series with a D.C. blocking 100nF cap, then a 62K to ground...just any old value I found to allow the coupling cap to charge up.Oddy enough I have achieved another goal stated above...I now have a fairly sinusoidal output even though that was not the intention of these mods. The intention was to get the output into the frequency counter...which was working again after I poked around inside it, but had stopped again when I was ready to make the measurement...I suspect a power supply cap is drying out, one of the four filter caps had been replaced...and I had fixed it years ago as there was an MC1010L ECL chip botched onto the rear of the function select board.Will post again as things develop.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 17, 2018, 03:15:31 pm
content: The impedance is high, but not extreme; a 32kHz crystal is typically in the 150kohm range, loading caps included. A BJT will do that, carefully biased, or a JFET certainly.To isolate output loading from internal gain node, you may find a buffer is necessary? Also is that cable terminated -- if so, that'll load the circuit even more heavily. Also also, connecting a cable to a transistor may invite resonances of said transmission line, though this shouldn't be much of an issue for a collector output (it is for emitter followers, though).Tim

author: Benta
author_rank: Super Contributor
timestamp: December 17, 2018, 04:07:04 pm
content: One thing to be very careful with using kHz turning fork crystals is to limit drive power. They only work well at a drive power level of below 1 mW. Overdriving them is the main malfunction source.