Voltage range conversion

Hi All,

Apologies if this is in the wrong section, tell me if so

I have a linear voltage output 2.5 to 3.5

Needs to be Linear 0.5 to 4.5

Is Adruino appropriate For this ?

Tnx

For the calculation, any Arduino will do.

How fast is your voltage varying? If that's e.g a few Hz, you will be OK; if it's in the MHz range, an Arduino might not be the right choice.

A standard AVR based Arduino can do roughly 10,000 analog reads per second with 10-bit resolution (1024 steps).

Most Arduinos don't have an analog output; you either need to find one that has (e.g. a Due has 2 analog outputs, no idea about the resolution) or use some additional electronics (either a filter or a external DAC).

If you want the Arduino to output a defined voltage, be aware that most Arduinos do not have an digital to analog converter. You will need an external DAC. Example

I would use an op amp circuit with a gain of four instead. With just a 5V power supply, you will need a rail-to-rail op amp.

Tnx for your reply

The voltage change is very slow, from a pressure transducer on a water storage tank

An op amp would just increase the voltage ?

I need the 2.5 reduced to 0.5
And the 3.5 increased to 4.5
So i finish up with linear 0.5 to 4.5 V

Simon

There might be a better solution, but you need to tell us about your project.

Where does the 2.5-3.5 V signal come from? Why do you want to convert that to a different range?

Great,

I have a pressure transducer that outputs 2.5 V when tank empty And 3.5 V when full

This needs to interface with a gauge that needs 0 to 180 Ohms

I can not find a pressure transducer that can be connected to an external water connection of the tank that supplies 0-180
There is no internal access to the tank to fit a 0-180 transducer

I bought an interfacing box which needs an input of 0.5 V to 4.5 V and outputs 0-180 ohms
When Initially connected the needle on the gauge Moved just a fraction
I have used the calibration function On the interfacing box and I get a slightly bigger deflection, but it’s still not right, as I am not supplying this interface box with the correct voltage range
That is how I finished up with this thread
Very messy !

So, if the Adruino could take an input range of 2.5 V to 3.5 V
And output this from 0 Ohms to 180 Ohms

That would be perfect

This needs to interface with a gauge that needs 0 to 180 Ohms

Please post a link to the spec of the gauge. Please use the link icon this time so that you link can be clicked.

simonfraser:
Gauge

404 Error Page

Please check any link you post!

Gauge

Corrected

Thanks.

Someone who is an expert in op-amp circuits could probably design something that would adapt your pressure sensor output direct to that gauge, without the interface box.

But assuming we use the interface box, it should be possible with a single op-amp used as a non-inverting amplifier. The op-amp would need to subtract 2.375V from the sensor output and apply a gain of 4 (ie. multiply by 4). So 2.5V becomes 0.5V and 3.5V becomes 4.5V. It should just be a case of calculating 4 suitable resistor values.

There are various op-amp resistor calculator web pages such as this one. I tried to use it, but I must have done something wrong, because it calculated negative resistor values! Hopefully a forum member who's op-amp skills are a little less rusty than mine can help us out.

Tnx Paul, v helpful

Did not know such an op amp could be designed

That is something I am likely to be able to attempt myself

I have already ordered an up to 100x amp with adjustment from 0 to 100

Guess I can reduce the input voltage to the op amp with a variable resistor

Hm, might have a fix here

No, you would need to use an op-amp. You can't subtract a voltage using a variable resistor, that would only reduce the voltage by an adjustable factor, a percentage. An op-amp can do this because it has two inputs, one inverting (-) and the other non-inverting (+). What the op-amp does is amplify the difference between its + and - inputs. So you would feed the sensor signal into the + input and a fixed 2.375V into the - input, and set the gain at x4.

You will need to provide the op-amp circuit with a regulated supply voltage, say 5V. Using a voltage divider consisting of two resistors (e.g. 6K2 and 5K6), you can make a voltage of 2.375V from the 5V supply and feed that to the - input. But the part I can't figure out is that a resistor needs to be connected between the op-amp output and the - input to set the gain. That's going to interfere with the voltage divider and it won't output the required 2.375V, and also the voltage divider will mess with the gain setting.

We just need someone to help us figure out that resistor calculator page to get the required values, I think!

Tnx Paul

Ok, def will need guidance to design that

Some one may come along on this forum ?

I was hoping that jremington might, for example.

I found this calculator, which seems very close to what's needed, but it asks for a voltage reference. In a minimal circuit, the only reference voltages would be 0V or 5V (say), but those give crazy outputs, so that's no use.

Perhaps a second op-amp could be used to provide a unity-gain buffer for the 2.375V from a 6K2/5K6 voltage divider. The output of that could then be fed to the other op-amp as the voltage reference.


Sounds like a job for an LM386 - specifically the higher voltage version (LM386N-4).

An op-amp with the ability to drive an 8-ohm load (or 16 Ohm to ground) as audio should presumably handle a 90 Ohm load.

Input to pin 3 with a 450k (430 would likely do) resistor in series, 2.7 V Zener on pin 7 to ground, 390k in series with 100k trimpot from pin 7 to pin 2, and a 787 Ohm (820 would probably do) resistor from pin 1 to pin 8. :grinning:

Sorry, it would take some thought to design an interface to a gauge that expects a resistive sensor. The gauge itself will supply a known current to the sensor, then measure the voltage drop across it. One approach would be to construct a voltage controlled constant current sink, but I would not attempt that without the gauge to test the circuit.

You can certainly buy such interfaces. It sounds like you tried that but got the wrong one. So, try another.

jremington:
Sorry, it would take some thought to design an interface to a gauge that expects a resistive sensor.

Understood.

If the OP uses the adaptor they already have, that will interface to the gauge, but needs a 0.5-4.5V input, compared to the 2.5-3.5V sensor output, so the question is how to use an op-amp circuit to perform that level translation. I can't figure out if one or two op-amps would be needed.

Paul__B:
Input to pin 3 with a 450k (430 would likely do) resistor in series, 2.7 V Zener on pin 7 to ground, 390k in series with 100k trimpot from pin 7 to pin 2, and a 787 Ohm (820 would probably do) resistor from pin 1 to pin 8.

This would translate a voltage in the range 2.5-3.5v to a voltage in the range 0.5-4.5V?

tnx all for your input

so if i go for an Arduino:

i could connect the pressure sensor output 2.5-3.5V to an input
convert that to a digital number
do the maths
then output 0.5-4.5V from the Arduino to the interface box ?

i have coded in BASIC well i wont tell you how long ago :slight_smile:
but should be able to learn that part

which Arduino board, complete, would be suitable for this ?

tnx, Simon