Difference between revisions of "Analog Pressure sensor"

From Let's Control It
Jump to navigation Jump to search
Line 14: Line 14:
 
[[File:PSI.png]]
 
[[File:PSI.png]]
  
Brand new pressure transducer. Stainless steel body.
+
'''Specifications:'''
 
  Input: 0-100 psi.
 
  Input: 0-100 psi.
 
  Output: 0.5V – 4.5V linear voltage output. 0 psi outputs 0.5V, 50 psi outputs 2.5V, 100 psi outputs 4.5V.
 
  Output: 0.5V – 4.5V linear voltage output. 0 psi outputs 0.5V, 50 psi outputs 2.5V, 100 psi outputs 4.5V.

Revision as of 10:35, 10 September 2016

WIP.gif

It is not too difficult to connect an analog sensor to the ESP, but there are a number of issues to be addressed.

- Some on board ADCs have a range from 0 ~ 1 volt, others from 0 ~ 3.3 volt.
- The on board ADC has a 10 bit accuracy. This means that a full scale 1 volt (or 3.3 volt) read as 1023.
- In spite of the high accuracy of the ADC, it operates in a very noisy environment. Don't expect high precision readings.
- There are many more considerations. Just take a few minutes to read this posting as an example. [1]


If you want to measure pressure of liquids like oil or water, you could buy one of the pressure sensors on the internet, like this one:

PSI100.jpg PSI100 conn.jpg

PSI.png

Specifications:

Input: 0-100 psi.
Output: 0.5V – 4.5V linear voltage output. 0 psi outputs 0.5V, 50 psi outputs 2.5V, 100 psi outputs 4.5V.
Works for oil, fuel, water or air pressure. Can be used in oil tank, gas tank, etc.
Accuracy: within 1.5% of reading (full scale).
Current draw: less than 4 mA.
Burst (over or max pressure) pressure: minimum 200 psi.
Thread: 1/8”-27 NPT. (see our fitting set for other thread size below).
Wiring connector: water sealed quick disconnect.  Mating connector and wire harness (pigtail) is included.
Wiring: Red for +5V.  Black for ground.  Blue for signal output.
Our material is using top of line 316 stainless steel (not 304) and high temperature auto-graded plastic.
This is a high quality pressure sender, with ceramic pressure chip sensor inside.

The advantages: It is very easy to install, has an analog output and a linear conversion. There are however a number of challenges:

1 If you want to measure pressure in Bar, how is it converted from PSI
  With one of the many freely available converters on the internet, you can easily discover that 1 Bar (100.000 Pascal)    equals to 14,5037737796859 PSI (pound per square inch). This sensor ranges from 0 to 6,89475729 Bar.
2 How can voltages higher than 1.0 or 3.3 volts be measured with the on-board ADC
  If the output impedance of the sensor is low enough, you can use a simple resistor network to create a voltage divider from let's say 5 volt to 3,3 volt. If the impedance is high, the output voltage collapses when the output is loaded with a simple resistor network. In these cases a DC amplifier (transistor, FET or Op-Amp) is required.
  Voltage-divider.gif
In our example we needed a divider from 5 to 3.3 volt, so it needs to have a 3.3:5 ratio 3.3/5=0.66.
After doing some maths, you can prove that in this case R1=0.34R2/0.66.
With the widely available E12 series (10%), you can use 33k for R2 and 10k and 6k8 in series for R1. This gives 1,2 % accuracy and a 10% precision. With resistors from the E96 series (1%), you could use 33k2 for R2 and 16k9 and 205 in series for R1. This gives 0,0099% accuracy at 1% precision.
3 How can you make sensible readings with ESPEasy
  It takes some physics and math to answer this question and some calculations have to be made, but fortunateley ESPEasy allows for that.