# Comparators for shifted voltage functions

Discussion in 'Homework Help' started by ...You Lost Me, Jun 3, 2013.

1. ### ...You Lost Me Thread Starter New Member

Jun 3, 2013
2
0
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?

2. ### WBahn Moderator

Mar 31, 2012
23,552
7,207
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.

3. ### ...You Lost Me Thread Starter New Member

Jun 3, 2013
2
0
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:

4. ### WBahn Moderator

Mar 31, 2012
23,552
7,207
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.