When Deane Lewin looks out across his pumpkin fields at the 18 homes in the Sunwood of Wading River subdivision, he’s staring at one of his biggest headaches.

Lewin farms 500 acres of flowers and vegetables northwest of Riverhead. Like much of eastern Suffolk County, his neighborhood is rural – with clumps of houses popping up here and there like dandelions. Natives call them “potato houses,” because they so often are perched on the edge of Long Island potato fields.

“This is kind of a sore thumb for us,” Lewin said, looking out at the subdivision. “Out in the middle of nowhere, the town gave the guy permission to build on 18 acres.”

Sunwood at Wading River sits smack in the middle of Lewin’s farm, on land he once leased from another owner. Now it is a source of complaints from residents who thought they would like to live near a farm, but don’t like it when a helicopter sprays the crops at 5 a.m.

“You can’t have agriculture next to development in this day and age,” Lewin said. “It just doesn’t work. We make noise and we make dust at odd times.”

Lewin’s problem is a common one for farmers in fast-growing places like Suffolk County, N.Y., and Palm Beach County. In those areas, farms and suburbs coexist, if sometimes uneasily.

John Thomas runs a large, multistate vegetable operation, including 2,000 acres in Palm Beach County’s Agricultural Reserve. He’s been practicing the art of adjustment for 3 1/2 decades.

“We’ve gotten used to it,” Thomas said. “If we’re going to run tractors all night somewhere, we don’t run them next to houses. … If you know what you’re living next to, you coexist.”

Five years ago Tony D’Angelo, 39, moved his family from Smithtown, N.Y., to a spacious new home in the rural Suffolk County community of Baiting Hollow. His yard abuts a field of corn and potatoes.

“It’s pretty neat,” D’Angelo said. “The kids see the tractors, they see the change in seasons. I think it’s very peaceful.”

But it might not be so peaceful if his farmer-neighbor, Ed Sujecki, didn’t take pains to make it so. Sujecki is careful about when he runs his tractors, and he has planted a strip of corn around his fields to limit dirt and noise.

“That gives us a little privacy and them a little privacy,” Sujecki said. “If somebody’s having a pool party, they don’t want you out there making dust.”

Doug Corwin’s troubles are more bothersome than dust. Corwin, 35, is president of Crescent Duck Farm in Aquebogue, east of Riverhead. Since 1908, his family’s hundred-acre farm on Meetinghouse Creek has produced Long Island ducks for some of the finest restaurants in the Northeast.

Once the farm, which has been in the Corwin family since the 1600s, was far out in the countryside. Now homes have been built right up to the front gate.

“We’re a very visible, old-time concern out here,” Corwin said.

The 900,000 ducks a year Corwin raises put out a lot of waste, and neighbors lately have complained of a fearsome stench. At one time, the odor was minimal because the waste was simply dumped into a creek. Now it is processed at a sewage treatment plant on the Crescent property.

Earlier this year, several neighbors petitioned the health department for help.

“The odor wakes you up inside your house,” Alex Galasso, who works at a nearby marina, told Newsday last spring. “It’s really gotten progressively worse since they stopped discharging into the creek in 1987.”

Corwin has done his best to clean things up, changing the ducks’ feed, adding odor-reducing chemicals to the water, covering open ditches and constructing a filtration marsh.

“I’ve had to be very, very concerned about my odor situation,” Corwin said. “The ducks used to wander around outside. We can’t do that anymore because of the noise and pollution.”

In 1982, Suffolk County adopted a “right-to-farm” law that was supposed to protect farmers from complaints. The troubles of Lewin, Sujecki and Corwin show it hasn’t always worked.

Palm Beach County, too, is trying to help farmers.

Earlier this year, county commissioners voted to permit farming in residential zones; the practical effect is to limit the ammunition neighbors can use to complain about farm neighbors.

Further code changes will exempt farmers from certain urban-style rules such as setback and landscaping requirements, and promote more types of farm activities in the Agricultural Reserve.

Still, when farmers and homeowners come into conflict, experience has shown that farmers usually are the ones to give.

“We’re being squeezed by regulation and by urbanization, and we’re going to have to learn to live together,” said Richard Machek, vice president of the Palm Beach County Farm Bureau. But he also said, “Agriculture and population are always going to be at odds.”