Non linear analog output

Dear all,

I have small doubt here. As i know if any sensor as output with 0~5v analog the curve will be linear. So we do simple conversion like
If curve is linear and analog out put is 0-5v.

sensorValue = analogRead(sensorPin);
voltage =5/1023*sensorValue ;

Question1:
Assume that i have sensor which gives me output analog -5v and +5v . The curve is linear. For +5v we can give directly to port . But if there is -ve reading can we give the voltage to analog port directly or not???
if not What i need make it work??
IS any additional circuit i Need build ??
How my Nonlinear equation look like in this situation??

question 2:
I have arduino UNO . it is 10 bit resolution.
Assume I Have analog sensor which is 12bit resolution.
If output of analog sensor is linear, Then which multiplication factor i need to consider in below equation.

sensorValue = analogRead(sensorPin);
voltage =5/1023*sensorValue ;

OR

sensorValue = analogRead(sensorPin);
voltage =5/4096*sensorValue ;

Assume that i have sensor which gives me output analog -5v and +5v .

Do NOT connect that directly to the Arduino. The negative voltage will destroy it.

I have no device to connect. But for sake of knowledge i asked,

I am planning purchase one sensor Which has non linear output.I wanted to how to interface it.
It has -5v gives -70 degree , 0v o degree and 5v as 75 degree.

My question how can use this sensor?? What additional circuit i need build. Or i cant use the Sensor itself

My question how can use this sensor?? What additional circuit i need build. Or i cant use the Sensor itself

You need an opamp in between. The amplifier portion will reduce the range to +/- 2.5V, and the offset portion will make it 0 to 5V.

Why do you assume that the output is non-linear?

sensorValue = analogRead(sensorPin);
voltage =5/1023*sensorValue ;

Rubbish, 5 divided by any number > 5 is always = 0.

Post a link to this sensor you want to use.

Mark

It just for understanding. Here i have attached output curve of sensor. I have given example. My sensor gives output curve like this. How can i interface

output.pdf (119 KB)

Actually, those curves look pretty linear, using 3 or 4 ranges. You get some value from the device, and it falls within some range. Test which range it is using compound of statements (if(value >= lowerLimit[0] && value < upperLimit[0]) // value in range 1). Then, in the body of the statement, use map() to get the corresponding output for the linear portion of the curve.

For non linear mapping I wrote multimap() some time ago

check examples at - Arduino Playground - MultiMap -