스마트팜

#2-8 eTape Liquid Level Sensor 액체 수위 레벨 센서

ZEROWIN.TECH 2022. 3. 23. 15:33
728x90

eTape 액체 수위 레벨 센서

 

   
datasheet https://cdn-shop.adafruit.com/datasheets/eTapeApp.pdf
 

아두이노 연결

   
 

참고 소스++0

............................***********코드

https://www.parallax.com/download/?search=liquid 

소스코드

 



int eTape = 0;

#define MAX_NUM 100
int backupArray[MAX_NUM] = { 0, };


void setup()
{
  Serial.begin(9600); 
}



int index = 0;
int timeout = 0;
void loop()
{
  eTape = analogRead(A0);  //Change Analog pin used here

  backupArray[index] = eTape;
  if(timeout < MAX_NUM) timeout += 1;
  index += 1; if(MAX_NUM < index) index = 0;
  double total = 0;
  for(int i = 0; i < MAX_NUM; i++) {
    total += backupArray[i];
  }
  
  if(MAX_NUM <= timeout) total /= MAX_NUM;
  else total = 0;
  
//  Serial.print("eTape voltage = ");
  Serial.print(eTape, DEC); Serial.print(',');
  Serial.println(total);
  delay(100);
}

그래프


파랑 : 실제값,  빨강 : 평균값  
 

동영상 테스트

 

 

'스마트팜' 카테고리의 다른 글

#1.1.1-4 강우량센서  (0) 2022.03.25
경남도원 #51-1 네트워크 설정 & 전체 구성  (0) 2022.03.24
#11-1 CNR-L580W LTE MODEM  (0) 2022.03.23
수위센서 - 전류 체크 (0 ~ 20ma)  (0) 2022.03.07
토양센서 & CO2센서  (0) 2022.03.04