William Orrin Robinson, 94, a Department of Agriculture chemist for 50 years who specialized in the chemistry of infertile soils, died Monday at the Iliff Nursing Home in Dunn Loring Va., following a heart attack.

Mr. Robinson joined Agriculture in 1903. One of his first assignments was to check foods for impurities and toxic substances before the Food and Drug Administration was formed to take over this function. But his basic work was on the chemistry of soils and why some soils are not fertile.

He developed an induction furnace and an electric thermostat to monitor some of his experiments. Following his retirement from Agriculture in the early 1950s, he was a consultant to the U.S. Geological Survey.

Mr. Robinson lived in Falls Church for many years. At one time he grew 257 varieties of grapes in his vineyard.

He was born in Marlborough, N.H., and earned bachelor's and master's degrees at the University of New Hampshire. He served in the U.S. cavalry along the Mexican border during the expedition against Pancho Villa in 1916. After the United States entered World War I, he became major in the Army Chemical Corps.

Mr. Robinson's wife, the former Mary Collins Sherman, died in 1929.

Survivors include two sons, George A., of Falls Church, and William Orrin Jr., of Eagle Pass., Tex.; two daughters, Polly Whyte, of Accokeek, Md., and Joyce Kraus, of Berkeley, Calif.; 11 grandchildren, and one great-grandson.