Relaxation oscillator: Should I prefer comparator or opamp? - Page 1
Forum section: electronics / projects

author: hkBattousai
author_rank: Regular Contributor
timestamp: July 29, 2014, 10:19:15 am
content: I want to implement this relaxation oscillator:(VSS= GND, VDD= 20V, fout= 100kHz.)I have read several online articles about the difference between opamp and comparator. Since the opamp in the relaxation oscillator circuit runs in comparator mode, I decided to useLM2903Dcomparator in this circuit instead of an opamp.Is this a good choice? Are there any cases for which I should stick with opamp?

author: David Hess
author_rank: Super Contributor
timestamp: July 29, 2014, 10:51:22 am
content: The only reasons to use an operational amplifier as a comparator are precision and economy like if you have a spare in a dual or quad part.

author: pyrohaz
author_rank: Regular Contributor
timestamp: July 29, 2014, 10:58:23 am
content: Most op amps have push pull outputs. Most comparators also have open drain outputs (to allow for OR'ing outputs). If you use a comparator, you will need to include a pullup resistor. This isn't neccesary on an op amp with a push pull output.

author: Andy Watson
author_rank: Super Contributor
timestamp: July 29, 2014, 10:59:59 am
content: The LM2903 has an open collector (or drain, according to the datasheet!) NPN transistor driving the output. You will need to pull the output to the positive rail to make your circuit work.

author: rob77
author_rank: Super Contributor
timestamp: July 29, 2014, 11:01:45 am
content: Quote from: pyrohaz on July 29, 2014, 10:58:23 am+1i was writing a post about the open-collector and a pull-up needed for comparators, but +1 is enough now

author: hkBattousai
author_rank: Regular Contributor
timestamp: July 29, 2014, 12:03:22 pm
content: How do I build the circuit by using comparator?The circuit with opamp is obvious:How do I adopt this circuit to comparator version? Is one of the following circuits correct way to do it?

author: pyrohaz
author_rank: Regular Contributor
timestamp: July 29, 2014, 01:13:36 pm
content: In the picture you posted, you're using a dual supply. In the pictures you've just posted, you're only using a single supply. If you want it to work on a single supply, you need to bias the 4.7k resistor network at 7.5v (I'll include a pic). Otherwise, the second one would probably be better as in the first example, the capacitor will be charging through two 4.7k resistors but only discharging through one (you won't get a constant duty cycle). In the second example, as long as the comparator is fast and its not driving a significant load, the capacitor charging and discharging circuit will be buffered with respect to the comparator output, giving a "hopefully" constant duty cycle. If you want the capacitor voltage to swing between 1/3 and 2/3 VCC, you can make the 7.5v by adding a 4.7k resistor between the non-inverting input of the comparator and 15v.

author: pyrohaz
author_rank: Regular Contributor
timestamp: July 29, 2014, 01:15:02 pm
content: WRT the final part I mentioned.

author: dannyf
author_rank: Super Contributor
timestamp: July 29, 2014, 05:49:03 pm
content: QuoteDoesn't really matter. Both will work.Also works would be a NOT gate (preferrably one with ST inputs) - I use a HC132 for example and others will work as well. It works particularly well if you intend to interface it with other digital circuits.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 29, 2014, 10:44:48 pm
content: Since the comparator output will do a fine job pulling down (at least for a few mA), I usually use a single emitter follower, bypassed with a reverse diode:(Err, this schematic doesn't have it... just imagine there's a 1N914 from E to B. And then the pull-down R6 can be 10k instead of 1k.)The rising and falling thresholds are not exactly 1/3 and 2/3 Vcc (er.. that is, if R1 = R2 = R3) due to the various voltage drops (the pull-up doesn't go all the way up, the transistor drops a Vbe, and the pull-down doesn't pull all the way down), but it's close enough with a little finagling.Tim

author: dannyf
author_rank: Super Contributor
timestamp: July 29, 2014, 10:52:39 pm
content: A high voltage / high power relaxation oscillator can be done through a 555 + 1 resistor + 1 capacitor. Cannot be simpler than that.

author: hkBattousai
author_rank: Regular Contributor
timestamp: July 30, 2014, 01:06:27 am
content: Quote from: dannyf on July 29, 2014, 10:52:39 pmYes, but most 555 ICs work with 16V-18V supplies, while comparators work up to 40V supplies. Actually, that's why I prefer comparator over 555 in my circuit.

author: dannyf
author_rank: Super Contributor
timestamp: July 30, 2014, 01:13:15 am
content: Put a but or mosfet on the output, with a pull up, you can output as much as you can.another approach is to use an out of phase mosfet driver.