I am a beginner in electronics. I got myself a second-hand analog oscilloscope but I don't have a function generator. So, as a first project, I am trying to design a circuit to use any device's sound output (PC, mobile phone, etc.) to generate simple sine waves. This will allow me to start learning about designing and how to use an analog oscilloscope.
I have been reading about op-amps in the Art of Electronics and on various websites, so I have based my design around op-amps. I would like to have some input about my design, if it has any glaring shortcomings and things that I have missed as a beginner. Also, I am not sure how to choose values for R and C. Here is my design, please keep in mind it is my first ever experience in electronics & circuit design.
First, I have done some research about the signals that a typical sound card outputs, and it seems like it has no DC offset and is centered about 0V. Since I will be powering my circuit with the USB port's +5V referenced to ground, I will need to provide a DC offset to the signal.
The first part of my circuit is meant to supply this DC offset. I will be using an op-amp in the voltage follower configuration driven by a voltage divider.
- I could have used the output of the voltage divider R1 // R2 as my DC bias out, without using the first op-amp OA1. However, according to my understanding, due to the op-amp's huge input impedance, it serves as a buffer between my computer's sound card and the circuitry I will be driving with the signal, which is a desirable feature. On the other hand, I could've connected the output of the voltage divider R1 // R2 directly to the DC offset input of the second circuit which is also using an op-amp. If I do that, I still retain that huge input impedance and the buffering protection. Therefore I am thinking that the first op-amp OA1 is not really needed, and that I could have done the same thing with only one op-amp.
- In the first circuit, how do I determine R1 and R2? Let's say I want +2.5V at the output of the divider, then I have to choose R1 equal to R2. If I choose values too low, lots of current will be wasted through the resistors, but if I choose too high, loading effects will start to be noticeable. I have chosen R1 = R2 = 100K.
- C1 is a bypassing capacitor that shorts AC noise to ground, am I correct? How would I choose its value? I have seen on the internet that a bypass capacitor is also inserted at the output of op-amps that provide DC bias (C2). Is it really needed? Why would it be needed if the AC noise has already been shorted to ground at the input? What capacitance value should I set it to?
- Could I use a potentiometer as my voltage divider? This would allow me to vary the DC offset with a knob. However, it could short out my USB rail to ground when I turn the knob all the way.
- C3 is a capacitor that is used to block any DC in the incoming signal. How do I choose its value?
- How can I be sure that R3 won't load my input signal?
- R4 and R5 determine the gain of the amplifier (gain = 1+R2/R1). For a given gain, how do I determine R2 and R1? What is the tradeoff between bigger resistances and lower resistances? For example, if I want a gain of 2, R2 must be equal to R1, but what are the constraints and considerations to chose the values of these resistances?
- Can I use a potentiometer instead of R4 and R5 to make the gain adjustable with a knob? If I do so, is there anything I should take into account?
- C4 is there to make the gain at DC = 1 (roll off the gain at DC). How do I set its value?
- Am I missing anything?
Thank you very much for your help. Any comments and feedback will be welcomed.