熱門文章

顯示具有 TEWL 標籤的文章。 顯示所有文章
顯示具有 TEWL 標籤的文章。 顯示所有文章

2017年10月24日 星期二

電導式濕度測量(組裝2)

保濕度儀器再精進:
原本設計沒有顯示器,直接接筆電,以excel 表示。
此進階板保留excel功能,加上 LCD. Nokia5110.,用起來更直觀,也比目前市售產品的畫面更好看。
附上照片及code




/*****************************************************************************
 * Origin Code :    http://www.instructables.com/id/Nokia-5110-Arduino-Oscilloscope/ 
 * Skin GSR Theory: http://www.theanthillsocial.co.uk/sketch/163
                    http://www.coherence.com/gsr_html_production.htm
 * Part: 300K ohm ,1UF Capacity(no 0.1UF,so use this)
 * Also link " Microsot Excel "
 * 171010 modify
 * Conductance in water :4.76 ,no contace:0.76
****************************************************************************** */
#include <adafruit_gfx.h>
#include <adafruit_pcd8544.h>
#include <spi.h>
#define DISPLAY_WIDTH 84
#define DISPLAY_HEIGHT 48
#define ARDUINO_PRECISION 1023.0
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
int channelAI = A0;      // probe
#define DELAY_POTENTIMETER //disabled it I don't have it connected
#ifdef DELAY_POTENTIMETER
int delayAI = A1;       // delay potentiometer
#endif
float delayVariable = 0;
float scale = 0;
int xCounter = 0;
int yPosition = 0;
int readings[DISPLAY_WIDTH+1];
int counter = 0;
unsigned long drawtime = 0;
unsigned long lastdraw = 0;
int frames = 0;
int a = 0;

void setup(void) 
{
  display.begin();
  display.setContrast(60);// you might have a slightly different display so it might not be the optimal value for you
  display.clearDisplay();
  Serial.begin(9600);
  Serial.println("LABEL,Number,Conductance");
  }

void loop() 
{  
  #ifdef DELAY_POTENTIMETER
  delayVariable = analogRead(delayAI);
  delayVariable = (delayVariable/100);
  #endif
  scale = (float)(DISPLAY_HEIGHT-1)/ARDUINO_PRECISION; 
    //record readings
  for(xCounter = 0; xCounter <= DISPLAY_WIDTH; xCounter++)
  {                                 
    yPosition = analogRead(channelAI);
    readings[xCounter] = (yPosition*scale);
    #ifdef DELAY_POTENTIMETER
    delay (delayVariable);
    #endif
  }
  
  display.clearDisplay();

  //Draw Voltage Ref Lines
  display.drawLine( 10, 0, 10, DISPLAY_HEIGHT-1, BLACK);
  display.drawLine( 5, (DISPLAY_HEIGHT-1)-(.2 *ARDUINO_PRECISION * scale), 10, (DISPLAY_HEIGHT-1)-(.2 *ARDUINO_PRECISION * scale), BLACK);
  display.drawLine( 0, (DISPLAY_HEIGHT-1)-(.4 *ARDUINO_PRECISION * scale), 10, (DISPLAY_HEIGHT-1)-(.4 *ARDUINO_PRECISION * scale), BLACK);
  display.drawLine( 5, (DISPLAY_HEIGHT-1)-(.6 *ARDUINO_PRECISION * scale), 10, (DISPLAY_HEIGHT-1)-(.6 *ARDUINO_PRECISION * scale), BLACK);
  display.drawLine( 0, (DISPLAY_HEIGHT-1)-(.8 *ARDUINO_PRECISION * scale), 10, (DISPLAY_HEIGHT-1)-(.8 *ARDUINO_PRECISION * scale), BLACK);
  //display.drawLine( 5, (DISPLAY_HEIGHT-1)-(.84 *ARDUINO_PRECISION * scale), 10, (DISPLAY_HEIGHT-1)-(.84 *ARDUINO_PRECISION * scale), BLACK);
  
  //Draw Voltage Ref Numbers
  display.setCursor(0,((DISPLAY_HEIGHT-1)-(.2 *ARDUINO_PRECISION * scale))-3);
  display.print((int)(5.0*0.2));
  display.setCursor(0,((DISPLAY_HEIGHT-1)-(.4 *ARDUINO_PRECISION * scale))-3);
  display.print((int)(5.0*0.4));
  display.setCursor(0,((DISPLAY_HEIGHT-1)-(.6 *ARDUINO_PRECISION * scale))-3);
  display.print((int)(5.0*0.6));
  display.setCursor(0,((DISPLAY_HEIGHT-1)-(.8 *ARDUINO_PRECISION * scale))-3);
  display.print((int)(5.0*0.8));
  
  for(xCounter = 0; xCounter <= DISPLAY_WIDTH; xCounter++)
  {
    display.drawPixel(xCounter, (DISPLAY_HEIGHT-1)-readings[xCounter], BLACK);
    if(xCounter>1){
      display.drawLine(xCounter-1, (DISPLAY_HEIGHT-1)-readings[xCounter-1], xCounter, (DISPLAY_HEIGHT-1)-readings[xCounter], BLACK);
    }
  }
  //Draw FPS
  display.setCursor((DISPLAY_WIDTH-1)-11,0);
  display.print(frames);
  //Draw Voltage
  display.setCursor(((DISPLAY_WIDTH-1)/2),0);
  display.print(analogRead(channelAI)/ARDUINO_PRECISION*5.0);
  display.display();
  //Calculate FPS
  drawtime = micros();
  frames=1000000/*a second*//(drawtime-lastdraw);
  lastdraw = drawtime;
  a = a + 1 ;
  Serial.print("DATA");
  Serial.print(",");
  Serial.print("a");
  Serial.print(",");
  Serial.println(analogRead(channelAI)/204.6);//204.6 = ARDUINO_PRECISION*5.0
  //delay(1000);// NO delay() is good,otherwise frmae no work  
}

2017年8月3日 星期四

肌膚檢測DIY-TEWL(組裝)

實做經皮水分散失測定儀

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

肌膚檢測DIY-TEWL(原理)

經皮水分散失儀

今天就要來跟大家分享關於這種儀器的小知識,
準備好了嗎?

2017年8月2日 星期三

肌膚檢測DIY- TEWL(前言)


談到皮膚的保養,最先想到也最重要的大概就是保濕了!
但大家有想過皮膚是怎麼樣不讓水分溜出去的嗎?