전자공작/Sensor
[Sensor#3] 수위계 TD8600
절망로정말적
2022. 8. 29. 23:48
1. TD8600

수압으로 변하는 저항값으로 수위를 측정하는 방식.
사진에서는 정중앙에 매달려 있는 것이 센서인데, 수직으로 세우기 위해서 3D프린터로 다리를 붙였더니 센서가 잘 안보이네..😥
2. 동작 테스트


센서를 대기압상태에서 측정했을때 0.967V
(전압측정을 위해서 V+쪽에 239.5Ω 저항을 장착. 아래 참고




수위가 약50cm 일때 측정전압은 1.160V
측정값으로 계산을 해보면
수위가 0m일때, 0.967V = 239.5Ω * 4.038mA
수위가 0.5m일때, 1.160V = 239.5Ω * 4.843mA
센서의 측정범위는 0~10m이고, 4~20mA 출력이므로
이론값으로 수위가 0.5m면 0.8mA가 증가한다.
실제 측정값은 4.843 - 4.038 = 0.805mA 였으므로
수위를 대충 측정했음에도 이론값인 0.8mA과 근사했음을 알 수 있다.
센서 성능 확실하구만👍
3. 아두이노에서 측정
int val = 0;
int analogPin = A1;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
val = analogRead(analogPin);
Serial.print("data:");
Serial.println(val);
delay(1000);
}

수위계에 연결하지 않았을때 A1핀 값은 0


아두이노 출력값을 수위로 바꾸면,
(초기값은 194, A1핀 값 1당 0.00496V, 1V당 수위2.5m 로 설정)
int val = 0;
int analogPin = A1;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
val = analogRead(analogPin);
float a = ((val - 195) * 0.00496) * 2.5; // 194は初期値、val値1当たり0.00496V、1V当たり2.5m
Serial.println(a);
delay(1000);
}

수위가 47~50cm일때, 아두이노 출력 값은 46~47cm
1~2cm정도의 오차는 있지만 대략적인 수위측정 성공👏