# 1. Raindrop Sensor
## 1.1 Product Introduction
Hiwonder raindrop sensor is used for monitoring the amount of rainfall and can covert the monitored result into analogue signal and output . When in use, 5V GND terminal will input 5V voltage and ADC terminal will output voltage from 0 to 5 V. The greater the amount of rainfall, the greater the output voltage of ADC terminal.
It is also used to monitor weather condition. The surface of sensor is processed with immersion gold technology, which can improve the ability to prevent corrosion in the soil and prolong its life.
## 1.2 Specification Instruction
### 1.2.1 Specification
| Working Voltage | DC 5V |
| Working Current | 1mA |
AD value AD converter digit is 10-digit and reference voltage is 5V |
0~400, no rain environment |
| 400~1000:rainy environment | |
| Port Type | 5264-4AW |
| Size | 62mm×48mm |
| Easy to install, compatible with Lego series | |
Please note that if not using Arduino expansion board, you need to connect sensor to Arduino demo board through Dupont line as following picture.
### 1.3.3 Project Process
Step 1: Download and install Arduino IDE on your computer.
Step 2: Connect Arduino expansion board to the controller. Then, connect raindrop sensor to corresponding port on expansion board with 4PIN wire as the picture shown above.
Step 3: Connect Arduino UNO demo board to computer with USB cable. After opening Arduino IDE, please paste "**[1.3.5 Sample code](#anchor_1_3_5)**" in "**File/New**".
Step 4: Select suitable demo board and port, then compile and upload the program.
Step 5: After the code is uploaded successfully, please open the serial monitor to set the baud rate as 9600.
### 1.3.4 Project Outcome
When the sensor detects no raindrop, the serial monitor will display 0. When we sprinkle water on sensing area to simulate rain, the data displayed on the monitor will increase as picture shown below.
### 1.3.5 Example Code
```
/********Raindrop Sensor Testing Program*******
* Arduino Type:Arduino UNO
**************************/
#define Raindrop A2 //Connect raindrop sensor to A2 port on the controller
uint16_t humidity;
void setup()
{
Serial.begin(9600); //Mainly used to print data during debugging, this program is not used.
pinMode(Raindrop, INPUT);
}
void loop()
{
humidity = analogRead(Raindrop); //0-1023
Serial.println(humidity);
}
```
## 1.4 Q&A
Q1:Why device manager failed to display data after uploading?
A : Please open the serial monitor to set the baud rate as 9600. The setting is consistent with that of the code.
Q2:Why light sensor failed to display after uploading?
A: Please check the wiring. Signal terminal of the sensor need to be connected to A2 or A3 analog port of the controller. The setting is consistent with that of the code.