When a wealthy Englishman named James Smithson willed 152 years ago that his entire estate of more than $500,000 be spent setting up a museum in Washington, little did he realize that it would eventually before the repository for: 6,012 pels from dogs, wild hogs and other animals 5,832 hand tools. 2,587 musical instruments. 34,146 nests and eggs. 4,785 sea sponges.

Neither, for that matter, did the Smithsonian Institution, the museum created by his bequest, until three years ago when it began the first-ever top-to-bottom tally of the treasures and trivia that have been squirreled away in its attics and basements over the 135 years of its existence.

Today, with the cataloguing barely half completed, Smithsonian officials say they believe they have about 78 million items, ranging from antique lightbulbs to the pickled brains of two former curators (the curators willed them to the Smithsonian) stashed away in dusty cabinets and on display in museum hallways. But they won't know for sure until the count is completed in early 1983.

"For the first time in the history of the museum we'll know what we have on the shelf," said Fred Collier, collections manager of paleobiology in the Museum of Natural History where the vast majority -- 60 million -- of the Smithsonian's items are kept. "We are finding unexpected things. . . . They're not gone, but just misplaced, and once your misplace something in four or five floors of fossils -- "

The Smithsonian's philosophy throughout its existence could fit the axion that it's better to have it and not need it than to need it and not have it.

Trouble is, the nation's attic keeper never has quite known what it has in its 13 museums, which include the National Zoo, the Museums of American History and History and Technology, the National Portrait Gallery and National Collection of Fine Arts, the Hirshhorn, Penwick and Freer galleries, the Air and Space Museum, and the Cooper-Hewitt Museum in New York City.

The opportunity to rectify that situation was presented to the Smithsonian when it decided in 1978 to build a $29 million storehouse in suburban Maryland. That facility, scheduled to open in 1983, will house essentially everything that is not on display in the Smithsonian's consortium of museums. Since only about one percent of the Smithsonian's collections are actually viewable by the public, that meant there would be an enormous amount that had to be stored -- and kept track of.

So, for the last three years, inventory technicians -- specialists in counting and recording -- have been filing Smithsonian computers with information about the number of locomotives, pieces of graphic arts, textiles, and even barges (there is one from the Battle of Lake Champlain) in the Smithsonian's possession.

Among those things recorded so far have been 14 million postage stamps, a full scale water-driven sawmill, a dozen or more Zuni Indian rabbit sticks (boomerang-like sticks believed to have been used to stun game), 65,000 medical science items, and 120,000 pieces of political history memorabilia, many of them campaign buttons.

The Smithsonian has saved the hides of street dogs, mountain lions and coyotes. They hang by the nose -- along with the precious pelts of river otters, seals and other large mammals -- in the Natural History Museum's fur vault.

Smithsonian personnel, whose attitudes toward the monumental task range from deadly earnestness to amusement, unanimousely emphasize that the project is much greater than a simple count. The vast and varied collection that has steadily grown fromthe time Smithson's dream was realized with the founding of the museum in 1846 never has been fully catalogued. The count is complicated by the fact that many of the items have not been properly preserved

Assistant secretary Paul Perrot said in an interview that discovery was actually "one of the byproducts of the inventory. . . We're determining the condition of our collections and realizing in a dramatic way that objects have alife of their own and unless properly housed will go the way of all flesh.

"Only in the last 10 years or so have we been confronted with the knowledge that conservation is more than just putting something in a reasonably dry place," Perrot said.

Alice Thompson, a staffer in the ethnology section of the Natural History museum's anthropology department, recently showed a reporter in the ethnology section of anthropology at Natural History, one drawer of exquisitely beaded woven baskets made by long vanished California Indians. All the baskets were carefully arranged and wrapped in plastic only because a graduate student used them recently for her doctoral research. Then Thompson opened another drawer nearby. The similarly valuable collection inside was jumbled and disorderly.

The story is the same everywhere in her department, located on the uppermost floor of the Natural history museum. There a musky odor -- familiar to anyone whose stumbled through an old attic -- wafts through arched doors that lead to the ethnology section, a storehouse of things collected from loving people. Shoshone Indian belts, Eskimo harpoons and arrows, knives and toys of bone and even snuffboxes are packed in overflowing drawers of left to gather dust atop full storage cabinets.

Why are such things kept in such profusion, even if some of them are worthless? "Partly because the collector collected them," answered Thompson.

Smithsonian registrar Philip Leslie says that items of no recognizable value in one era may be extremely important in another. He cites the museum's collection over the years of annual sediment deposits from the Potomac River Basin. They were taken at the time "out of scientific curiosity" only, he said. Now they have now become environmentally invaluable in studying pollution in the waterway.

"A fusty-dusty curators work is very important," Leslie said.

The inventory and new conservation effort is "something whose time has come," he said. "It's a result of the new awareness of the past 10 years that have led museums to say, 'Gee, I wonder exactly what we have.'"