Making a rain sensor with e-mail notification using Arduino. Installing the rain sensor yourself Where to install the rain sensor

To install a windshield wiper control system, it is not necessary to use the services of a car repair shop; you can do this work yourself. Almost all modern cars have such a function, so the control of the operation of the wipers in different weather occurs automatically. The rain sensor is built into the front glass of any foreign car, so it is impossible to remove it.

However, you can also install a rain sensor on an old domestic car. It is quite easy to make this device, and it is quite suitable for VAZ cars. To work, you need a universal sensor.

The principle of operation of the device

The device operates on the basis of optics, which must be located vertically. Place the universal sensor with inside windshield. The installation site must be in the coverage area of ​​the brushes, and cracks, chips and other defects are not allowed on the transparent surface.

Using infrared radiation, the sensor scans the condition of the outer surface of the glass. Raindrops as well as dirt change the strength of the reflection of the light signal. After that in the block electronic control a command is given to turn on the windshield wipers. Time lags between brush movements are set automatically and depend on the intensity of precipitation.

It is permissible to install such a rain sensor on the windshield. At the same time, the upper tinted strip will not interfere with the adequate operation of the device. The sensor will not fit cars with an infrared filter on the glass.

Turning on the rain sensor

The sensor works only when the wipers are activated in the first position, the device automatically selects the intensity of the movement of the brushes. If the wipers are in the second or third position, then their speed does not change.

When installing a rain sensor, you must leave the possibility of manual control of the wipers. On the road, any situations can arise, and you should not completely rely on automation. For example, a lot of splashes from oncoming traffic appear on the driver's side, but these splashes do not fall into the sensor's operating area, and the glass is not cleaned.

Experts recommend keeping the rain sensor turned off in dry weather. Since the device responds to different objects: flying insect, tree leaves and fluff. The windshield washer must always be started manually. Automatic water supply to the glass can frighten the driver by unexpectedly limiting the view.

When making a sensor, you can choose an imported microprocessor as a basis or use domestic developments.

Rain sensor on a foreign microprocessor model RS-22 RAIN sensor

The microprocessor is manufactured by the American company Microchip and is suitable for any car with 12 V equipment. Connecting the rain sensor consists of four steps:

  1. Fasten with glue a special holder on inner part windshield;
  2. Apply the gel to the surface working area a sensor for equalizing the refractive index;
  3. The position of the sensor body on the holder is fixed with a screw;
  4. Check the work area for air bubbles.

Such a rain sensor can be connected in VAZ vehicles using the wiper operation mode switch:

  1. The sensor is connected to the body of the car with a blue wire;
  2. A red wire is pulled to contact I on the switch from the sensor;
  3. The yellow wire of the sensor is attached to a cord of the same color, but with a green stripe.
  4. With a black wire, the device is connected to the block on pin No. 53.

For correct operation device, at the initial stage it is necessary to calibrate the sensitivity of the elements and check throughput windshield. The windshield wipers will start to work adequately only after setting the threshold for the rain sensor.

Domestic development of the rain sensor

Russian engineers have created a rain sensor that has no analogues in the world. Its main advantages are:

  1. Simplicity and reliability of system management;
  2. Possibility of self-assembly;
  3. The sensor is connected independently. The electrical wiring of the car is not involved (and this factor is especially important when the car is under warranty);
  4. Ability to disable the sensor and switch to manual wiper control mode;
  5. Low cost.

The device has the function of adjusting the pauses that accompany the movement of the wipers. Changing the frequency of the brushes has a direct relationship with the speed developed by the car on the road. With slow movement, the pauses are lengthened, and with fast movement, they are shortened. If the driver in his car wants to storm a deep puddle, the system will determine the approach of a large volume of liquid to the glass in advance. At a distance of 5 to 10 cm, approaching water and dirt will be detected and the system will move the wipers in advance.

The DDA-25 sensor model has received the greatest distribution in the domestic market. Typically, such devices are equipped with Lada cars (Kalina or Priora). The rain sensor has several modes to protect against snow and rain. Three built-in programs can be changed with a button on the device. You can install such a sensor yourself, for this it is enough to follow the established procedure:

  1. Attach the optical sensor to the windshield on an adhesive base;
  2. Install the sensor in place of the relay in the mounting block of the car (at the same time, observe the marking and position of the key);
  3. Lay the wiring on the front glass pillar;
  4. Set the sensitivity level of the sensor.

More clearly, the installation of the rain sensor is shown in the video:

A suitable rain sensor can be found at most online automotive retailers. The cost of such a device is usually not high: you can focus on a price in the region of a thousand rubles.

Many car owners consider the rain sensor to be an extra device that they can do without. To understand whether it is really necessary, it is worth learning about the features of such devices.

The described device is a device that determines the appearance of precipitation and includes wipers. Typically, the sensor also responds to light and is used to automatically turn on the headlights.

Rain sensor

This device is designed to solve several problems:

  • determination of the presence of rain or snow;
  • turning on the wipers when it rains;
  • determination of the degree of contamination of the windshield;
  • turning on the headlights if the sensor is also designed to detect the level of illumination.

The installation of the described device is carried out between the windshield and the rear-view mirror. The rain sensor is designed to create a safer environment while driving in the city or on a busy highway. If it starts to rain or snow during heavy traffic, the driver has to make unnecessary movements to turn the wipers on and off, while distracting from the road. This contributes to a loss of attention and can lead to an accident. In addition, the device allows you to provide excellent visibility in the presence of a large amount of precipitation.

Rain sensors have several disadvantages:

  • False or inappropriate positives. In some cases, just one drop helps turn on the wipers, although the rest of the glass remains dry. In this case, the sensor often does not work when part of the glass is flooded with water and dirt, but the drops do not fall into the device's coverage area.
  • Turning on wipers without glass washer. Because of this, the dirt is smeared on the surface, causing a deterioration in visibility.
  • Operation due to windshield defects. The presence of scratches and other defects on the surface may cause incorrect operation of the device.
  • Response delay. In some cases, the rain sensor is triggered within 1-2 seconds after raindrops appear on the windshield.

To avoid such problems and pre-adjust the sensor to the desired sensitivity level, it is enough to splash water on the place where the sensor is installed. If it works correctly, the wipers will automatically turn on.

The rain sensor is fixed under the windshield on reverse side rear view mirrors. During the installation of the device, the following nuances are taken into account:

  1. The sensor must be located on the windshield in such a way that it does not interfere with the driver's view of the road. At the same time, it is important to install it in the area that is cleaned by the wipers during their work. Otherwise, the device may not function correctly.
  2. There should be no cracks or other defects in the sensor location area, since the efficiency of its operation depends on this.
  3. Before fixing the device, you need to make sure that the wipers effectively clean the windshield and do not leave dirt.

The sensor can be installed both in a service center and independently. Moreover, it is quite easy. No special tools are required for installation.

Below we provide instructions for installing a simple rain sensor DDA-35.

First you need to “aim” - choose a place on the inside of the windshield where the sensor will be glued. As mentioned earlier, it should not interfere with the driver's view. For beauty, it is advisable to align the place and install the sensor at the top in the middle, next to the mirror mount.

Purchased rain sensors most often come with a special cloth for wiping and degreasing glass. Thanks to this, the sensor is attached better.

If there is no such napkin in the kit, you can use any glass napkin.

Carefully wipe the place on the windshield where we will glue the rain sensor.

Remove from the inside of the sensor. protective film, thereby opening the fasteners that will hold the sensor to the glass.

After that, we apply the rain sensor to the place chosen on the glass and carefully press the device to the glass. We try to make everything work out smoothly, because we will not have a second chance. With each detachment, the holder will stick worse and worse to the surface.

We push the wire from the sensor under the upholstery of the ceiling.

If there is not enough space under the upholstery, then slightly loosen the screws securing the visor.

We remove the pad from the rack and lay the wire under it. After that, we put the lining back on.

We go below. Gently push the cable under the rack seal.

Open the fuse box different models it is located in different places), and install the rain sensor in place of the wiper control relay (be sure to observe the marking and key position). If we do not know exactly where to install the relay, look in the documentation.

The rest of the cable, if necessary, can be wound up and left in the mounting block.

This completes the process of installing the rain sensor on the car. It remains to check its performance by splashing water on the windshield (with the car's ignition on, of course).

Checking the operation of the rain sensor

You can also watch a video about installing a rain sensor:

After connecting the device, the wipers can also be controlled manually. This may be necessary when moisture gets on the glass from under the wheels of the vehicle in front, which does not reach the sensor's coverage area. In this case, the driver turns on the wipers manually.

It is necessary to set up the device immediately after installation, so as not to be distracted by such actions while driving. DDA-35 has 3 operating modes - standard, rain and snow. Modes are switched by pressing a single button in turn.

Built-in rain sensors adjusted using the steering wheel switch. The inclusion handle has 5 positions as standard (sometimes more and less). In position "0" the device is switched off. Numbers from 1 to 4 indicate the degree of sensitivity of the sensor. When you turn on the device in mode 4, it will operate in the maximum sensitivity mode. To turn off, simply turn the knob to position 0.

Rain sensor adjustable via steering column switch

The principle of operation of the rain sensor

The described device consists of an LED and several light-sensitive elements (photodiodes). The light from the LED reflects off the glass surface and returns to the photosensitive elements. If there is rain or snow on the surface, the degree of reflection changes and the sensor turns on the wipers.

The more wet the windshield, the less refracted light will be reflected. Photocells react to the change and after that the wipers turn on. That is why a false alarm can occur when insects hit the glass or if there are defects on the surface. To prevent untimely switching on of the wipers, it is enough to turn off the sensor in dry weather and install the device only on undamaged glass.

Turning on the factory rain sensor after installation is quite simple - to do this, turn the stalk lever to position from 1 to 4. Turning off occurs when the lever is switched to position 0. In case of problems with the sensor, you should not try to turn it off yourself if you do not know how to do it right.

Rain sensor setup example.
To turn on, move the stalk to position 1. Dial A must be set according to the desired sensitivity (bottom - minimum, top - maximum).
To disable the rain sensor, move the stalk to position 0.

The main mistake of many drivers is to turn off the device most in a simple way- cutting wires. Such actions can cause a malfunction of the onboard power supply control unit. If the sensor does not respond to small drops, first unscrew the knob to position 4, in which it will work in maximum sensitivity mode.

To safely disconnect the sensor, simply remove the connector from it. In this case, an error will be displayed in the on-board power supply unit. If you need to completely turn off the device, you should contact a car service.

Many rain sensors are universal and can be installed on any vehicle. All of them work on the same principle, so any driver will be able to set up the device on their own.

How much is the rain sensor

The cost of many rain sensors is about 2 thousand rubles. The price depends on the sensitivity of the device, as well as on whether the electronic relay is built into the car or whether it is removable. This depends on how the sensor is connected.

Many universal models have a cost of not more than 2 thousand rubles. Such sensors are the most common and are installed on a variety of machines. If the sensor is installed in a service center, experts select the most suitable device for the car.

Rain sensor - what it is, how it works, how to install

5 (100%) 4 voted

In this tutorial, we will use a rain sensor to detect rain intensity and generate an analog variable signal from 0 to 1024. It will also generate a digital output according to its set value.

When the rain sensor detects rain, it sends an analog signal to the Arduino Uno Board. The Arduino Uno monitors the changes that occur on the rain sensor. When the value of the rain sensor goes beyond a certain level, our Arduino Uno sends some commands to our GSM module and GSM module sends sms to the desired phone number.

Installing the Arduino IDE: You can download latest version Arduino IDE on this page.

Step 2: Components Used

For this project, we need some components:

  1. Rain sensor/sensor
  2. GSM module (sim 900)
  3. Set of wires/jumpers

Rain sensor/sensor

The rain sensor module is a simple rain detection tool. It can be used as a switch when a raindrop falls on the sensor, as well as to measure the intensity of precipitation. Modular functions, rain board and control board which are separate for more convenience, power indicator and adjustable sensitivity, potentiometer.

The analog output is used to detect droplets in rainfall. When connected to a 5V power supply, the LED indicator turns on when there is no rain falling on the induction board, the DO output is high. When the amount of water drops, the DO output is low, the switch indicator turns on. Remove water droplets, when restored to the original state, it will go to a high level.

GSM module (sim 900)

This is a GSM/GPRS compatible quad-band cell phone that operates on 850/900/1800/1900 MHz and can be used not only for Internet access, but also for verbal communication (provided it is connected to a microphone and a small speaker). ) and SMS.

From the outside, it looks like a small package (2.4 cm x 2.4 cm x 0.3 cm) with L-shaped pins on four sides so that they can be soldered both from the side and from the bottom. The indoor module is controlled by the processor AMR926EJ-S, which controls telephone communications, data communications (via the built-in TCP/IP stack), and (via UART and TTL serial interface) communication with circuitry interfaced to the phone itself.

The processor is also responsible for the SIM card (3 or 1.8 V), which must be connected to the outer wall of the module. In addition, the GSM900 device integrates analog interface, A/D converter, RTC, SPI bus, I²C and PWM module. The radio section is GSM 2/2+ phase and is class 4 (2 W) on 850/900 MHz or class 1 (1 W) on 1800/1900 MHz.

The TTL serial interface is responsible not only for the transfer of all data regarding already received SMS and those that enter during TCP/IP sessions in GPRS (data transfer rate is determined by GPRS class 10: maximum 85.6 kbps), but also the receipt of commands circuits (in our case, coming from PICs that control remote control), which can be either the AT standard or the AT-enhanced SIMCom type. The module is powered continuously (3.4 to 4.5 V) and absorbs a maximum of 0.8 A during transmission.

Arduino Uno

The Arduino Uno or Genuino Uno is a microcontroller board based on the ATmega328P ( technical description). It has 14 digital I/Os (of which 6 can be used as PWM outputs), 6 analog inputs, a 16MHz crystal, a USB connection, a power connector, an ICSP header, and a reset button.

Step 3. Description of the project

In this project, we use the Raindrop Sensor to detect the Raindrop Intensity and generate some analog values. When the rain sensor detects the intensity of the raindrop, the Arduino UNO sends a command to the GSM module, then the GSM module sends a mail to the specified email ID.

The connection of our circuit is shown above. There is two circuit diagrams : one for rain sensor with arduino and another for arduino with gsm module.

Step 4. Code for the project

You can download source this project below.

/* RAINDROP DETECTOR WITH GSM(USING SIM-900 MINI , RAINDROP SENSOR & ARDUINO UNO); Here We Are Using Raindrop Sensor To Detect Raindrop Intensity And Generate An Analog Varying Signal From 0 To 1024. It Also Generates A Digital Output According To Its Preset Value. When The Raindrop Sensor Detects Rain Then It's Going To Send An Analog Signal To Arduino Uno Board.Arduino Uno Monitoring The Change Happening On Raindrop Sensor. When The Value Of Raindrop Sensor Going Beyond A Certain Level Our Arduino Uno Sends Some At Command To Our GSM Module And GSM Module Send An SMS To The Given Phone No. The circuit: * GSM MODULE(SIM-900 MINI) 5VT(TX) CONNECTED TO PIN 9(RX FOR SOFTWARE SERIAL) * GSM MODULE(SIM-900 MINI) 5VR(RX) CONNECTED TO PIN 10(TX FOR SOFTWARE SERIAL) * RAINDROP SENSOR DO TO PIN 11 * RAINDROP SENSOR AO TO PIN A0 * CONNECT VCC OF RAINDROP TO 5V OF ARDUINO UNO * CONNECT VCC OF GSM TO 5V OF ARDUINO UNO. 8 NOV 2016 by SOUMYA RANJAN PANDA For any help contact [email protected]*/ #include SoftwareSerial mySerial(9, 10); //(RX,TX) int d=0; void setup() ( mySerial.begin(9600); Serial.begin(9600); pinMode(11,INPUT); //FOR DIGITAL INPUT pinMode(A0,INPUT); //FOR ANALOG INPUT delay(50); ) void loop() ( int sensorReading = analogRead(A0); //READ RAINDROP SENSOR VALUE if(sensorReading<500) //WHEN SENSOR DETACT RAIN IT"S ANALOG VALUE REDUCE { Serial.println("Raining"); SendMessage(); //SENDING SMS SIGNAL TO GSM MODULE while(analogRead(A0)<800); //HOLDING STATE UNTIL RAIN STOP } else if((sensorReading>500)&&(sensorReading<800)) // IT IS FOR RAINWARNING { Serial.println("Rain Warnigitng"); } else if(sensorReading>800) //WHEN RAIN STOP ( Serial.println("NotRaining"); ) delay(1000); ) /******************************FOR GSM SIM-900 MINI*************** *****************/ void SendMessage() //SENDING SMS SIGNAL ( mySerial.println("AT+CMGF=1"); //SELECTING SMS Text Mode delay(1000 ); mySerial.println("AT+CMGS=\"+91XXXXXXXXXX\"\r"); //PROVIDE YOUR MOBILE NUMBER delay(1000); mySerial.println("HELLO SIR, I AM YOUR HOUSE .IT"S RAINING OUTSIDE:)"); delay(100); mySerial.println((char)26); delay(1000); )

Step 5. Final video

See the full video of the project and its description above. That's all.

In some hobby weather monitoring projects or, for example, growing plants outdoors, it can be useful to know whether it is raining or not at the moment. Since many radio amateurs use the Arduino board as a control board, a special drop / rain sensor was developed for this purpose, which can be connected to the Arduino without any problems. The simple Arduino project presented in this article will allow you to turn on an audible alarm when the drop / rain sensor is triggered.



The rain sensor consists of a sensor plate and a board with an LM393 comparator. In addition to a digital output, the sensor has an analog output, so the Arduino microcontroller can read analog readings in the voltage range from 0 to 5V, or a value from 0 to 1023 after the ADC.



If the sensor board of the sensor is in a dry state, the analog output of the module is 5 V. If raindrops fall on the plate, connecting the board conductors to each other, then the analog output changes from 5 V to 0 V depending on the amount of moisture on the plate. In this way, the sensor tells us whether it is raining heavily or lightly. The Arduino will turn on the alarm after a certain amount of rain and some delay, which will be defined in the code. This will avoid false positives. In this case, the trigger threshold is 300 and the delay is 30 seconds.


Below is an Arduino sketch that allows you to turn on an alarm connected to digital port 8 when it registers with a rain sensor.


int rainSensePin= 0; // analog input 0 for sensor signal int alertPin= 8; // digital output 8 - for signaling int curCounter= 0; // counter - increments by 1 every second after the sensor is triggered void setup()( Serial.begin(9600); pinMode(alertPin, OUTPUT); pinMode(rainSensePin, INPUT); ) void loop()( int rainSenseReading = analogRead(rainSensePin ); Serial.println(rainSenseReading); // for monitoring via serial port delay(250); // short delay if (curCounter >= 30)( // end of time delay digitalWrite(alertPin, HIGH); // alarm triggered ) // if there is no more rain, reset the counter if (rainSenseReading<300){ curCounter++; } else if (rainSenseReading >300) ( // if the intensity of rain does not exceed the threshold digitalWrite(alertPin, LOW); // do not turn on the alarm curCounter = 0; // reset the counter to 0 ) delay(1000); )

When it rains (and the Arduino detects it), the D8 output goes high. This output can be connected to an audible alarm (piezo buzzer) or a switch (electromagnetic relay). The output wiring diagram is shown below.



In this case, the Arduino is powered by an external 9V supply, the buzzer/relay activation circuit can be powered by 5-12V. The supply voltage Vcc must be suitable in both voltage and current for this circuit.


Thus, creating a project in which using the Arduino board you can register the presence or absence of rain or falling drops from any source of liquid is not a difficult task. The Arduino drip/rain sensor is fairly common, inexpensive, and easy to use. Ultimately, you can do it yourself.

If it overtakes a downpour on the road, then when driving it is inconvenient, dangerous. For this purpose, automatic sensors, ensuring the operation of cleaning brushes located on the glass of the car. It turns out that the wipers turn on without additional pressing of sensors, buttons. Similar automatic system can be installed on your car. Consider the principle of operation of the mechanism.

How to install a rain sensor.

The control sensor is located inside the car, directly on the windshield. It turns out that it is located in the area of ​​\u200b\u200baction of car wipers. In the area where we plan to put this sensor, there should be no damage.

The system in automatic mode allows this device to constantly scan the surface of the glass, using IR radiation, it “draws conclusions”. This signal, reflected from the device to the glass, produces an electronic signal to the power supply. As a result, the wipers themselves turn on when necessary. Recent innovative developments allow you to adjust the speed of the brushes. It must be remembered that the sensor scans the surface only when the wipers are on. We put the wipers in the first position, now they will function independently. Installation can be entrusted to a specialist.

Other functions of the automatic regulator.

The wipers turn on to the 2nd, then the third modes, you can control the elements in manual version. Do not turn on the sensor in sunny weather, because the glare on the glass can be perceived by the equipment as rain. The device can react to sand, small pebbles, a fly on the windshield.


We attach the sensor to the windshield, then apply a special protective gel - it ensures the smooth operation of the mechanism. The gel will reduce the coefficient required for the light refraction process. As a result, 2 working zones are formed. If we fix the first zone of the body to the holder, then we fasten the second one with self-tapping screws.

The working area should be free of air bubbles. The procedure is completed, it remains to start this system. We set the blue wire as a mass, we display it on the car body. In order for the installation to function reliably, it is necessary to clearly fix the wire. We connect the red wire to the switch contact, connect it to the yellow wire (with a green stripe). It remains to connect the black wire to contact number 53.



Now we calibrate the sensor. The whole installation is regulated, according to the parameters of the light transmission of the glass, we reveal the levels of sensitivity. After the first rain, we will set up all the shortcomings, the response threshold.