Вы находитесь на странице: 1из 6

7/27/2017 Vinduino water pressure meter - Van der Lee Vineyard

Van der Lee Vineyard (/)

Home (/) Pictures (/pictures.html) Vineyard Blog (/vineyard-blog.html) Contact (/contact.html)

Vinduino water pressure meter Author


(http://vanderleevineyard.com/vineyard-blog/vinduino-water- Reinier van der Lee,
pressure-meter) weekend winegrower

3/7/2015 23 Comments (http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter#comments)


Archives
Measuring water pressure in agricultural
July 2017 (/vineyard-
irrigation systems is standard practice. One
blog/archives/07-2017)
application is checking for pressure drop
June 2017 (/vineyard-
when irrigation valves are opened, and thus
blog/archives/06-2017)
give feedback that valves work correctly.
May 2017 (/vineyard-
Pressure difference can also be used to
blog/archives/05-2017)
measure the amount of water flowing, and
April 2017 (/vineyard-
help tune for even distribution of irrigation
blog/archives/04-2017)
water.
February 2017 (/vineyard-
blog/archives/02-2017)
Here's how to make a digital water pressure
December 2016 (/vineyard-
meter, based on the Arduino Pro Mini micro
blog/archives/12-2016)
controller board, and the Vinduino PCB.
October 2016 (/vineyard-
The used pressure sensor is a $20 device,
blog/archives/10-2016)
available on-
September 2016 (/vineyard-
line (http://amzn.com/B00RCPDCQU).
blog/archives/09-2016)
It has a stainless steel housing and comes
August 2016 (/vineyard-
complete with a watertight connection cable. There are several ranges available. We purchased the 200 PSI
blog/archives/08-2016)
version, the same range as the analog meters installed in our vineyard.
July 2016 (/vineyard-
blog/archives/07-2016)
This sensor gives an output voltage between 0.5V and 4.5V that scales linearly with the measured pressure, 50 psi
June 2016 (/vineyard-
per volt.
blog/archives/06-2016)
Hooking the sensor up to the Arduino board is easy. Only 3 wires are required: 5V supply (connect to Arduino Vcc
April 2016 (/vineyard-
pin), ground, and a sensor_out signal (connect to Arduino A0 analog in pin).
blog/archives/04-2016)
March 2016 (/vineyard-
Here is example code to test the pressure sensor:
blog/archives/03-2016)
October 2015 (/vineyard-
// "Vinduino" portable PSI sensor code V1.00
blog/archives/10-2015)
// Date March 7, 2015
August 2015 (/vineyard-
// Reinier van der Lee
blog/archives/08-2015)
// www.vanderleevineyard.com
June 2015 (/vineyard-
blog/archives/06-2015)
// include the library code only for LCD display version
May 2015 (/vineyard-
#include <LiquidCrystal.h>
blog/archives/05-2015)
April 2015 (/vineyard-
// initialize the library with the numbers of the interface pins
blog/archives/04-2015)
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
March 2015 (/vineyard-
blog/archives/03-2015)
void setup() {
January 2015 (/vineyard-
// initialize serial communications at 9600 bps:
blog/archives/01-2015)
Serial.begin(9600);
September 2014 (/vineyard-
blog/archives/09-2014)
// set up the LCD's number of columns and rows:
August 2014 (/vineyard-
lcd.begin(8, 2);
blog/archives/08-2014)
lcd.print ("Pressure");

http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter 1/6
7/27/2017 Vinduino water pressure meter - Van der Lee Vineyard

} July 2014 (/vineyard-


blog/archives/07-2014)
void loop() { May 2014 (/vineyard-
blog/archives/05-2014)
float sensorVoltage = analogRead(0); // read the sensor voltage March 2014 (/vineyard-
int psi = ((sensorVoltage-95)/204)*50; blog/archives/03-2014)
lcd.setCursor (0,1); February 2014 (/vineyard-
lcd.print (psi); blog/archives/02-2014)
lcd.print (" PSI"); January 2014 (/vineyard-
Serial.println (psi); blog/archives/01-2014)
December 2013 (/vineyard-
delay (1000); blog/archives/12-2013)
} September 2013 (/vineyard-
blog/archives/09-2013)
August 2013 (/vineyard-
blog/archives/08-2013)
Like 4 Tweet
June 2013 (/vineyard-
23 Comments (http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter#comments) blog/archives/06-2013)
March 2013 (/vineyard-
blog/archives/03-2013)
February 2013 (/vineyard-
Stathis Votsis (http://www.internetnow.gr) 8/31/2015 07:52:29 am
blog/archives/02-2013)
January 2013 (/vineyard-
Hello, blog/archives/01-2013)
Can you tell me where to found this sensor(200 psi)? December 2012 (/vineyard-
blog/archives/12-2012)
Reply
November 2012 (/vineyard-
blog/archives/11-2012)
October 2012 (/vineyard-
Reinier van der Lee 8/31/2015 11:59:35 am
blog/archives/10-2012)
September 2012 (/vineyard-
You can find the sensor at Amazon and Ebay. blog/archives/09-2012)
August 2012 (/vineyard-
Reply
blog/archives/08-2012)
July 2012 (/vineyard-
blog/archives/07-2012)
Mark 10/18/2015 03:09:03 am
June 2012 (/vineyard-
blog/archives/06-2012)
Can you post the part number of the sensor. There are a lot on ebay and a part number would really help. May 2012 (/vineyard-
Thanks blog/archives/05-2012)
April 2012 (/vineyard-
Reply
blog/archives/04-2012)
February 2012 (/vineyard-
Reinier van der Lee 10/18/2015 08:30:15 am blog/archives/02-2012)
December 2011 (/vineyard-
blog/archives/12-2011)
Mark, try following link for the pressure transducer: http://amzn.com/B00RCPDCQU November 2011 (/vineyard-
Reply
blog/archives/11-2011)
October 2011 (/vineyard-
blog/archives/10-2011)
bilsk 10/19/2015 06:59:08 am September 2011 (/vineyard-
blog/archives/09-2011)
August 2011 (/vineyard-
awesome, just what i needed !
blog/archives/08-2011)
July 2011 (/vineyard-
i might be doing something wrong here though, but i used your code stripped the LCD parts out, but the rest is
blog/archives/07-2011)
100% with a 1.2 Mpa sensor, my value is running between 125-128 .. shouldn't this be nearly constant ? (your
June 2011 (/vineyard-
output says <0>) I'm using a spark core btw
blog/archives/06-2011)
May 2011 (/vineyard-
http://www.aliexpress.com/item/DC-5V-G1-4-0-1-2-MPa-0-150PSI-Pressure-Transmitter-Water-Gas-Oil- blog/archives/05-2011)
Pressure/32222357057.html? April 2011 (/vineyard-
spm=2114.01020208.3.9.E1b6Gp&ws_ab_test=searchweb201556_9,searchweb201527_1_71_72_73_74_75, blog/archives/04-2011)
searchweb201560_3 March 2011 (/vineyard-
blog/archives/03-2011)
Reply
February 2011 (/vineyard-
blog/archives/02-2011)

Reinier van der Lee 10/19/2015 11:49:43 am


Categories
The sensor output scales linearly between 0.5V (0 PSI) and 4.5V (200PSI). Supply voltage needed is All (/vineyard-blog/category/all)
5V. Check the voltages with a multimeter, I found for my sensor that it was slightly different (higher) Vinduino (/vineyard-
than 0.5V out at 0 PSI. blog/category/vinduino)

http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter 2/6
7/27/2017 Vinduino water pressure meter - Van der Lee Vineyard
The analog input of the Arduino ADC reads between 0 (0V) and 1023 (5V). At 0 PSI (0.5V) your
RSS Feed (/1/feed)
Analog in should read 1023/5V*0.5V= 102. If the readout is not stable, check if there is noise on the
supply voltage.

Reply

CharlieMac 10/27/2015 03:09:25 pm

Bilsk - how did you interface the 5v of the sensor to the Spark Core? I'm trying to do the same thing to
a Spark Photon, but at 3.3v I need to convert.

Reply

chay 11/28/2015 03:37:00 am

Hello! I see there are many different options for this product in terms of max pressure. Could you modify this
code for a 5PSI (max) version? could you give us an example code? thank you

Reply

Carlos Felipe 1/29/2016 09:27:05 pm

Hello. Very interesting your project, it was made as the connections of the components?
Did you use Arduino?
Thank you!

Reply

Lazaros (http://Www.macedonianwinery.com) 3/14/2016 12:34:57 am

Hi, can you please upload the wire scheme too, the code as well... Thanks
Lazaros

Reply

Reinier van der Lee 3/14/2016 09:44:34 am

Schematics and code: https://github.com/ReiniervdL/Vinduino


Printed circuit board: https://oshpark.com/shared_projects/QWzdU5S6

Reply

lazaros (http://www.macedonianwinery.com) 3/14/2016 09:53:37 am

Are you sure about that equation

int psi = ((sensorVoltage-95)/204)*50;

in case of a 4 volt voltage then the calculation makes 22.3 ..

i would expect something as

int psi = ((sensorVoltage-0.5)/204)*50;

what do you think?

Reply

widya pratomo (http://pdambatang.co.id) 6/1/2016 06:01:45 pm

sensorVoltage is variable for analog read, pal... it's between 0-1024...

Reply

Jose 5/3/2016 09:12:18 am

http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter 3/6
7/27/2017 Vinduino water pressure meter - Van der Lee Vineyard
Hello Friend. I am making an irrigation project and need to know the pressure of the pipe at all times. How
could connect that sensor to GPIO of a raspberry pi and obtain data through python?

A greeting.

Reply

bilsk 5/10/2016 04:19:59 pm

i started with spark, since i was not aware it required 5V, i moved to a proton with better results, it's running at
4.7V of the vin pin.

right now its running variable still, i'll need to make the switch to arduino, or figure out another stable 5V

it's running 611-617 on raw read from sensorVoltage


and 126/127 on (int psi = ((sensorVoltage-95)/204)*50;)

Reply

Jan Breinbauer 6/14/2016 04:02:38 pm

Hi Reinier,

can you explain me where did you get "95", "204"? I believe in your code. But it's just for me understanding.

Thanks

Reply

Reinier (http://www.vanderleevineyard.com) 7/9/2016 09:36:50 am

These type of water pressure sensors are specified for a linear output between 0.5V and 4.5V, at 5V
supply voltage.
In this case, 0.5V is equal to 0 PSI, and 4.5V= 200 PSI.
So the 10 bit ADC range (when 5V = 1023) is 102 - 920

The equation to convert to PSI is: (ADC reading - 102)/4.093

That is the theory. In practice the cheap pressure sensors are not quite up to spec, so the numbers
need to be adjusted a bit to get a good reading.

Wiring is simple: +5V, ground, and a signal wire connected to one of the Arduino analog inputs.

Code on github: https://github.com/ReiniervdL/Vinduino/blob/master/water_pressure_meter.ino

Reply

a4nweb (http://a4n.in) 6/16/2016 12:44:50 am

can you please upload the wire scheme too, the code as well.

Reply

Tim 8/24/2016 02:13:18 pm

Hi Reinier,

I tried a pressure sensor similar to yours and found it didn't work out of the box. Very erratic readings from from
hour to hour with no changes in pressure. Have you found yours to work reliably ? If so can you verify the seller
of it ? I tried a search and found one - Eyourlife Universal 200PSI Pressure Transducer but many of the reviews
reflect a similar erratic behavior and high failure rate.

Thanks !
Tim

Reply

Reinier van der Lee (http://www.vanderleevineyard.com) 8/24/2016 08:03:07 pm

http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter 4/6
7/27/2017 Vinduino water pressure meter - Van der Lee Vineyard
Tim, I bought this pressure sensor at Amazon. Link to this product is in one of my previous replies
under this post. Had no erratic readings, except that the zero voltage at 0 PSI was off vs spec, but that
was easy to compensate in the Arduino code. Stating the obvious: buy from a reliable source that give
some warranty.

Reply

Tim 8/25/2016 01:42:32 am

Got it. Thanks for the quick reply !

PeterO 10/12/2016 05:38:16 am

Hi Reinier,

Question:
On your picture you have the open sensor reading 0 psi.
But here in the Netherlands the air pressure is currently around 1021 mBar.
When I calculate that back it should be reading around 14.8 psi
Am I wrong or...?

Reply

Mike 4/30/2017 09:58:12 pm

Using the same sensor I found that it rusted quite quickly (I believe this to be electrolysis at work)... I read about
this being an issue with cheap soil moisture sensors if you run constantly. I assume you're only checking
pressure following a valve open/close event? Thanks!

Reply

Your comment will be posted after it is approved.

Leave a Reply.
Nombre (requerido)

Correo electrónico (No publicado)

Sitio web

Comentarios

Deseo recibir notificaciones sobre nuevos comentarios en esta


entrada por correo electrónico.

Enviar

http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter 5/6
7/27/2017 Vinduino water pressure meter - Van der Lee Vineyard

Facebook for Develop…


5,360,301 likes

Like Page Sign Up

Be the first of your friends to like this

Facebook for
Developers
last Thursday

Join Facebook product experts for a


live video 'Ask Me Anything' session
to learn how you can grow your
business and monetize your mobile
app with ads using Facebook
Audience Network.
In this 45-minute live session, you’ll
hear about product features, best
practices in ads monetization and
more. The live video will be streamed
on the FbStart Facebook page on
July 31 at 10:30AM PST. Please use
the comments section below to

http://vanderleevineyard.com/vineyard-blog/vinduino-water-pressure-meter 6/6

Вам также может понравиться