All that Ray P. Smith Jr. wants to do is help solve the nation's energy problem and make a few bucks along the way, and if that isn't in the great American tradition, what is?

He didn't reckon with the labyrinth of federal regulation, though, and it has trapped him.

Smith, a Williamsport, Pa., automotive parts designer, has developed a small attachment for automobile engines that makes a beeping tone to let motorists know when they are wasting gasoline by poor driving techniques, such as stomping too hard on the accelerator.

It sells for $39 retail.

The American Automobile Association's traffic safety director, Dr. Francis Kenel, believes it can help an average motorist cut gasoline consumption by 10 to 20 percent and had endorsed the device.

Smith also has a letter from the National Bureau of Standards saying that the device "is technically sound and commercially competitive . . . and can lead to significant fuel savings."

The endorsement Smith wants, however, is from the Environmental Protection Agency's test center in Ann Arbor, Mich., certifying that the device can help motorists save gasoline. The center, whose main job is testing compliance with the government's mileage and emissions, standards, also runs tests in private inventions like Smith's, as time permits.

Smith's problem is that he has to pass the test; he needs the government seal of approval to market his product. But even EPA officials admit that their test doesn't fairly measure his device, so he can't pass it. Smith is stuck.

Without EPA's endorsement, Smith's sales are suffering, he says, because large retail stores are wary of the professed energy-saving gadgets that have flooded the market since last year's gasoline lines. EPA and the Federal Trade Commission have publicized warnings about the performance of so-called energy savings devices, and while they haven't indicted Smith's, he feels he is suffering from guilt by association. Between 6,000 and 8,000 of his devices have been sold, but not many in the United States, recently. "EPA and the FTC are saying, don't buy until they say it's O.K.," Smith says.

But Smith says he can't get fair test from EPA. His device was installed on cars and tested twice on EPA's Ann Arbor dynanometer, a kind of treadmill over which a car can be driven in place while exhaust emissions are measured and analyzed. The tests so far show little improvement in gasoline consumption.

The negative results mystify Peter Hutchins of the EPA's Ann Arbor lab. He believes that the device logically has to help motorists reduce gasoline consumption. The results have set him wondering about the accuracy of EPA's tests.

By all accounts, Smith is a victim of regulatory whiplash. If the government was not in the business of testing energy saving devices, he would market his invention -- called Gastell-- and it could sink or swim on its own.

THE EPA tests, it turns out, are not designed to evaluate a device like Gastell that is supposed to change a driver's behavior. What the Ann Arbor tests measure is performance of automotive engines.

Even so, Hutchins' superiors at EPA have so far refused to authorize tests outside the lab that would show how it affects the on-the-road mileage of typical motorists, because EPA says it doesn't want to set a precedent by that kind of testing.

The impasse has generated a letter of protest from Milton D. Stewart, chief counsel for advocacy at the Small Business Administration. He wrote in June to EPA administrator Douglas Costle that the testing situation "raises serious questions about the federal role in promoting or postponing widespread usage of critically needed energy conservation technology."

Smith also has a sympathizer in Hutchins, at EPA's Ann Arbor test lab.

Hutchins explains that EPA, with a limited staff, is not equipped to test all the inventions that leap from the minds of America's basement inventors. "In the past 18 months, everybody and his brother was coming up with off the wall gismos," says Hutchins.

But Smiths' Gastell seems, logically, to offer real promise, he said.

It is based on a well-known instrument called a vaccum guage that monitors the volume of air mixing with the gasoline prior to combustion. The ratio of air and gasoline is a delicate, critical factor in efficient engine operations. A motorist who accelerates too quickly provides an overdose of gasoline to the engine, wasting some of the fuel and increasing the pollution coming out of the exhaust pipe as well.

For years, sports car drivers and other car buffs have purchased vacuum gauges to improve driving techniques, but most motorists would find it hard to watch the gauge closely and still keep their eyes on the road.

Smith's device adds one refinement -- a beeping tone that goes on when the air-fuel mixture falls below an efficient ratio. The sound reminds a motorist to ease up on the accelerator, or shift into the proper gear.

A motorist who is serious about saving fuel can achieve significant improvements by listening to the beep, says Dr. Kenel of the AAA. (Those who aren't may find the beep as annoying as the seatbelt warning buzz.)

But in EPA's tests, skilled operators put cars through predetermined driving programs on the treadmill, closely following instructions on when to accelerate and ease back on the gas. According to Hutchins and other authorities, the basic test doesn't resemble the stop-and-go driving that motorists routinely encounter, when the opportunities for fuel savings are greatest.

And there Smith sits, angry and sore-headed from butting against the bureaucracy, an inventor of a square peg who has to push it through a round hole.