# ADC value (4000 to 20000) to (0-400) milibar conversion

I am getting full scale ADC value from 4000 to 20000. I am trying to convert o 0-400 mbar pressure, as I am ultimately measuring height of a tank.

I have a equation to measure the Height of Liquid.

Pressure Eq.

$L = \dfrac{P}{ \rho \cdot g}$

$\rho = \rho_{0} \cdot SG$

$SG = 1.033 \text{ (Specific Gravity of Milk)}$

$\rho_{0} = 1 \text{ (Density of fresh water)}$

$\rho = 1.033$

$P = \text{ADC Coutn To MiliBar Or Bar Value}$

But how can I convert the ADC value to Milibar or Bar value?

• Where is the equation for pressure? – Ignacio Vazquez-Abrams Oct 29 '15 at 9:33
• Well in the ideal case you have a linear relationship between ADC value and pressure, so just draw a diagram, put the ADC values on the X-axis, the pressure values on the Y-axis. Put the points in there, connect them, think about how you get a formula out of it to describe what you just drawn. – Arsenal Oct 29 '15 at 9:45
• If it is a linear relationship, google y=mx+c. – Tom Carpenter Oct 29 '15 at 13:28
• I thought linear equations was mandatory prerequisite knowledge before studying programming... – Lundin Oct 29 '15 at 15:00