In this project, a rain and ice sensor is implemented by analyzing the reflection of an infrared (IR) light source.
This project will use proven techniques based on multiple reflections of IR light in the internal walls of the target glass. It will aim to increase the capabilities of standard components by adding technical advantages offered by the LED device, such as increasing the power emission using pulsed energy applied ten times using high current strikes at one percent duty cycle.
Below we described steps needed to understand how the solution has been programmed to design a rain sensor. However, if you just want to get the result of programming, download GreenPAK software to view the already completed GreenPAK Design File.Plug the GreenPAK Development Kit to your computer and hit the program to design the solution.
ApplicationThe most common practice in the detection of raindrops on a windshield involves sensing infrared light conducted through the internal walls of the windshield glass, and in some cases enhancing these reflections by adding other physical components to the glass.
When raindrops are present on the external surface of the glass, a refraction of light happens and takes away part of the initial light stream. This results in an attenuated beam of IR light as compared to the original conditions (without the presence of water).
In order to acquire the majority of the luminous emissions, the light beam is injected into the glass at a 45° angle. The receiver at the other end of the glass also has a 45° angle. This technique depends on the statistical probability that when it is raining, the surface of the glass will have raindrops in the path of reflection. The longer the distance between the emitter and receiver, the more effective this detection method will be.
As the distance between the emitter and receiver gets bigger, the light’s power loss increases as the light travels through the glass. For the best detection given increasing distance, either a more efficient sensing/light emission device must be developed, or more power must be obtained from the current IR light source.
This application suggests a method to get the most out of the LED. A constant light could be used for measuring, but this is not mandatory as the time constant is not the priority (measuring the intensity of the beam is). LED manufacturers supply the Peak Forward Current [IR928-6C-F, Datasheet, Everlight Electronics] (IFP) or the Forward Surge Current [CNY70, Datasheet, Vishay Semiconductors] (IFSM) of the LED in their datasheets.
GreenPAK Design: Block DiagramPulse Generator for IR Emitter
For the pulse generator, the case of 10 μs with a one percent duty cycle will be taken. The complete period is given by:
Which results in a maximum frequency of:
Thus, a high pulse is set for 10 μs with the complementary low level to achieve a 1 ms total period.
To generate this pulse, CNT5/DLY5 and CNT2/DLY2 are used.
CNT5/DLY5 provides the complete period of 1 ms. It is set as a counter using the internal clock at 25 kHz (configured in OSC). CNT2 provides the 10 μs high-level pulse.
IR LED Emitter Driver
A basic configuration (Figure 3) is used to drive the IR LED, using TIP121 transistors and considering the power supply conditions of a car where we have +12 V as our main voltage source.
Based on experience, the TIP121 Darlington transistor is a good option for this application. This device will allow us to drive a high current load with a low base current.
Therefore, R1 can be calculated from:
The average power calculation for R1 is calculated as follows:
In order to be aware of the worst-case conditions, there is a possibility that the signal in the base of Q1 could be a constant DC level. If so, the power dissipated by R1 is as follows:
The power dissipated by the Darlington transistor must be observed (to take care of the device’s life span) by calculating the device temperature through its thermal resistance parameters.
At 25 °C, with no additional heat sink:
This does not seem like a big issue. However, in the case when current driven is 100%:
This means it would be beneficial to avoid a constant level in the base of Q1.
One simple option is to have a series capacitor in the base (Figure 4):
IR Light Receiver
The receiver is configured as a common collector to simply convert the input light pulses into a voltage in R2.
The voltage drop in R2 will typically be pulses. For our purposes, these need to be translated into a DC level.
The easiest way to do this is to filter the signal using an RC low pass filter, with a cut-off frequency two decades before 1 kHz (therefore, 1 Hz) to ensure the 1 kHz rejection.
The cut-off frequency is calculated:
We can try for 1 μF, resulting in a cut-off frequency of:
Voltage Controlled PWM
The application note AN-1056 Macro circuit design ADC PWM is used to translate a DC level into a PWM signal.
IR Light Emitter vs IR Receiver
The following oscilloscope screen captures depict the IR LED pulses (CH1) vs the voltage drop in R2 directly from the IR receiver (CH2). In Figure 8, one can see R2’s voltage (CH2) vs. the filtered DC level in C1 (CH1).
100% Light sensing
75% Light Sensing
50% Light Sensing
25% Light Sensing
0% Light Sensing
DC Level vs PWM
Ice Sensing Applications
During this exercise, it was found that sensing ice is somewhat challenging using the techniques described so far. The changes in refraction due to the presence of ice are different than the changes due to the presence of water. However, it is possible to detect both.
We recommend that the emitter and receiver be immersed in a clear encapsulating material so that the light emitted and received is not lost due to material changes. This helps avoid unintended attenuation and also helps prevent a false positive where condensation on the inside of the car sets off the rain sensor.
We can account for the added challenge of detecting ice by adding a barrier to the center and adjusting the angle of the emitter and receiver.
Circuit enhancement
This section will discuss how to enhance the receiver to deal with the challenge posed by an icy windshield.
The previous receiver design was shown in Figure 5. The low-pass filter with R3 and C1 was optimized for water-only sensing.
To account for the change in the angle of reflection and the presence of encapsulating material, we can change the value of R2. The gain of the circuit is directly proportional to R2’s value. For practical purposes, a 500 kΩ potentiometer would be ideal to select the proper value for the circuit. Figure 23 shows an updated topology with the potentiometer included.
Figure 24, Figure 25, Figure 27, and Figure 29 show the different behavior of the circuit with varying conditions.
In this project, a rain and ice sensor has been created using a Dialog GreenPAK SLG46620V and a few external components. This system is able to monitor when a sheet of glass has either water or ice on its surface. The system can then generate a PWM signal to control a motor that can wipe away the liquid from the glass surface.
Comments