In this tutorial, we will see how we can interface a rain sensor with ARIES V3 board. A rain sensor is a device that can be used for rainfall detection.
Components Required
- ARIES v3 Microcontroller
- Rain sensor
- 100 Ohm resistor
- Jumper wires
Rain Sensor
The rain sensor is a resistive dipole that shows less resistance when wet and more resistance when dry. When there is no rain drop on board, it increases the Resistance so we gets high voltage according to V=IR.When rain drop is present, it reduces the resistance because water is a conductor of electricity and presence of water connects nickel lines in parallel so reduces resistance and reduces voltage drop across it.
The rain sensor has two pins. Connect one end of rain sensor to 3.3V of ARIES board. Connect other end of rain sensor to A0 pin of ARIES board through a 100 ohm resistor. Connect other end of the 100 ohm resistor to GND pin of ARIES.
Rain Sensor | ARIES V3 board |
One end | 3.3V |
Other end | A0 |
100 Ohm Resistor | ARIES V3 board |
One end | Rain sensor & A0 |
Other end | GND |
Connection Diagram
Connection Diagram for rain sensor with ARIES v3.0
Now, for powering up the ARIES v3 board via the USB port of a Laptop/Desktop/PC and burning the code into the ARIES v3 board, we have to use a micro USB type C to USB type A cable. The cable should be connected to UART-0 port of the ARIES v3 board, and the Laptop/Desktop/PC should be preinstalled with Arduino IDE and VEGA ARIES boards of latest version.
Procedure
Here we are using Arduino IDE 1.8.19 in Ubuntu OS for testing the code.
Open Arduino IDE
Go to Tools -> Board -> VEGA Processor ARIES Boards -> Select ARIES v3
Go to Tools -> Programmer -> Select VEGA XMODEM
Connect the ARIES v3 board to PC
Go to Tools -> Port -> Select the appropriate port
Open File -> Examples -> Examples for ARIES v3 ->ADC -> Open RainSensor example
Output
Once you’ve completed the code, upload it to your ARIES v3.0 board using the Arduino IDE. Wait until the program is uploaded. After completing the uploading the program will start to execute. Once the code is uploaded you can try putting some water drops on the rain sensor surface and observe the changes happening to the values in serial monitor. Care should be taken to drop water only on the rain sensor surface otherwise it will damage the circuit.
This demo will detect the presence of Rain based on the water that falls on the sensor. If there is no Rain then you can see “No Rain” on the serial monitor. If the water content falling on the sensor is beyond the threshold then it will print as “Moderate Rain” or “Heavy Rain” on the serial monitor.You can adjust the threshold value for rain detection, in the program, based on your requirements.