A control system for automatically detecting moisture on the windshield of a vehicle. The automatic moisture detecting system includes an optical system for imaging a portion of the windshield on to an image array sensor, such as a CMOS active pixel sensor. The voltages of each of the pixels which represents the illumination level is converted to a corresponding gray scale value by an analog digital converter. The gray scale values corresponding to the image are stored in memory. The spatial frequency composition of the gray scale values are analyzed to determine the amount of rain present. In order to provide a control signal to control the operation of the windshield wipers of the vehicle as a function of the amount of moisture present. The system is also adapted to detect the level of fog both on the interior of the windshield as well as the exterior of the windshield. By providing a system for automatically detecting the presence of fog on the interior and exterior of the windshield, serious performance limitations of known automatic rain sensors are eliminated.