In what has to be the ultimate energy conservation effort, the Department of Housing and Urban Development is installing motion detectors in restrooms at its Southwest Washington headquarters. The detectors will automatically turn out the lights unless there is some kind of action detected every 12 minutes.

HUD, like other federal agencies here, has a whopping electric bill every month. Although employes are asked to turn out office lights when they leave for the day, lights in the more than 80 bathrooms serving several thousand employes burn around the clock.

Starting this week, contractors have begun installing the motion-detection devices. They are timed to turn off ceiling lights when bathrooms have been vacant for more than 12 minutes.

Where possible, the devices are being put near doors, so anyone entering a darkened room will trigger the light switch. The motion-sensitive devices look like small rectangular pieces of white plastic, with small red lights in the middle.

It's all part of an initiative the giant agency is taking to be a leader in government in energy conservation.

A spokesman for the General Services Administration said that the devices are being installed also in Office of Personnel Management facilities here and in a federal building -- of the technically sophisticated "intelligent building" type -- being constructed in Portland, Ore.

During the next few years, GSA anticipates that the light savers will be installed in other federal buildings.

A number of employes assigned to the HUD building at Seventh and D streets SW find the light exercise amusing, however.

"You hear people whistling 'Dancing In The Dark' in the halls," a computer programmer said.

"It has given rise to all sorts of gallows -- or should I say bathroom -- humor," said another employe. "Like what if you fall asleep in the bathroom, or become intent on reading a book or something, and the lights go out? Do we wave our arms to turn on the lights, or wait for help?" an executive said.

Officials of the Office of Administrative and Management Services who are in charge of the light exercise couldn't be reached yesterday to answer questions about the cost of the detectors.

But a HUD official said: "Silly as this may sound, and I guess some people will find it amusing, it will obviously save us a lot of money." He said he didn't know whether the devices would be installed in the private facilities of top HUD officials.

"I gather they will be confined to high-traffic areas where savings will be greater," said the HUD man -- who easily could have made a career in the diplomatic service.