An approach to the design of active window shades is developed to control the direct solar gain through a window. Using simple actuation hardware and sensors, a control strategy is presented that automatically adjusts window shades to save HVAC energy by controlling direct solar radiation passing through a window. The control algorithm is based on a simple approach that admits direct light in the winter and blocks the direct light in the summer, while providing shade adjustment that affords maximum visibility through the window. Cloudy skies or indirect sun result in horizontal placement of the shades, and the shades close at night. The implementation uses two thin-film photovoltaic cells as sensors and a control algorithm that is independent of the window orientation, latitude, or solar time, so that it operates properly in any installation location. Preliminary analytic and test results show significant energy savings when the automatic window shades are compared with a window without shades, and with a window outfitted with fixed horizontal shades