HS-S09PB Raindrop Sensor

HS-S09PB Raindrop Sensor

1. Introduction

A raindrop sensor is a sensing device mainly used to detect whether it is raining and the size of the rainfall, and is widely used in automatic windshield wiper systems, smart lighting systems, and smart skylight systems, etc.The sensor uses high-quality FR-04 double material, with a large area of 5.0 * 4.0 centimeters, and nickel-plated surface processing.It has antioxidant, conductive properties, and superior durability; sensitivity is adjusted with a potentiometer; operating voltage is from 3.3 V to 5 V.Output in the form of digital values (0 and 1) and analog AO voltage output, using an LM393 dual voltage comparator, when the sensor is connected to a 5V power supply and there are no droplets on the sensing board, the DO output is at a high level.When the droplet falls, the DO output is low level.If we wipe away the droplets, the output will return a high-level state.AO analog output can be connected to the microcontroller's AD interface to detect the size of the raindrop above.DO digital output can also be connected to a microcontroller to detect if it is raining.

2. Schematic

Rainwater-Soil Moisture Sensor Module-HS-S09P SchematicClick to view

Module Parameters

Pin Name

description

G

GND (Negative Power Input)

V

VCC (Positive Power Input)

S

Digital Signal Pin

  • Power Supply Voltage: 3.3V / 5V

  • Connection Method: PH2.0 2/3P

  • Installation Method: Double Screw Fixed

4, Circuit Board Size

5 of Arduino IDE example program

Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Arduino IDE Library Download and Import Tutorial:
Click to view

Example program (UNO development board):

void setup(){
  Serial.begin(9600);
  pinMode(3, INPUT);
  pinMode(6, OUTPUT);
  pinMode(3, INPUT);
}

void loop(){
  //雨滴检测模块接D3,有源蜂鸣器接开发板D6
  //

  //轻轻调节雨滴A模块背部电位器,有雨水的情况下,A模块指示蓝灯亮起;
  //没有雨水,A模块指示蓝灯熄灭。
  if (digitalRead(3) == 1) {
    //没有雨水,输出高电平(1),模块信号指示蓝灯熄灭,蜂鸣器不响。
    digitalWrite(6,LOW);
    Serial.println(String("没有雨水:") + String(digitalRead(3)));

  } else if (digitalRead(3) == 0) {
    //有雨水,输出低电平(0),模块信号指示蓝灯亮起,蜂鸣器响起。
    digitalWrite(6,HIGH);
    Serial.println(String("检测到雨水:") + String(digitalRead(3)));
  }

}

6, ESP32 Python Example (for Mixly IDE/Misashi)

Choose the development board Python ESP32 [ESP32 Generic(4MB)] and upload in code mode

Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial for Mixly IDE ESP32 library:
Click to view

Example program (ESP32-Python):

待更新...

7, Mixly example program (graphical language)

Example program (UNO development board):Click to download
Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial of Mixly IDE Arduino library:Click to view

Example Program (ESP32 Development Board):Click to download
Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial for Mixly IDE ESP32 library:
Click to view

Image pending update...

8. Setting up the Test Environment

Arduino UNO Test Environment Setup

Prepare Components:

  • UNO-R3 Development Board *1

  • UNO-R3 P Expansion Board *1

  • USB TYPE-C DATA CABLE *1

  • Droplet Sensor (HS-S09B) *1

  • Drip sensor (HS-S09P) *1

  • Active buzzer (HS-F07P) *1

  • PH2.0 2-pole dual-ended terminal line * 1

  • PH2.0 3p dual head terminal line * 2 or PH2.0 3p terminal to DuPont wire * 2

Circuit wiring diagram:

ESP32 Test Environment Setup

Prepare Components:Pending update...

Circuit wiring diagram:Pending update...

9, Video tutorial

Video tutorial:Click to view

10, Test results

Arduino UNO test results:

After the device is connected to the wire, burn the above program to the Arduino UNO development board, open the serial monitor, drop water droplets on the raindrop sensor to simulate rain, and you can see the data change.

ESP32 Test Results:

Pending update...