Walter J. Hamer, an expert on the fundamental science of batteries that power flashlights, hearing aids, pacemakers and other modern gadgets, died June 29 of congestive heart failure at his home at Asbury Methodist Village in Gaithersburg. He was 96.

A resident of the Washington area since 1935, Dr. Hamer was chief of the electrochemistry section at the National Bureau of Standards, now known as the National Institute of Standards and Technology, for 20 years. He wrote or co-wrote more than 100 scientific papers, the last published in 1995, when he was 88.

Dr. Hamer maintained the nation's standard of voltage measurement and conducted research on a wide range of topics in the field, including acidic-alkalinity standards -- pH -- and electrolytic solutions.

As the bureau's representative, he chaired an American Standards Association committee when it adopted the "AAA" designator for the now-ubiquitous cylindrical battery sold in drug and grocery stores.

During World War II, Dr. Hamer developed a method to extend from one week to six months the life of dry-cell batteries used by U.S. forces in tropical battlefields. He also worked for two years on the Manhattan Project, the crash scientific research program that produced the atomic bomb. He served as a battery consultant to the Defense Department from 1952 to 1954.

He testified as the Federal Trade Commission's expert witness in 1948 to rebut extravagant advertising claims for an additive, called AD-X2, sold to extend the life of automobile batteries. The product's developer lobbied U.S. senators to pressure the Bureau of Standards to change its negative assessment. After extended hearings, in 1953, the commerce secretary dismissed the director of the Bureau of Standards over the affair but was forced to reinstate him after an outcry that the firing would undermine the bureau's independence. In 1970, Dr. Hamer published a report of a test that proved the ineffectiveness of the additive.

His work on AD-X2 won a commendation from the undersecretary of commerce and received an award from the American Institute of Electrical Engineers.

Dr. Hamer was born in Altoona, Pa., and graduated magna cum laude from Juniata College in Huntingdon, Pa. He received his Ph.D. in physical chemistry from Yale in 1932 and held postdoctoral fellowships at Yale and the Massachusetts Institute of Technology before joining the Bureau of Standards in 1935 as a research chemist.

In 1950, he was appointed chief of the bureau's electrochemistry section, a post he held for 20 years. He also directed the bureau's electrolyte center for the national Standards Reference Data Program from 1966 until his retirement in 1972.

In retirement, he was a scientific consultant for the government and private industry. In his spare time, he raised camellias at his home in the Chevy Chase section of Washington.

He was editor of the "The Structure of Electrolytic Solutions" and wrote a chapter for the "Handbook of Physics," a standard guidebook.

Dr. Hamer was awarded an honorary doctorate of science degree from Juniata College in 1966. He received the Commerce Department's Gold Medal for distinguished government service in 1965. A past president of the Electrochemical Society, he was a member of Sigma Xi and a fellow of the Institute of Electrical and Electronic Engineers, the American Institute of Chemists and the American Association for the Advancement of Science.

Dr. Hamer was also a member of Episcopal Church of the Ascension in Gaithersburg, the Cosmos Club and the Camellia Society of the Potomac Valley.

Alma Hamer, his wife of 61 years, died in 2002.

Survivors include a daughter, Margaret J. Hamer of Bethesda, and a grandson.