1
\$\begingroup\$

I want to convert my 0 to (-40 )v signal to be 0-5 volt so that i can measure it using arduino,

i want to attenuate the signal first by the factor of 8 and then shift it up by the arduino 5 volt. lets say for example if the signal is -20 volt

-20/8 = -2.5 ,,, -2.5+5 =2.5 v

is that possible ?

but then this is how i emplemented it and the voltage is always fixated at 5 V

bellow is my circuit, tell me where did I go wrong enter image description here

\$\endgroup\$
6
\$\begingroup\$

You can use an opamp to perform the translation if you like.

But there's an easier way : using 2 resistors you can both attenuate and level shift at the same time. I have chosen values that give a 10:1 attenuation and an 0.5V unused range at each end of the scale - scaling to the correct values is simple in software.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Nice and simple, Brian. +1. \$\endgroup\$ – Transistor Feb 27 '16 at 10:48
  • 1
    \$\begingroup\$ For the OP, I would add that resistive divider circuits work as long as you do not load them 'much'. That is, the input resistance of the subsequent circuit should be much higher than the output resistance of this circuit. In the case of an Arduino input pin, the 100 MOhm input resistance will play well, but other circuits might require a buffer amplifier. \$\endgroup\$ – Sredni Vashtar Feb 27 '16 at 13:24
  • 1
    \$\begingroup\$ @SredniVashtar Worth pointing out: while the ATmega328 datasheet specifies the "Analog Input Resistance" as 100MΩ, this is likely just the ADC input impedance, rather than the input impedance of the entire IO pin mux and ADC mux structure. There is at least 14pF of S/H capacitance, and likely some leakage current from the pin muxes. Hence, Atmel specifies a source impedance of <10kΩ for reasonable ADC operation. \$\endgroup\$ – uint128_t Feb 27 '16 at 17:41
1
\$\begingroup\$

You have the two voltages fighting each other.

Look at the 5 V supply: it's connected directly to the output.

Meanwhile the voltage at R1 and R2 is trying to pull it away from 5 V but can't because the lower resistance of the directly connected 5 V circuit will always win.

V2 seems to be drawn as a positive supply. Your question says it's a negative signal.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Inverting amplifier.

The inverting amplifier op-amp circuit does exactly what you need. In this configuration the relationship between output and input is given by the formula

$$ V_{OUT} = - \frac {R_F}{R_I} $$

Setting these as shown in Figure 1 gives a gain of -8 and your -40 V signal will be "amplified" to +5 V.

You need to select an op-amp capable of "rail to rail" operation. i.e., the output can swing to negative and positive rails.

\$\endgroup\$
  • \$\begingroup\$ yeah I got why its 5V, but how to use this 5V only to shift the R1,R2 output ? V2 is drawn as positive but it has a value of -20 V @transistor \$\endgroup\$ – Sabir Moglad Feb 27 '16 at 9:55
  • \$\begingroup\$ See the update. \$\endgroup\$ – Transistor Feb 27 '16 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.