熱門文章

2017年8月3日 星期四

肌膚檢測DIY-TEWL(組裝)

實做經皮水分散失測定儀

下面這台儀器就是自製的經皮水分散失測定儀啦!
LCD顯示面板、PCF 8745Arduino nano電路板、麵包板、中空圓柱探頭、溫溼度感測器和許多條跳線組裝而成。


LCD顯示面板:顯示測量出的數據
PCF 8574:擴充輸入/輸出腳位
Arduino nano電路板:為開放原始碼的單晶片微電腦,用USB和電腦連接,可以把需要的程式碼寫入其中
麵包板:可根據需求隨意插入或拔出,免去了焊接,節省組裝電路的時間
中空圓柱探頭:由兩個溫溼度感測器組成,量測皮膚表面的溫度和濕度
溫溼度感測器:量測空氣中的溫度和濕度
跳線:連接電路
以上就是組裝元件的各自功能




程式碼如下

// 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
#include 
LiquidCrystal_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:="">

1 則留言:

  1. 很好的產品
    對此儀器很感興趣
    我歐洲客戶有興趣
    是否可以外銷歐洲

    回覆刪除