hexthat
Well-Known Member
I made a VPD sensor thing with Adafruit products. This code is basic version that prints VPD and "Saturation vapour pressure". I would like to use this in a study to see if VPD needs adjusting at different altitudes.
I'm working on a correlation between VPD and SVP into one value? id call it "hexthat's pressure"
sources:
I'm working on a correlation between VPD and SVP into one value? id call it "hexthat's pressure"
Python:
import board
import busio
import math
import adafruit_bmp280
import adafruit_si7021
import time
i2c = busio.I2C(board.SCL, board.SDA)
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
si7021 = adafruit_si7021.SI7021(i2c)
while True:
rh = si7021.relative_humidity
temp = si7021.temperature
hPa = bmp280.pressure
# Saturation Vapor Pressure *Arden Buck equation(1996)*
if temp > 0:
SP = 0.61121 * math.exp((18.678 - (temp / 234.5)) * (temp / (257.14 + temp)))
else:
SP = 0.61115 * math.exp((23.036 - temp / 333.7) * (temp / (279.82 + temp)))
if rh > 20 and rh < 80:
# actual partial pressure of water vapor in air
ea = rh / 100 * SP
# Vapour-pressure deficit
VPD = SP - ea
else:
print("Humidity out of range 80 <> 20, RH:", rh)
VPD = False
# pressure function
pf = 1.0016 + 3.15 * (math.pow(10, -6) * hPa) - (0.074 * math.pow(hPa, -1))
# saturation vapour pressure of moist air
SVP = pf * SP
print('VPD :', VPD, 'SVP :', SVP)
time.sleep(6)
Online calculator: Saturation vapor pressure
This online calculator computes saturation vapor pressure for a given temperature and atmospheric (barometric) pressure
planetcalc.com
Arden Buck equation - Wikipedia
en.wikipedia.org
BMP280 SI7021 Atmospheric Pressure Sensor GY-21P BME680 Temperature Humidity | eBay
Find many great new & used options and get the best deals for BMP280 SI7021 Atmospheric Pressure Sensor GY-21P BME680 Temperature Humidity at the best online prices at eBay! Free shipping for many products!
www.ebay.com