Making a crystal oscilator - Page 1
Forum section: electronics / beginners

author: Beamin
author_rank: Super Contributor
timestamp: October 20, 2017, 08:38:13 pm
content: I have a 26Mhz and a 13.56 crystal. Can either of these be used in this circuit? Or will the caps have to be adjusted? I just want to make an oscillator to test my osciliscope out and maybe build a small amplifier . This says use a 2n3904 transistor but I do have transistors I ordered that are for RF like a ss9018hbu and ss4018fbu and ksc 1674ybu. I always thought a 2n3904 was too slow to go to 20 MHz?

author: CJay
author_rank: Super Contributor
timestamp: October 20, 2017, 09:02:26 pm
content: 2N3904 has ft ofover 200MHz, it'll be fine.Impossible to say if those capacitor values will be ideal because we don't know what the characteristics of your crystals are but I would think they'll be good enough to 'work'.A simple Colpitts crystal oscillator should be fine for both crystals though:https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0ahUKEwiMgr2XjIDXAhVRbVAKHdogAgEQFgg4MAU&url=http%3A%2F%2Fwww.rakon.com%2Fcomponent%2Fdocman%2Fdoc_download%2F234-single-transistor-crystal-oscillator-circuits&usg=AOvVaw0NP7YRMFbBEttqjqeaoUoD

author: danadak
author_rank: Super Contributor
timestamp: October 20, 2017, 11:33:29 pm
content: This might help -http://www.rakon.com/component/docman/doc_download/234-single-transistor-crystal-oscillator-circuitsRegards, Dana.

author: Beamin
author_rank: Super Contributor
timestamp: October 20, 2017, 11:58:31 pm
content: It worked!I used a 26 MHz crystal and saw a saw tooth wave on the scope.So to make this into a radio transmitter I need to add amplification and a way to modulate an AM tone into the wave. Would those be separate circuits I could add like moduals? I want to make a low power fox hunting beacon or antenna tester.Like I said I have RF transistors but they are in TO92 packages so whats to most power they can handle? I do have some gen purpose trans with the screw hole I could add a heat sink to. If I could get a watt out of a to92 that would work. I get lost trying to look up this stuff and figure out the math to see what the limits are..

author: CJay
author_rank: Super Contributor
timestamp: October 21, 2017, 06:40:20 am
content: Quote from: Beamin on October 20, 2017, 11:58:31 pmYou should be seeing a sine wave on the scope but that may be a problem with the probes or it could be the circuit isn't behaving nicely.Absolutely you can add modulation and power amplification as modules but you really need to add in a low pass filter as you'll be amplifying all the harmonics as well as the wanted signal, it's a waste of power and is very annoying to other spectrum users, it could potentially land you with a fine if you're not licensed for the bands you're using.A watt from a TO92 packaged transistor might be possible but it's not too easy from a bipolar TO-92 device, none of the devices you bought as RF parts would be capable of that, your 2N3904 might get you 100mW...Take a look at QRPLabs.com Hans uses BS170 transistors in parallel to obtain 250mW (they can be run harder for more power but it's surprising just how much range you can obtain from a quarter of a watt)

author: danadak
author_rank: Super Contributor
timestamp: October 21, 2017, 10:45:27 am
content: Some ref material -http://www.qsl.net/va3iul/RF%20Power%20Amplifiers/RF_Power_Amplifiers.pdfhttps://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-976-high-speed-communication-circuits-and-systems-spring-2003/lecture-notes/guest3.pdfKeep in mind your scope probe, if in X10 mode, presents ~ 10 - 20 pF of C at the probepoint. So your circuit may not be oscillating unless probe connected. Or quite theopposite can occur. FET probes can get you down to the 1 - 2 pF range, or use aseries R to probe to "uncouple" the probes C from circuit. Although that will effectmeasurement accuracy.On forum there are some low C probe designs.https://www.eevblog.com/forum/projects/good-design-for-a-diy-active-probe/Regards, Dana.

author: Zero999
author_rank: Super Contributor
timestamp: October 21, 2017, 01:46:28 pm
content: Quote from: CJay on October 21, 2017, 06:40:20 amWhy should one expect to see a sine wave from this circuit? The transistor isn't properly biased into its linear region, so a very distorted triangle wave, is to be expected.This is fine for use as a clock signal in digital logic, though a Schmitt trigger may be necessary to get a propper square wave. It could be used to drive a class C amplifier, which will have a filter on the output to give a good sine wave.

author: Beamin
author_rank: Super Contributor
timestamp: October 21, 2017, 02:07:51 pm
content: So now its not oscillating. If I can dial in the scope I can rule out that variable.The circuit runs at five volts. The CH1 button is pushed in on the scope and the time dial is pushed in. I just see noise. If we know its at five volts and 26MHz where are the ideal scope settings? That way I can rule out user error. Also I had a blue LED for the second diode to GND yesterday when it was working but that shouldn't make a difference?Probe it at the collector of trans and its grounded to the ground rail.

author: Zero999
author_rank: Super Contributor
timestamp: October 21, 2017, 03:25:12 pm
content: Quote from: Beamin on October 21, 2017, 02:07:51 pmThe transistor is not biased properly. I was surprised it worked as originally drawn. Changing the diodes for a blue LED would increase the base current and make it more likely the transistor will saturate and just sit there, in the on state, with the output around 100mV to 200mV.Try this circuit. I have not done any AC analysis on it, but the DC output should sit around half the supply voltage.

author: orolo
author_rank: Frequent Contributor
timestamp: October 21, 2017, 03:49:00 pm
content: Breadboards have some big parasitics, so you can't discount that factor. Consider also parasitic oscillations: check that any oscillation is at 26MHz and not other frequency.Otherwise, this is a Pierce oscillator at 26MHz. Pierce has two RC sections in the feedback loop, and that requires some voltage gain to compensate. A back of the envelope calculation suggests you need at least a voltage gain of 6 at the collector to compensate, from the 1K/22p and 20Ohm/100p RC sections (assuming your crystal has about 20 ohms of series resistance). On the other hand, another back of the envelope calculation suggests the smallest load on the collector of the transistor comes from the 20Ohms of the crystal + 100pF of the cap, for about 81 ohms of impedance. If your transistor has a quiescent current of 2mA or so, that means a gain of 81/13 = 6.2. So it seems the circuit has just gain enough to oscillate.I think this is the problem with Pierce at very high frequencies, the crystal offers a very low impedance load to the voltage amplifier, and using a faster transistor won't help. Maybe a buffer between the collector and the crystal could help. Or maybe a Colpitts oscillator will manage with only one transistor.

author: Beamin
author_rank: Super Contributor
timestamp: October 21, 2017, 07:18:33 pm
content: Quote from: Hero999 on October 21, 2017, 03:25:12 pmSo when you say not biased properly that means that the voltage to the base is too high and its just staying on and not oscillating? You would solve this by using a smaller cap?

author: Zero999
author_rank: Super Contributor
timestamp: October 21, 2017, 09:32:57 pm
content: Quote from: Beamin on October 21, 2017, 07:18:33 pmYes.QuoteNo, a smaller capacitor would not make any difference to the DC operating point of the transistor.

author: orolo
author_rank: Frequent Contributor
timestamp: October 21, 2017, 11:07:29 pm
content: Okay, I don't have 26MHz crystals around, but I got plenty of 20MHz ones, so I used one of these to build a working version of this circuit.I don't see anything dire about the biasing scheme. It's a bit primitive, but it works for a grounded emitter amplifier: two diode drops mean, more or less, one diode drop for the 33k resistor, and the other diode drop for the transistor. That gives some crude temperature compensation, and a DC current bias of about 0.6/33k = 18uA. That gives (for a beta of 100-200) about 2mA of collector current, as stated in a previous post, and so about 3V of collector voltage. Just for the hell of it, I simulated the biasing with LTSpice from 0 to 100 degrees Celsius, and the biasing is remarkably stable at Ic=2.2mA and Vc=2.7V, agreeing with calculations. I'm not saying that this biasing is ideal, but it has the advantage of directly grounding the emitter which, at VHF and above, is not a bad idea.The really serious stuff, for me, is the value of the capacitors. Specificly, I think the 100pF cap at the base should be reduced. For about 20 ohms of crystal resistance, the combination of that resistor with the 100pF capacitor gives almost no phase shift at 26MHz. The crystal steps in and provides enough inductive reactance to reach about 80-90 degrees, going quite away from series resonance. Now, the obvious thing to do would be to increase that capacitance quite over 100pF, but then the voltage divider with the reactance of the crystal seems to sink the loop gain beyond what a single transistor can give at that frequency.So the answer, it seems, is to reduce those 100pF, and let the crystal compensate for the missing reactance. Working at 20MHz, I computed that a 38pF capacitor will force the crystal behave as a 458nH inductor, but the feedback loop will only have an attenuation of 6dB! That is more than enough for the transistor to compensate. Since a 2N3904 has its own 8pF of input capacitance, I settled for a 30pF cap instead of the 100pF of the original.Here is the circuit (ignore the inductor/variable cap circuit to the right, it's from another experiment). The transistor is a 2N3904, the resistors are the same as in your circuit, the diodes are 1N4148s, but the capacitors are 22pF (as in your circuit) and 30pF (instead of 100pF). In the rear there is a 100nF decoupling cap, like yours. And the crystal is 20MHz, not 26.The circuit oscillated at the first try. Oscilloscope traces are attached below. My el cheapo oscilloscope is not precise at all with frequency, so the ballpark 20MHz is satisfactory enough. The waveform is far from sinusoidal, but that is not surprising.So, in brief, my suggestion is: reduce the 100pF to 30pF or so, and try if that oscillates. I don't like this oscillator, the biasing is crude and the oscillation is quite away from series, but it seems to work.

author: vk3yedotcom
author_rank: Frequent Contributor
timestamp: October 22, 2017, 02:48:34 am
content: If you have difficulties getting it to oscillate try increasing the 100pF and/or 22pF capacitor values.The 13.56 MHz crystal will be fundamental. That is it will oscillate on that frequency.But that may not be true for crystals above about 25 MHz which are often third overtone.The 26 MHz crystal may still oscillate but it's worth measuring its frequency - it may well be oscillating on 1/3 of that - ie 8.667 MHz approx.If this is a problem you can build overtone oscillator circuit. Often it will have a tuned circuit that you need to set to 26 MHz.

author: orolo
author_rank: Frequent Contributor
timestamp: October 22, 2017, 09:09:26 am
content: Since I have the circuit already built, I've tried with the fastest crystals in my junkbox. A 40.660MHz was, as expected, a third harmonic 13.55MHz oscillator, and worked in the fundamental. Then I tried a 24.5MHz, and it also worked (trace below). How does this circuit fare with lower frequencies? I tried a 4.5MHz crystal, and it worked too (trace below). The collector spends almost half a cycle stuck low, but manages to oscillate. I have little doubt this circuit will also oscillate at 26MHz, if built carefully.

author: Beamin
author_rank: Super Contributor
timestamp: October 22, 2017, 02:58:16 pm
content: As of last night (haven't tried out the last few posts) It was oscillating then in changing to the 12mhz xtal I shorted out two leads causing my PSU to trip. I then redid the circuit on the bread board and could never get it to oscillate again. I tried changing out the transistor but that didn't work either.I'm going to order some copper board since I think using the bread board is not really a good idea for these circuits.Would making the circuit point to point work better? What is it about having the copper ground plane that makes this work so much better? I'm going to have to make some sort of connector for the crystal as I only have two of them. You can't hurt the crystal like you can a transistor can you? IE: My short wouldn't have fried the crystal? I once made an 80 MHz oscillator with a RF transistor and air coils of magnet wire and it as very difficult to get it started often having to touch the coils with metal objects to start it. The crystaless oscillators seem useless because they drift so much but maybe it was because I didn't have it in a copper board but rather project board with the grid of copper pads.EDIT: I have some copper clad board coming in the mail so this should be much easier.

author: Beamin
author_rank: Super Contributor
timestamp: October 22, 2017, 03:41:25 pm
content: So to make this into a transmitter producing carrier wave I just add a transistor amplifier circuit stage or two?As far as adding say AM modulation I would have to build an oscillator circuit and add this *after the output of the crystal oscillator stage? OR would it be simpler to add FM modulation? I'm thinking a 500 or 1000 hz tone from a simple circuit. I'm trying to find schematics of how that would work and build discrete modules. IF I could get a quarter watt out of it then I could try adding different antennas to it. While not in the 27mhz CB band the power output should be low enough that it wouldn't interfere with things. Also when I check the 26MHz on my SDR with a high gain antenna there doesn't seem to be anything using it in my area. So not exactly FCC compliant but common sense says its not hurting anything either.

author: Zero999
author_rank: Super Contributor
timestamp: October 22, 2017, 03:51:03 pm
content: Quote from: orolo on October 21, 2017, 11:07:29 pmI just want to clarify that I didn't say this circuit won't work, just that the poor biasing means it won't output a decent sine wave. Has anyone tried the circuit I posted? If it doesn't work, try adding a small capacitor (10pF to 100pF) between the base and 0V.Quote from: Beamin on October 22, 2017, 03:41:25 pmAM can be achieved with using a common emitter amplifier, with the DC bias point modulated with the low frequency signal. Changing the collector current alters the transconductance of the transistor. A filter is on the output, used to reject everything but the desired frequency.FM is not easy with a crystal oscillator. It's possible to pull the crystal frequency off a bit, but not much, making FM difficult. The usual way is to use a circuit known as a phase locked loop, but that's much more complicated.

author: vk3yedotcom
author_rank: Frequent Contributor
timestamp: October 22, 2017, 07:03:25 pm
content: Quote from: Hero999 on October 22, 2017, 03:51:03 pmThere are some ways to get around this. You can make crystals more 'rubbery' by putting two in parallel. Also add a series inductance.That should give enough shift for NBFM. Especially on VHF where if you multiply the frequency you get multiplied deviation.Another tack is to use a ceramic resonator which is like a crystal but can be pulled over a greater excursion.

author: chris_leyson
author_rank: Super Contributor
timestamp: October 22, 2017, 09:15:33 pm
content: Here's a good crystal oscillator with a wide tuning range, used it for a low power NBFM transmitter, +/- 2.5kHz deviation at 50MHz.Component values shown are for 80MHz."Design method yields low-noise wide-range crystal oscillators" T. Hillstrom EDN, March 17th 1988Also, Electronic Circuits, Systems and Standards, Edited by Ian Hickman.

author: Beamin
author_rank: Super Contributor
timestamp: October 23, 2017, 01:54:33 am
content: Quote from: Hero999 on October 22, 2017, 03:51:03 pmI made your circuit and it worked on a bread board. Then it stopped and I am trying to wire it up again using an ic socket until my copper board comes in the mail. The IC socket will allow me to reuse the crystal and keep the leads short.

author: Beamin
author_rank: Super Contributor
timestamp: October 23, 2017, 04:17:44 am
content: So to make this into an amplifier (it 37mhZ btw read it wrong)I would have the out of the oscillator go into a device that adds the AM modulation then that out put into the power amp transistor circuit? IS 37mhz too high for most transistors? I do have some beefy 2n3055 (60V)that are metal where the base is the shell and also some tip41c(80v) I could use.What would the AM part of the circuit be called the "AM modulator?" Does it make sense to build these three components as separate devices to keep it simple. They will all share one power supply then have ebay buck/boost converters for voltage control on the first two stages then a computer PSU supplying 12 volts to the amplifier. Trying to find schematics. I also want three separate parts so I can get one working perfectly and learn as I go.If the power amp is too hard to build I might just order a cheap one off ebay.This will probably turn into its DIY thread.

author: vk3yedotcom
author_rank: Frequent Contributor
timestamp: October 23, 2017, 07:15:31 am
content: 37 MHz is OK for small signal transistors (2N2222 etc). But power transistors like the 2N3055 are no good for RF. But it could be OK as an audio amp for a modulator.