Officials are upgrading hundreds of seismic monitors throughout California, installing new devices that seismologists say will vastly improve the state's system for detecting and warning of major earthquakes.

The changes will allow first responders, scientists and eventually the public to be notified of an earthquake five seconds faster than is possible now. Those precious seconds could allow emergency officials to shut off gas and water lines, raise fire station doors, stop subway operations and possibly even warn the public of shaking to come.

"I'm confident that if we had the information, we could use it to our advantage," said Tom Jordan, director of the Southern California Earthquake Center. "The main issue here is to have our communities be resilient to earthquake damage."

Shock waves from a quake move quickly through the ground, but electronic signals are far faster, allowing a warning to outrun a temblor. The new monitoring would be particularly helpful for earthquakes that originate outside urban areas -- along the San Andreas fault, for example -- and radiate into major cities.

"The earthquakes that will affect San Francisco don't necessarily start in San Francisco, and the same is true for Los Angeles," said Richard M. Allen, the associate director of UC Berkeley's Seismological Laboratory. "They could start way to the north or to the south and rupture toward the city."

Early-warning systems are already in place in parts of Mexico and Japan. California faces some unique difficulties in quake detection, but at a meeting of the American Geophysical Union this week in San Francisco, a group of seismologists presented research that showed such a system is feasible here and laid out how it could be built.

In Southern California, 90% of the region's seismic monitors already are being upgraded -- and seismologists recently began a pilot program for delivering early warnings to emergency responders and utilities.

The regional upgrade effort, being conducted by Caltech in conjunction with the U.S. Geological Survey, recently took David Johnson up to a high bluff in Rancho Palos Verdes, where he unlocked a heavy padlock on a set of metal doors jutting out of the ground. He swung the doors open, batted at spider webs and walked down a steep staircase into a set of rooms that once formed part of a Nike missile site and now are used to gather seismic information.

Johnson, a senior instrumentation specialist at Caltech, and his colleague Jacob Crummey opened four padlocked doors -- the last of which was 5 inches thick -- before reaching a small cinder-block room. A duct-taped foam box sat in one corner.

After shutting off power to the network of machines that filled the room, the two men went to work, pulling out old machines and wires.

"At the time, these were state of the art," Johnson said as he pulled at a machine that resembled an early personal computer. The equipment had been in place since the early 1990s, when seismic equipment had to be built to order in Caltech's lab. These days, he said, "it's off the shelf."

"The technology has moved forward" since the 1990s, said Doug Given of the geological survey. "And in a number of ways, the data loggers are more capable. They require lower power, which makes a difference, particularly at solar sites. Their capabilities are enhanced. And that's where it starts to make a difference for earthquake early warning."

The pursuit of early warning in California dates to 1868, when a simple system was proposed after a quake along the Hayward fault east of San Francisco, according to a recent paper in the journal Seismological Research Letters. The rudimentary system would have used telegraph cables to ring a distinctive bell warning people of impending shaking.

Today, advanced versions of those ideas are in place in other countries where devastating quakes have occurred. In Mexico City, earthquake warnings are distributed via radio, television and e-mail bulletins, and schools and government agencies get direct alerts from dedicated radio links.

A more advanced system in Japan can give residents half a minute or more of notice before shaking begins. Messages pop up on television and radio stations. People get cellphone text messages. Audible alerts are sent out across more than 100 municipalities, broadcast on speaker systems in town halls and malls. And emergency lights, sprinklers and brakes on high-speed trains are set to switch on automatically in case of a coming quake.

California's roughly 400 strong-motion sensors are largely clustered in the north and south, leaving large gaps in seismic monitoring in the middle of the state.

California scientists have been working for several years to develop sophisticated algorithms to analyze the data coming from the motion sensors -- to determine whether the shaking is caused by a large truck, a thunderclap or an actual earthquake.

Upgrades to the quake monitors so far are being paid for with about $2 million in federal stimulus money and some private funds.

Implementing a full-fledged early-warning system statewide would cost California $80 million to $100 million, according to a recent estimate. That would include adding 100 more monitoring sites to the 400 already in place.

The geological survey recently launched the testing phase of a multiyear study of earthquake early-warning systems. The California Integrated Seismic Network ShakeAlert System will notify emergency responders, utilities and transportation agencies when quakes are detected. Those alerts will not be available to the public during the three-year testing phase.