# Voltage Mapping

I need to make some votage conversions, to get an input for different devices. And there is one situation I cant solve: I managed to get an output that varies between 2 and 10 V, ths serve as an input for another device that wants something between 0 and 10V. And I need a voltage as close to 0V as possible. So the methods of using a votage divider is not helping, and using some diodes (resting each 0.7V) will not work, because both will lower the upper limit. I've seen some circuits with OpAmp, but they need a negative voltage supply, and I´m trying to avoid that. What kind of other solution is there to be explored?

You might design something that switches automatically between two levels at a certain voltage. ?

ONe transistor blocks at 5V the other opens...

Not able to undstrand this solution.

Maybe the explanition wasn´t the best.

What I´m trying to achieve is the equivalent of the map() function this way:

map(x, 2, 10, 0, 10) with the values expressed in voltages.

I am not sure what you want to do. Why did you talk of potential dividers? What is your solution now that gives you the problem? Diagrams would help.

If you have a voltage that doesn't go down to zero and you want it to you can put two or three diodes in series to shave of the DC offset. However that messes up the top end so you will have to provide more there.

Is the problem hardware? (my assumption...

Or software ?

Tell us more about the project so we get a better picture..

The problem is hardware, quite outside the pure Arduino world, but controlled by it.

I´ll try to show a better picture:

• supply voltage for the circuit is 12V and GND
• one device gives an outupt of 2 to 10V
• another device wants it´s input starting with 0V, max 10V (or 12V)
• I want to connect this two devices
• A 2V reference is available

The solutions that I explored, and don´t give me a direct solution are:

• voltage divider: it will just divide, but cant get the lower limit to 0V
• adding diodes in series: will lower the upper input also

I just mentioned the map() function for illustration purpose only.

So far I got to two possible solutions:

• add the diodes and then amplify the voltage
• use a rail to rail OpAmp as a differential amplifier, like the following from wikipedia

Will that work? As allways, thanks for the help.

I´ll try to show a better picture:

supply voltage for the circuit is 12V and GND one device gives an outupt of 2 to 10V another device wants it´s input starting with 0V, max 10V (or 12V) I want to connect this two devices A 2V reference is available

Unless it's mandatory that you scale the external circuitry to the arduino 0-5vdc range for maximum steps of resolution, just use appropriate sized passive voltage dividers such that the maximum possible external measurement signal equals 5vdc, then use specific software map() functions for each different analog input pin.

The first channel can use a resistor divider (/2), giving a 1-5vdc measurement range so the map function could be map(channel1_reading, 205,1023, 0, myMaxUnits#1);

The second channel if indeed 0-10vdc max, use also a /2 divider for that signal giving 0-5vdc input, and map(channel2_reading,0,1023,0,myMaxUnits#2).

That should at least let you move on with the project. You can always come back and design and build external hardware op-amp to scale and offset that channel1 voltage if it's really required, but it's probably really not needed.

Lefty

Thanks retrolefty. You helped me thing out of the box. Regards.