Electronic – How to bias an AC signal for sampling

acbias

I want to sample a 10Vp-p 50Hz sinusoidal signal.

My ADC can only sample between 0V and 5V, so I need to bias the voltage around 2.5V.

I only have a positive 5V power supply.

To do this, I was going to feed the AC signal to a resistor divider so that it will be 5Vp-p, then add a 2.5V DC offset with another resistor divider pair (AC coupling each stage).

However, I'm having trouble with the DC offset, and I'm not sure this is the best approach to do this.

enter image description here

enter image description here

As you can see, my voltage is still negative. How can I get a 5Vp-p signal offset around 2.5V?

Best Answer

Your sine wave isn't 5V peak-to-peak, it's 5V zero-to-peak.

In your simulation, try adding a 50-ohm resistor to ground between R3 and C1.

In the real world you would need to design the circuit so as to mitigate interactions between components, typically by using op-amps as buffers, but for your first pass in a simulator (where you don't care about the amount of virtual current that is going to be consumed by your virtual 50-ohm voltage divider) just adding the resistor is fine.

Of course, if you actually want to work with a 5Vp-p sine wave, then just change the simulated source's amplitude to 2.5V and everything should start working.