SHEFFIELD — The Aragi family's dairy farm — the largest in the state — is special because it still exists and it isn't losing money.

Pine Island Farm is actually making money, not just by selling milk, but by selling power it generates from methane thrown off by cow manure. Nary a penny lands on the farm's electric bill, and the Aragis' sell the excess power to some local off-takers — like Ward's Nursery — at a discount through a state program called net metering.

It is for this reason and more that Pine Island, with its roughly 1,500-plus acres of pasture, corn and hay fields for cow feed — was just awarded Outstanding Dairy Farm of the Year in Massachusetts by the Green Pastures Program at UMassAmherst.

Holly Aragi, sitting in the farmhouse kitchen, never mentioned the award, but talked about the hard work of grant-writing and wading through a bureaucratic swamp to get $405,000 from the state Department of Energy Resources to upgrade National Grid's Sheffield substation, and to do line upgrades that will allow for a second generator to run the anaerobic methane digester that turns cow manure and food waste into electricity.

Holly and her husband Louis — whose father and grandfather started the farm in 1964 with 185 acres — got the digester and the first generator in 2011. Holly said it works like a human stomach.

"The main diet, so to speak, is cow manure," she said.

And food waste also goes into it to help the digestion along. Excess grains and other food from local producers like Guido's Fresh Marketplace and Berkshire Mountain Distillers is fed into the digester. And even Stonybrook Farms in Vermont sends its excess whey here.

The digester separates the liquids and solids, and out comes liquid to fertilize the fields and solids to bed some of the farm's 1,500 cows, of which about 564 are milked. The farm sells milk through the Dairy Farmers of America cooperative.

The cow bedding is critical, Holly said. If the generator, which runs 24/7, shuts down for maintenance or other reasons, trouble can stack up across the farm.

"Then we have big problems," she said. "It's a risk to the health of the cows."

And this is why they need the second generator — built to order — and due to arrive from Missouri next week. Holly said about 25 percent of the roughly $418,000 cost is covered by grants from the Massachusetts Clean Energy Center and the US Department of Agriculture's Rural Energy for America program.

"It's been a battle," Holly said of getting the local substation and line upgrades to handle output from the second generator.

But the upgrade will benefit the town, too, Holly said. "When there are power outages, we can say, `we just helped y'all out,' she joked.

In 2015 the farm also ran up against a state-mandated cap on net metering credits, as solar developers jumped in ahead of the farm, Holly said, taking remaining credits that could be sold to off-takers at discount.

That got sorted when the state raised the cap in 2016 and, Holly said, the farm was in line to throw more power onto the grid and sell the excess.

Masoud Hashemi, an extension professor at the Stockbridge School of Agriculture at UMassAmherst and the Green Pastures Program committee chairman, said while the number of dairy farms in the state rapidly decline, Pine Island is notable to the committee because it makes money and supports itself.

"Farmers are competing with cheap milk from other states, mainly California and Wisconsin," he said. "Big dairy in those states don't have a big market in China or other countries, so they compete with small states like Massachusetts."

He said this is the main reason so many dairy farms are going out of business, adding that the state is down to 140 dairy farms - in 2000 there were 450.

He said Pine Island, so far, skirts another modern trend.

"Unfortunately a lot of farmers are old and the new generation are not going to do what the parents did, so we expect even less [farms] in the next few years," Hashemi said.

He also said the cow herd at Pine Island is healthy, with each cow producing an average of 80 pounds of milk per day, high by dairy standards. And Hashemi praised what he said are the farm's environmentally sound practices.

"They are minimizing the impact of the animal operation on the environment," he said.

To do all this, the Aragis' have had to get scrappy — glitches are aplenty on the farm. Louis Aragi opens the kitchen door — he's splattered with manure-tinged mud from dealing with a loose valve that's keeping him busy, and says he has to go back.

Holly explains that this is what happens when you feed the digester too fast with some of that food waste.

"We saw the cows standing in yogurt and whey," she said. "But they were happy — it was nice and cool."

Reach staff writer Heather Bellow at 413-329-6871.