Arduino & Rain Sensor Experiment
The experiment is for switching an acoustic sounder as a rain alarm after a predetermine time. It may, however, be tinkered for a number of other applications. Needless to say, this is a simple experiment for Arduino beginners, but trying an experiment is even more pleasant when the result is something unique.
Step 1: Arduino & Rain Sensor Experiment
The experiment is for switching an acoustic sounder as a rain alarm after a predetermine time. It may, however, be tinkered for a number of other applications. Needless to say, this is a simple experiment for Arduino beginners, but trying an experiment is even more pleasant when the result is something unique.
The goal is now to use a pre-wired rain sensor module with an Arduino. Specification of the LM393 chip- based rain sensor module is given below:
- Working Voltage: 5V
- Indicators: Power indicator & Output indicator LEDs
- User Control: Onboard sensitivity adjustment potentiometer
- Output: Digital (DO) & Analog (AO)
Here, the analog output (AO) of the rain sensor module is linked to one analog input (A0) of the Arduino, so that the microcontroller can read an analog voltage between 0 and 5 volts to process a number between 0 and 1023, where 0 representing 0 volt, and 1023 representing 5 volt.
If the rain sensor plate of the rain sensor module is in dry state, analog output (AO) from the module is 5V. During rain, the sensor plate elements are bridged by the rain water and hence this analog output gradually changes from 5V to 0V, based on the moisture level between the sensor pads. By this way, the sensor reports the absence and presence of the rain in an analog way, help us to determine whether the rain is light or strong by analyzing the outputted analog signal. The approximation is handled by a simple Arduino sketch. An additional function is delaying of the alert generation; Arduino raises an alert only when raining with a certain threshold is detected, within a pre-defined time interval. This extra feature helps in reducing false alarm counts to some extent. In the given sketch, rain threshold is 300, and the time delay is 30 sec.
When it’s raining (and Arduino detects it) D8 output of the Arduino board goes to “High” level. This D8 output can be used to energise an acoustic sounder (piezo buzzer) or an electric switch ( electromagnetic relay). Refer the hook up diagram to proceed with your experiment.
As usual, power up the Arduino from an external 9V DC power supply unit. The buzzer/relay driver circuit may be used for voltages in the range 5-12V. However the Vcc must be adapted to the exact voltage and current demand of the connected buzzer/relay.
- Comments(1)
- Likes(1)