Skip to main content
replaced http://electronics.stackexchange.com/ with https://electronics.stackexchange.com/
Source Link

The easiest way is to use a "resistor divider".

You didn't say what voltage this PIC is running at and therefore the A/D input range is, so let's use 5V for the example. Your input voltage range is 40V, and the output 5V, so you need something that attenuates by at least 8. You also need the result to be centered on 1/2 Vdd, which is 2.5V, whereas your input voltage is centered on 0V.

This can be accomplished with 3 resistors. One end of all three resistors are connected together and to the PIC A/D input pin. The other end of R1 goes to the input signal, R2 goes to Vdd, and R3 goes to ground. The resistor divider is formed by the R1 and the parallel combination of R2 and R3. You can adjust R2 and R3 to center the resulting range at 2.5V, but for simplicity explaining this we'll live with a little bit of assymetry and attenuate a little bit more to make sure both ends are limited to the Vss-Vdd range.

Let's say the PIC wants the analog signal to have a impedance of 10 kΩ or less. Again for simplicity, let's make R2 and R3 20 kΩ. The impedance feeding the PIC will be no more than the parallel combination of those, which is 10 kΩ. To get attenuation of 8, R1 needs to be 7 times R2//R3, which is 70 kΩ. However, since the result won't be exactly symmetric, we need to attenuate a little more to make sure -20V in won't result in less than 0V into the PIC. That actually requires attenuation of 9, so R1 must be at least 8 times R2//R3, which is 80 kΩ. The standard value of 82 kΩ will allow for some slop and margin but you still get most of the A/D range to measure the original signal.

Added:

HereHere is a example of finding the exact solution to a similar problem. This has no assymetry and has a particular specified output impedance. This form of solution can always be used when the A/D range is wholly within the input voltage range.

The easiest way is to use a "resistor divider".

You didn't say what voltage this PIC is running at and therefore the A/D input range is, so let's use 5V for the example. Your input voltage range is 40V, and the output 5V, so you need something that attenuates by at least 8. You also need the result to be centered on 1/2 Vdd, which is 2.5V, whereas your input voltage is centered on 0V.

This can be accomplished with 3 resistors. One end of all three resistors are connected together and to the PIC A/D input pin. The other end of R1 goes to the input signal, R2 goes to Vdd, and R3 goes to ground. The resistor divider is formed by the R1 and the parallel combination of R2 and R3. You can adjust R2 and R3 to center the resulting range at 2.5V, but for simplicity explaining this we'll live with a little bit of assymetry and attenuate a little bit more to make sure both ends are limited to the Vss-Vdd range.

Let's say the PIC wants the analog signal to have a impedance of 10 kΩ or less. Again for simplicity, let's make R2 and R3 20 kΩ. The impedance feeding the PIC will be no more than the parallel combination of those, which is 10 kΩ. To get attenuation of 8, R1 needs to be 7 times R2//R3, which is 70 kΩ. However, since the result won't be exactly symmetric, we need to attenuate a little more to make sure -20V in won't result in less than 0V into the PIC. That actually requires attenuation of 9, so R1 must be at least 8 times R2//R3, which is 80 kΩ. The standard value of 82 kΩ will allow for some slop and margin but you still get most of the A/D range to measure the original signal.

Added:

Here is a example of finding the exact solution to a similar problem. This has no assymetry and has a particular specified output impedance. This form of solution can always be used when the A/D range is wholly within the input voltage range.

The easiest way is to use a "resistor divider".

You didn't say what voltage this PIC is running at and therefore the A/D input range is, so let's use 5V for the example. Your input voltage range is 40V, and the output 5V, so you need something that attenuates by at least 8. You also need the result to be centered on 1/2 Vdd, which is 2.5V, whereas your input voltage is centered on 0V.

This can be accomplished with 3 resistors. One end of all three resistors are connected together and to the PIC A/D input pin. The other end of R1 goes to the input signal, R2 goes to Vdd, and R3 goes to ground. The resistor divider is formed by the R1 and the parallel combination of R2 and R3. You can adjust R2 and R3 to center the resulting range at 2.5V, but for simplicity explaining this we'll live with a little bit of assymetry and attenuate a little bit more to make sure both ends are limited to the Vss-Vdd range.

Let's say the PIC wants the analog signal to have a impedance of 10 kΩ or less. Again for simplicity, let's make R2 and R3 20 kΩ. The impedance feeding the PIC will be no more than the parallel combination of those, which is 10 kΩ. To get attenuation of 8, R1 needs to be 7 times R2//R3, which is 70 kΩ. However, since the result won't be exactly symmetric, we need to attenuate a little more to make sure -20V in won't result in less than 0V into the PIC. That actually requires attenuation of 9, so R1 must be at least 8 times R2//R3, which is 80 kΩ. The standard value of 82 kΩ will allow for some slop and margin but you still get most of the A/D range to measure the original signal.

Added:

Here is a example of finding the exact solution to a similar problem. This has no assymetry and has a particular specified output impedance. This form of solution can always be used when the A/D range is wholly within the input voltage range.

added 349 characters in body
Source Link
Olin Lathrop
  • 315.1k
  • 36
  • 441
  • 928

The easiest way is to use a "resistor divider".

You didn't say what voltage this PIC is running at and therefore the A/D input range is, so let's use 5V for the example. Your input voltage range is 40V, and the output 5V, so you need something that attenuates by at least 8. You also need the result to be centered on 1/2 Vdd, which is 2.5V, whereas your input voltage is centered on 0V.

This can be accomplished with 3 resistors. One end of all three resistors are connected together and to the PIC A/D input pin. The other end of R1 goes to the input signal, R2 goes to Vdd, and R3 goes to ground. The resistor divider is formed by the R1 and the parallel combination of R2 and R3. You can adjust R2 and R3 to center the resulting range at 2.5V, but for simplicity explaining this we'll live with a little bit of assymetry and attenuate a little bit more to make sure both ends are limited to the Vss-Vdd range.

Let's say the PIC wants the analog signal to have a impedance of 10 KOhms or less. Again for simplicity, let's make R2 and R3 20 Kohms. The impedance feeding the PIC will be no more than the parallel combination of those, which is 10 KOhms. To get attenuation of 8, R1 needs to be 7 times R2//R3, which is 70 Kohms. However, since the result won't be exactly symmetric, we need to attenuate a little more to make sure -20V in won't result in less than 0V into the PIC. That actually requires attenuation of 9, so R1 must be at least 8 times R2//R3, which is 80 KOhms. The standard value of 82 KOhms will allow for some slop and margin but you still get most of the A/D range to measure the original signal.

Added:

Here is a example of finding the exact solution to a similar problem. This has no assymetry and has a particular specified output impedance. This form of solution can always be used when the A/D range is wholly within the input voltage range.

The easiest way is to use a "resistor divider".

You didn't say what voltage this PIC is running at and therefore the A/D input range is, so let's use 5V for the example. Your input voltage range is 40V, and the output 5V, so you need something that attenuates by at least 8. You also need the result to be centered on 1/2 Vdd, which is 2.5V, whereas your input voltage is centered on 0V.

This can be accomplished with 3 resistors. One end of all three resistors are connected together and to the PIC A/D input pin. The other end of R1 goes to the input signal, R2 goes to Vdd, and R3 goes to ground. The resistor divider is formed by the R1 and the parallel combination of R2 and R3. You can adjust R2 and R3 to center the resulting range at 2.5V, but for simplicity explaining this we'll live with a little bit of assymetry and attenuate a little bit more to make sure both ends are limited to the Vss-Vdd range.

Let's say the PIC wants the analog signal to have a impedance of 10 KOhms or less. Again for simplicity, let's make R2 and R3 20 Kohms. The impedance feeding the PIC will be no more than the parallel combination of those, which is 10 KOhms. To get attenuation of 8, R1 needs to be 7 times R2//R3, which is 70 Kohms. However, since the result won't be exactly symmetric, we need to attenuate a little more to make sure -20V in won't result in less than 0V into the PIC. That actually requires attenuation of 9, so R1 must be at least 8 times R2//R3, which is 80 KOhms. The standard value of 82 KOhms will allow for some slop and margin but you still get most of the A/D range to measure the original signal.

The easiest way is to use a "resistor divider".

You didn't say what voltage this PIC is running at and therefore the A/D input range is, so let's use 5V for the example. Your input voltage range is 40V, and the output 5V, so you need something that attenuates by at least 8. You also need the result to be centered on 1/2 Vdd, which is 2.5V, whereas your input voltage is centered on 0V.

This can be accomplished with 3 resistors. One end of all three resistors are connected together and to the PIC A/D input pin. The other end of R1 goes to the input signal, R2 goes to Vdd, and R3 goes to ground. The resistor divider is formed by the R1 and the parallel combination of R2 and R3. You can adjust R2 and R3 to center the resulting range at 2.5V, but for simplicity explaining this we'll live with a little bit of assymetry and attenuate a little bit more to make sure both ends are limited to the Vss-Vdd range.

Let's say the PIC wants the analog signal to have a impedance of 10 or less. Again for simplicity, let's make R2 and R3 20 . The impedance feeding the PIC will be no more than the parallel combination of those, which is 10 . To get attenuation of 8, R1 needs to be 7 times R2//R3, which is 70 . However, since the result won't be exactly symmetric, we need to attenuate a little more to make sure -20V in won't result in less than 0V into the PIC. That actually requires attenuation of 9, so R1 must be at least 8 times R2//R3, which is 80 . The standard value of 82 will allow for some slop and margin but you still get most of the A/D range to measure the original signal.

Added:

Here is a example of finding the exact solution to a similar problem. This has no assymetry and has a particular specified output impedance. This form of solution can always be used when the A/D range is wholly within the input voltage range.

Post Merged (destination) from electronics.stackexchange.com/questions/15940/…
Source Link
Olin Lathrop
  • 315.1k
  • 36
  • 441
  • 928

The easiest way is to use a "resistor divider".

You didn't say what voltage this PIC is running at and therefore the A/D input range is, so let's use 5V for the example. Your input voltage range is 40V, and the output 5V, so you need something that attenuates by at least 8. You also need the result to be centered on 1/2 Vdd, which is 2.5V, whereas your input voltage is centered on 0V.

This can be accomplished with 3 resistors. One end of all three resistors are connected together and to the PIC A/D input pin. The other end of R1 goes to the input signal, R2 goes to Vdd, and R3 goes to ground. The resistor divider is formed by the R1 and the parallel combination of R2 and R3. You can adjust R2 and R3 to center the resulting range at 2.5V, but for simplicity explaining this we'll live with a little bit of assymetry and attenuate a little bit more to make sure both ends are limited to the Vss-Vdd range.

Let's say the PIC wants the analog signal to have a impedance of 10 KOhms or less. Again for simplicity, let's make R2 and R3 20 Kohms. The impedance feeding the PIC will be no more than the parallel combination of those, which is 10 KOhms. To get attenuation of 8, R1 needs to be 7 times R2//R3, which is 70 Kohms. However, since the result won't be exactly symmetric, we need to attenuate a little more to make sure -20V in won't result in less than 0V into the PIC. That actually requires attenuation of 9, so R1 must be at least 8 times R2//R3, which is 80 KOhms. The standard value of 82 KOhms will allow for some slop and margin but you still get most of the A/D range to measure the original signal.