8 인치 표준 eTape 액체 레벨 센서
(8 inch Standard eTape Liquid Level Sensor)
개요
- 본 제품은 8 인치 표준 eTape 수위 레벨 센서입니다.
- 수위에 따라 가변적으로 변하는 저항값을 가지고 있는 센서입니다.
- 수위가 높을수록 저항은 낮으며, 수위가 낮을수록 높은 저항값을 가집니다.
- 센서는 저항이므로 voltage divider 회로를 구성하여 쉽게 마이크로컨트롤러의 ADC 핀으로 값을 읽을 수 있습니다.
특징
문서
- Connect pin #2 of the sensor to ground, then pin #3 to a 560 ohm resistor. The other side of the 560 ohm resistor to VCC (3.3V or 5V for example) to create a resistor divider. The ADC pin connects to the point between the resistor and sensor.
-
// the value of the 'other' resistor
#define SERIESRESISTOR 560
// What pin to connect the sensor to
#define SENSORPIN A0
void setup(void) {
Serial.begin(9600);
}
void loop(void) {
float reading;
reading = analogRead(SENSORPIN);
Serial.print("Analog reading ");
Serial.println(reading);
// convert the value to resistance
reading = (1023 / reading) - 1;
reading = SERIESRESISTOR / reading;
Serial.print("Sensor resistance ");
Serial.println(reading);
delay(1000);
}