Dust and residue on the sensor pad can act like water. The datasheet implies pure water; reality says clean your sensor with alcohol regularly.
/* Hw-133-v1.0 Rain Sensor Demo Reads digital (rain alert) and analog (water level) values. */const int DIGITAL_PIN = 2; // DO pin const int ANALOG_PIN = A0; // AO pin
void setup() Serial.begin(9600); pinMode(DIGITAL_PIN, INPUT); Serial.println("Hw-133-v1.0 Sensor Ready"); Hw-133-v1.0 Datasheet
void loop() int digitalValue = digitalRead(DIGITAL_PIN); int analogValue = analogRead(ANALOG_PIN);
Serial.print("Digital (DO): "); Serial.print(digitalValue); Serial.print("Dust and residue on the sensor pad can act like water
Interfacing the Hw-133-v1.0 with a microcontroller is straightforward. Below is the most common connection for an Arduino Uno. I2C bus:
Unlike complex ICs, this board is simple. Looking at the 4-pin header, you will find: