One of the most useful technologies of the Star Trek universe — the all-knowing medical tricorder that can diagnose diseases in a snap — is now centuries ahead of schedule.

This week, the Qualcomm Foundation, along with XPRIZE Foundation, announced the winning team of its nearly four-year-long global competition to develop a functional, easily usable tricorder, the Final Frontier Medical Devices team out of Pennsylvania. For their efforts, the team received the top prize of $2.6 million, while runner up Boston-based Dynamical Biomarkers nabbed $1 million.

Final Frontier’s victory is definitely an underdog story. Led by Dr. Basil Harris, a Philadelphia emergency room physician, the team was mostly made out of family and friends Harris coaxed into volunteering their free time on the weekend. By contrast, Dynamical Biomarkers had 50 scientists and programmers, mostly paid, and was sponsored by the Taiwanese government and Taiwan-based cellphone company HTC.

The device kit developed by Final Frontier, called DxtER, uses non-invasive sensors that collect data from the user and combines that with an AI frontloaded with information in the field of clinical emergency medicine to come with a diagnosis. The device currently operates on an iPad tablet, but future versions should work equally fine on a smartphone as well. The device, ideally, would allow patients to then send their readings to their doctors so they could collaborate on their health care.

In the final head-to-head competition, the devices were told to reliably diagnose 12 medical conditions such as diabetes and Hepatitis A, as well as the absence of disease. They also had to measure five vital health signs, such as blood pressure. Neither team achieved perfect scores when it came to diagnosing and accuracy, but both surpassed the benchmarks for “user experience.”

According to an interview Harris held with the Washington Post, DxtER can diagnose up to 34 medical conditions in its present design. The device developed by Dynamical Biomarkers could reach up to 50, team leader and Harvard Medical School professor Chung-Kang Peng, told the Post, given it surpasses the five-pound weight limit imposed by the competition guidelines.

The foundation will continue investing, to the tune of $3.8 million, in taking tricorders from prototype to consumer product. That will include providing both teams with funding for more trials needed to secure approval from health agencies, and funding a documentary on the projects directed by Morgan Spurlock of “Super Size Me” fame. The Roddenberry Foundation, named after Star Trek creator Gene Roddenberry, will also invest $1.6 million to help the devices reach the developing world.