ltspice

Reading simple 0 to 5V or 0 to 3.3V signals with an ADC is trivial and can be done entirely with the integrated hardware on most microcontrollers. Things get slightly more difficult when you need to sample analog signal that can be negative or positive.

This blog post will walk you through a basic solution to this using solely passive components. You’ll find the input and output waveforms, schematics, and LT Spice simulation files linked at the end.

In order to start, we need to make some assumptions on what our input signal could look like. You have your output requirements from the ADC you want to use, now we have to determine what our inputs would look like. For the sake of simplicity, let’s start with the basic -8V to +8V 1Hz sine wave below.

vin

The primary stage in solving this problem is to convert our bipolar signal to a unipolar signal using the basic resistor network below. Notice how the values of R2 and R3 are equal and twice that of R1. This will be explained later.

bipolar-to-unipolar

We need to do a little bit of analysis using KCL to understand what’s happening here. I’ll use Vcc as our high voltage, Vin for the input sine wave, and Vx for our output. I also marked the currents going from Vin and Vcc to positive and the current going from Vx to ground as negative.

bipolar-to-unipolar-kcl
bipolar-to-unipolar-kcl-math

If we are going to want the full-negative swing to be 0 on the output, we can use this as a constraint to determine the needed value for Vcc. In the final equation above we can clearly see to make Vx zero, the value of Vcc must be twice the most negative value for Vin. So, for this circuit, the minimum value for Vcc must be 16V.

Using the value of 16V on Vcc and a highest value of 8V on Vin will give us value of 8V on Vx. So this network converts a -8V to +8V input signal to a output signal of 0V to 8V. The simulated schematic and waveform agrees with our math.

bipolar-to-unipolar-spice-1
bipolar-to-unipolar-waveform

The final step is to simply add a voltage divider in between the output of our bipolar-to-unipolar network and our ADC. In the schematic and waveform below I selected a 167k-100k divider to put our output at about 0 to 3V to account for any overshoots on the input.

bipolar-to-unipolar-spice-2
bipolar-to-unipolar-waveform-2

Downloads


download
Download example SPICE file