On a hot, swampy November afternoon at IMG Academy in Bradenton, Florida, the private school’s boys’ lacrosse team is huddling around the bench draining water bottles after a round of drills. It’s a scene like any other on high school fields around the country . . . except here there’s a small crew of men sitting off to the side with laptops, running diagnostics on the team’s fluid intake, tracking each player individually through smart chip–enabled refillable water bottles.

Each “smart cap” bottle is digitally linked to a specific player. It works with an app to calculate how much he sweats in an average practice, how much sodium he loses, and how much he needs to drink to maintain optimal performance. Each bottle is filled with a drink formula that corresponds to an individual player’s sweat type. A microchip and a small turbine in the spout measure how much he takes with every sip. LED lights on the cap help him pace his drinking, showing whether he’s ahead of or behind his target. This is the future of athletic hydration. It’s also the future of Gatorade.

The brand’s new high-tech focus can be traced back to senior vice president and general manager Brett O’Brien’s decision in 2014 to build an internal innovation unit to look beyond bottle shapes and new flavors and toward a higher mission. After all, something had to be done. Gatorade sales in the first half of 2009 had fallen 18% year over year; new competitors such as VitaminWater, Red Bull, and Monster had gained influence and market share; and the product, born 50 years ago in a University of Florida lab as the original sports specialty drink, had become known more as a hangover helper than a high-performance elixir. O’Brien and the innovation group set about getting Gatorade back into shape, transforming it into an elite sports brand on par with Nike and Under Armour. “It’s not just about capturing a bigger part of a marketplace,” O’Brien says. “It’s about filling a void for your consumer, and ours are athletes.”

Gatorade started by looking at how athletes were already using its products. For instance, pro athletes had long been mixing sodium powder packs and other additives into their Gatorade (the brand even makes its own, called Gatorlytes). Now the company is looking to cut out the extra steps by creating 12 different formulas served in small egg-shaped pods that mix with water—to be used in new bottles featuring the smart-cap design. The formulas will range in carb, calorie, and electrolyte levels to optimize fluid recovery. To know which formula is right for which athlete, the brand has developed a suite of products and technologies that work together to measure and track individuals’ data. A smart scale linked to a tablet and software, for example, catalogs a player’s weight, along with training time and intensity, to make fluid and carb-intake recommendations. A patch, like a near-field communication chip-enabled Band-Aid, will analyze a player’s sweat and communicate with the digital platform to identify his sweat type—which will determine sodium, electrolyte, and additional fluid-intake needs.

All of this technology was developed in conjunction with the brand’s nutrition-minded Gatorade Sports Science Institute, fueled by PepsiCo’s 40% increase in R&D spending between 2011 and 2014. Now Gatorade is testing it on the field with top high school, college, and pro athletes, including the Brazilian national soccer team, the Kansas City Chiefs, the Boston Celtics, FC Barcelona, and the University of Florida. For Kansas City Chiefs wide receiver Jeremy Maclin, the idea of customized hydration is intriguing. “I don’t think there’s any athlete on this earth who wouldn’t take an advantage if proven to work,” he says.