Comparators for shifted voltage functions

Thread Starter

...You Lost Me

Joined Jun 3, 2013
2
So I have a problem where I'm supposed to create the simplest circuit for amplifying a voltage function v(t)= asin(bt) + c in volts for some constants a, b, and c.

My initial thought is to do a standard comparator (below)


But instead of a ground voltage I'd use a power supply at c volts. I'm just suspicious because our teacher never did this in class (instead he used a non-inverting amplifier with large gain, and I'm not sure how to work out the specifics of that). Is this a bad idea, and if so could you tell me why?
 

WBahn

Joined Mar 31, 2012
30,055
Are you trying to amplify a signal or are you trying to perform a comparison operation and, if so, what are you comparing to what?

Draw a sketch of what Vin looks like as a function of time and, on the same set of axes, what you want Vout to look like.
 

Thread Starter

...You Lost Me

Joined Jun 3, 2013
2
Oh, sorry!

I wanted Vin to be a sine wave and Vout would be a square wave from that sine wave (so any positive value would saturate and provide the maximum possible value).

Effectively, this:
 

WBahn

Joined Mar 31, 2012
30,055
The simplest thing to do, depending on some factors that haven't been mentioned such as voltage range and speed requirement, would be to use something like an LM339 comparator. You supply a reference level to one pin and apply the signal to the other pin. They are open-collector output, so you need to provide a pull-up resistor to make it work. The data sheet should have reference designs for different situations.

You can either use a fixed reference level, or you could get fancy and have an reference level that automatically adjusts to the DC level of the signal. But start simple and get something working and then add sophistication and complexity in stages.
 
Top