솔리드 스테이트 센서로서 액체의 높이에 따라 저항값이 변하는 특성을 이용합니다.
센서를 통에 세로로 담궈 액체가 얼마나 찼는지 확인할 수 있습니다.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | // 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); } | cs |
상품이 장바구니에 담겼습니다.
바로 확인하시겠습니까?
상품이 찜 리스트에 담겼습니다.
바로 확인하시겠습니까?
Copyright © Mechasolution. All rights reserved.









