스마트팜
수위센서 - 전류 체크 (0 ~ 20ma)
ZEROWIN.ART
2022. 3. 7. 22:50
728x90
수위센서
AS-136 센서, 수위, 액체 레벨, 고깊이 수조 |
https://ko.aliexpress.com/item/33004616096.html?gatewayAdapt=glo2kor |
모델: AS-136
색상 분류: 5 m 범위
장식 및 건설 내용: 설치 공학
측정 범위: 0 ~ 5M
전력 공급 전압: 5V
출력 신호: 0 ~ 3V
하중 초과 수용량: 1.5 시간 범위
측정 매체: 물
중간 온도: - 10 - 70 C
적분 물자: 304 스테인리스 포탄, 316L 격막
|
![]() |
![]() |
![]() |
![]() |
![]() |
전류측정
측정 범위 | 4 ~ 20ma |
int curSensor=A0;
int curSensor1=A1;
void setup() {
Serial.begin(9600);
//analogReference(EXTERNAL);
}
void loop() {
// put your main code here, to run repeatedly:
float sensorValue = analogRead(curSensor);
float sensorValue1 = analogRead(curSensor1);
float Result;
Result = ((sensorValue-204.0))/(1024.0-204.0)*150; //204 is offset, 4mAmp is 0
float Result1;
Result1 = ((sensorValue1-204.0))/(1024.0-204.0)*150; //204 is offset, 4mAmp is 0
// Serial.print("Sensor Original:");
// Serial.println(sensorValue);
// Serial.print("Sensor Original_1:");
// Serial.println(sensorValue1);
//
// Serial.print("Input Voltage:");
// Serial.print(sensorValue/1024*5);
// Serial.println(" V");
// Serial.print("Input Voltage_1:");
// Serial.print(sensorValue1/1024*5);
// Serial.println(" V");
// Serial.print("Sensor Output:");
Serial.println(Result-40);
// Serial.println(" A");
//
// Serial.print("Sensor Output_1:");
// Serial.print(Result1);
// Serial.println(" A");
delay(10); // delay in between reads for stability
}
테스트동영상