0
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ Where is the equation for pressure? \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 29 '15 at 9:33
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Arsenal Oct 29 '15 at 9:45
  • 1
    \$\begingroup\$ If it is a linear relationship, google y=mx+c. \$\endgroup\$ – Tom Carpenter Oct 29 '15 at 13:28
  • \$\begingroup\$ I thought linear equations was mandatory prerequisite knowledge before studying programming... \$\endgroup\$ – Lundin Oct 29 '15 at 15:00
1
\$\begingroup\$

If your ADC goes from 4000 to 20000 it means you have 16000 point to mesure 400mbar.

Then the resolution of your mesure is:

resolution= 400/16000 = 0.025mbar.

And you have an offset of 4000 point.

Then your value in mbar is : P = (ADCvalue - offset) * resolution.

\$\endgroup\$

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.