// Example testing sketch for various DHT humidity/temperature sensors // Written by ladyada, public domain /*TEWL 公式 dm/dt =- -D * A * (dP/dX) Two sensor 之間的蒸氣壓差 由 Luby及Megan 導出 TEWL = -((pu*h) - (pd*h2));// 32*C 假設 Pu=Pd =35.663 mmmHG TEWL = 0.0877 * TWEL ; pu,pd 上下蒸氣壓,h,h2 上下相對濕度 TWEL = TEWL/0.16 ; // Xu-Xd 0.16m Sensor距離 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx TEWL = 35.63 * (h-h2) ;概略算法 32*C 假設 Pu=Pd =35.663 mmmHG TEWL = 0.0877 * TWEL ; TWEL = TWEL/0.16 ; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx U:h DHTPIN 2 上藍 :RHu// what digital pin we're connected to L:h2 DHTPIN2 3 下 綠 :RHd R;h3 DHTPIN3 4 室溫黃 */ #include "DHT.h" #define DHTPIN 2 // what digital pin we're connected to #define DHTPIN2 3 #define DHTPIN3 4 #includeLiquidCrystal_I2C lcd(0x3F,20,4); // Uncomment whatever type you're using! //#define DHTTYPE DHT11 // DHT 11 #define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321 //#define DHTTYPE DHT21 // DHT 21 (AM2301) // Connect pin 1 (on the left) of the sensor to +5V // NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1 // to 3.3V instead of 5V! // Connect pin 2 of the sensor to whatever your DHTPIN is // Connect pin 4 (on the right) of the sensor to GROUND // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor // Initialize DHT sensor. // Note that older versions of this library took an optional third parameter to // tweak the timings for faster processors. This parameter is no longer needed // as the current DHT reading algorithm adjusts itself to work on faster procs. DHT dht(DHTPIN, DHTTYPE); DHT dht2(DHTPIN2, DHTTYPE); DHT dht3(DHTPIN3, DHTTYPE); float pu = 0; float pd = 0; float TEWL =0 ; void setup() { lcd.init(); // Print a message to the LCD. lcd.backlight(); lcd.setCursor(3,0); lcd.print("Hello, world!"); lcd.setCursor(2,1); lcd.print("ToppyBio.Com. Hi"); delay (1200); lcd.clear(); lcd.setCursor(0, 0); lcd.print("HU:"); lcd.setCursor(19, 0); lcd.print("%"); lcd.setCursor(0, 1); lcd.print("TU:"); lcd.setCursor(18, 1); lcd.print("*C"); lcd.setCursor(0, 2); lcd.print("HL:"); lcd.setCursor(19, 0); lcd.print("%"); lcd.setCursor(0, 3); lcd.print("TL:"); lcd.setCursor(18, 1); lcd.print("*C"); lcd.setCursor(9, 0); lcd.print("HR:"); lcd.setCursor(19, 0); lcd.print("%"); lcd.setCursor(9, 1); lcd.print("TR:"); lcd.setCursor(18, 1); lcd.print("*C"); lcd.setCursor(9, 2); lcd.print("TEWL: "); //lcd.setCursor(19, 2); //lcd.print("%"); //lcd.setCursor(0, 3); //lcd.print("TU: "); lcd.setCursor(14, 2); lcd.print("g/h/m2"); Serial.begin(9600); //Serial.println("DHTxx test!"); // U:h DHTPIN 2 上藍 // what digital pin we're connected to // L:h2 DHTPIN2 3 下 綠 // R;h3 DHTPIN3 4 室溫黃 Serial.println("LABEL,TIME,HumiU,HumiR,HumiL,TempU,TempR,TempL,TEWL"); dht.begin(); dht2.begin(); dht3.begin(); } void loop() { // Wait a few seconds between measurements. delay(3000); // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) float h = dht.readHumidity(); float h2 = dht2.readHumidity(); float h3 = dht3.readHumidity(); // Read temperature as Celsius (the default) float t = dht.readTemperature(); float t2 = dht2.readTemperature(); float t3 = dht3.readTemperature(); // Read temperature as Fahrenheit (isFahrenheit = true) float f = dht.readTemperature(true); float f2 = dht2.readTemperature(true); float f3 = dht3.readTemperature(true); // 溫度-飽和蒸汽壓關西 pu = 19.827; if (t<22 -="" .30="" 0="" 1="" 2="" 3="" again="" ailed="" and="" any="" celsius="" check="" compute="" default="" dht="" early="" eat="" else="" emperature:="" exit="" f="" fahrenheit="" failed="" false="" float="" from="" h2="" h3="" h="" heat="" hic2="dht2.computeHeatIndex(t2," hic3="dht3.computeHeatIndex(t3," hic="" hif2="dht2.computeHeatIndex(f2," hif3="dht.computeHeatIndex(f3," hif="" if="" in="" index:="" index="" isfahreheit="false)" isnan="" lcd.print="" lcd.setcursor="" pd="" pre="" pu="43.117" read="" reads="" return="" sensor="" serial.print="" serial.println="" t2="" t3="" t="" tewl="TEWL/0.16" the="" to="" try="" umidity:=""> 22>
熱門文章
-
經皮水分散失儀 今天就要來跟大家分享關於這種儀器的小知識, 準備好了嗎?
2017年8月3日 星期四
肌膚檢測DIY-TEWL(組裝)
訂閱:
張貼留言 (Atom)
很好的產品
回覆刪除對此儀器很感興趣
我歐洲客戶有興趣
是否可以外銷歐洲