Since it was released in 2015, Apple Watch has always included a heart rate sensor. But to screen for atrial fibrillation, Apple needed to do more: It needed to monitor the heart’s rhythm.

To do that, the company used a combination of both hardware and software tools.

It works by combining LED lights that flash hundreds of times each second and light-sensitive semiconductor devices to detect the quantity of blood flowing through the wrist. These sensors gather these signals from four points on the wrist. The software algorithms then look for patterns to isolate irregular heart rhythms.

If the Apple Watch picks up on a problem, those who participate in the study will get a notification and an offer of a free consultation, via a phone call or video, with a remote doctor. These virtual visits are provided by American Well, a privately held company.

The doctor will run through some standard questions and suggest a visit to the emergency room for further tests, or send the subject a patch called an electrocardiogram or EKG, which is considered the gold standard for diagnosing atrial fibrillation.

Longer-term, a company called Alivecor is developing an interchangeable Apple Watch band with an in-built EKG to detect atrial fibrillation and other conditions.

It remains to be seen whether Apple will work with insurance partners to provide a discounted or free device to those who can’t afford an Apple Watch. It recently held meetings with Aetna to nail down a strategy to provide watches to millions of its members.

Because the study is based on a mobile device, anyone can sign up regardless of their proximity to a medical center. Williams described it as “a bit of a breakthrough in that it’s a virtual clinical trial,” which will be broadly available to a large population.

That’s unique and will help dramatically increase the people who can participate in the study. But it also means the company will need to show that it isn’t sending healthy people to the hospital armed with data from an Apple Watch. That’s a big challenge, medical experts say, because testing or screening a healthy population always carries with it a risk of false positives.

“We may all have a little of it, if we start looking for it,” said Dr. Harlan Krumholz, a cardiologist and director of Yale-New Haven Hospital Center for Outcomes Research and Evaluation. He added that the medical system is not yet equipped to handle such information.

A potential abnormality in an otherwise healthy young person could require further tests and procedures, for instance, or it could it resolve on its own. Doctors don’t necessarily know.

But Dr. Lloyd Minor, Stanford’s dean of medicine, said his team has been “very thoughtful in how we’ve set up this research study,” and that he doesn’t think it will lead to false positives.

Despite his concerns, Krumholz said studies like this represent a “new era of medicine,” where clinical research is open to anyone, regardless of their medical diagnosis, physician or proximity to a physical site.