Deep within a cedar forest in British Columbia, Dan Sutton is building what he hopes will be the most energy-efficient, high-technology greenhouse for growing cannabis. Spurred by the booming market for medical marijuana, he and a group of biologists and engineers have experimented for almost three years with digital sensors, lighting arrays, software programs and ventilators to design a greenhouse system with the lowest energy costs and highest crop yields.

“We said, ‘Let’s assume everything that’s ever been done in cannabis cultivation is wrong, and we have to build from the ground up,’” said Sutton, the 28-year-old managing director of Tantalus Labs in Vancouver. “We have this broad realm of science that no one has been able to previously explore.”

The startup is among a growing number of companies in North America designing new products and systems specifically for the cultivation of cannabis, a finicky crop that needs a precise balance of light, moisture and water to thrive. Although these cannabis ventures aren’t exactly reinventing the wheel -- greenhouse technologies have existed for decades -- they are injecting the kinds of capital and brainpower into the field of industrial agriculture that simply wasn’t there a decade ago.

They’re also adding a new level of urgency. As more countries and U.S. states soften their policies on both medical and recreational marijuana, companies are racing to become the industry leaders in data-mining software, ultraefficient lamps and water-sipping irrigation systems. These tools will benefit more than marijuana growers alone: Industrial food producers and tree growers could adapt the same technologies to cut energy costs and boost their crops. Operators of large buildings could use the systems to lower their electricity use.

“Cannabis is spurring on an ag-tech revolution,” said Troy Dayton, CEO of ArcView Group, a cannabis-industry research firm in Oakland, California. “This is a boom born entirely out of ending repressive laws. The market is already there, it’s just moving from the shadows into the light. That’s why you’re seeing this incredible growth and why so many people see it as a once-in-a-lifetime [business] opportunity.”

That market is rapidly expanding in the U.S., where 23 states have already legalized medical marijuana, and three states -- Alaska, Colorado and Washington -- allow recreational-marijuana sales. Voters in Oregon approved a ballot measure last fall that allows for personal pot use and limited cultivation. The policy takes effect July 1. In Texas, Ohio, Nebraska and a number of other states, voters and policymakers are considering similar initiatives. (In Canada, medical-marijuana use was legalized in 2001, and recent policy changes are enabling a rise in industrial growing operations.)

U.S. cannabis sales alone reached $2.7 billion in 2014, a $1.1 billion gain over 2013, ArcView Group found. Dayton said sales could grow 33 percent to $3.5 billion this year.

Technology developments in the cannabis sector focus primarily on interior cooling and ventilation as well as lighting, which together account for as much as 70 percent of the cost to grow a single gram of marijuana, by some estimates. Systems are being built to guzzle less electricity while producing greater volumes of crops. Others are being designed to automatically respond to changes in moisture, sunlight and temperature, so that cannabis grows in its optimal environment. Technologies also collect reams of data, allowing growers to tinker with their greenhouses and operations to find the best conditions for multiple cannabis varieties.

One of the leaders in this technology field is Heliospectra AB. The Swedish lighting firm began building cannabiscentric light-emitting-diode lamps three years ago. The company claims its model can shine brighter, last longer and cover more distance than do existing models. The light mounts themselves are tall and thin to allow more natural sunlight into the greenhouse, and Heliospectra’s software program lets growers control the intensity, spectrum and timing of the artificial rays.

Chris Walker, the firm’s U.S. general manager in San Francisco, said Heliospectra aims to make its lamps the dominant choice for cannabis growers and edge out the conventional high-pressure sodium bulbs used in most indoor and greenhouse operations. “All of our expansion plans are geared toward building commercial lamps that do just that,” he said.

Companies such as Heliospectra are moving into the cannabis space for three key reasons -- first and foremost, cash. Unlike tomato and pepper producers, cannabis growers boast wide profit margins, giving them a bigger budget for top-of-the-line technologies and a greater appetite for research and experimentation.

“We have an opportunity to play in a space with beautifully broad margins,” said Sutton of Tantalus Labs. “That’s not true of most food production.” A tomato producer in a greenhouse might earn roughly 10 percent profit on its revenue, before operating costs, while a cannabis grower in a similar setup could rake in as much as 80 percent, he estimated. “With tomatoes, if you take on an extra 5 percent on your bottom line to experiment with new technology, that could affect your competitiveness,” he said. This isn’t the case with marijuana.

Second, young technology whizzes and expert plant biologists are both bringing their skills to the burgeoning sector. “For the newer generation that’s just getting out of college or new to the workplace, cannabis is a more interesting project than say a real-estate project, or a lettuce project,” said Michael Mayes, CEO of Quantum 9 Inc., a Chicago consulting firm for cannabis cultivation and manufacturing. “The cool factor can drive innovation.”

Third, there is plenty of demand among growers. As they build new greenhouses and indoor facilities, they’re interested in shaving off as much electricity and water consumption as possible to reduce operating expenses and protect profit margins as more players enter the market.

“Operators with an eye toward the future are trying to get ahead of the pack now, so that in five years, when the landscape is entirely different, they’ll have a competitive advantage,” said Zev Ilovitz, president of Envirotech Greenhouse Solutions in Richmond, California, which designs and builds greenhouses for cannabis growers.

Dayton of ArcView Group said the cannabis industry is still in the earliest stages of its technology “renaissance,” and that the only thing holding it back are prohibitive marijuana policies in certain states.

Even so, the gradual easing of cannabis laws is already drawing interest from mainstream businesses, including a subsidiary of Scotts Miracle-Gro Co. The company’s Hawthorne Gardening Co. in April purchased General Hydroponics Inc. and Bio-Organic Solutions Inc., which make liquid nutrients for indoor marijuana cultivation. Terms were not disclosed, but the acquisition should make Scotts, with its $2.97 billion in annual revenue, a formidable player in the marijuana market.

Back in the woods of British Columbia, Tantalus Labs is nearly done building its 120,000-square-foot greenhouse. Sutton said the multimillion-dollar facility is substantially more expensive to build than a typical greenhouse of this size, but he expects the savings in energy and water bills will help offset the difference.

When completed, he imagines the greenhouse design could eventually be used to grow other types of plants, such as the tree saplings used for British Columbia’s $15.7 billion forestry industry. His uncle, Ben Sutton, who is the startup’s science officer, previously founded a company that specialized in growing seedlings in a greenhouse for reforestation.

“There’s so much crossover. The production cycle is similar, and you need a tightly controlled environment,” the younger Sutton said. “The business of growing saplings will benefit from innovations that come out of the cannabis industry.”