The male equivalent of the at-home pregnancy test may have just landed.

With a simple smartphone device and a chip that slurps up sperm, men can easily and cheaply measure the count and motility of their swimmers. The test is about 98 percent accurate, takes less than five seconds, and requires no training to run, Harvard researchers report Wednesday in Science Translational Medicine. It’s also cheap—the device and the microfluidic chip cost just $4.45 total to manufacture.

Researchers are hopeful that the invention will help couples trying to have children—as well as those trying not to. Worldwide, it's estimated that more than 30 million men face fertility issues at some point. And couples in developing countries or remote areas may not have easy access to fertility clinics. On the flip side, those who undergo vasectomies are encouraged to monitor their sperm counts afterward to make sure the procedure worked. A simple, mobile phone-based test could help both groups.

But it could be years before it’s available for sale. The authors will need to get approval from the Food and Drug Administration as well as commercialize it.

For the prototype, the researchers made a 3D-printed case that fits onto a smartphone—in their trials, they used Moto X, Moto G4, and LG G4 phones. The case has an LED, a pair of lenses from the pick-up heads of a DVD and CD drive, a cheap battery, and a dock for the microchip that lines up with the phone’s camera lens.

The disposable microchip has a little bulb that can draw in 35 microliters of a semen sample with a tube. When the sperm-loaded chip is slid into the smartphone case, it’s perfectly lit, magnified, and aligned for its close-up shots.

An Android app then takes one-second, 30-frames-per-second videos and processes each frame. With this information, the app can assess sperm count and motility.

In trials, the researchers used fresh sperm samples as well as cryopreserved ones. They also had trained and untrained users measure sperm, and they found no difference between the two groups.

Of 350 semen samples tested, standard methods found that 307 of them were abnormal. (That classification was based on standards set by the World Health Organization, which dubs semen abnormal if it has less than 15 million sperm per milliliter or if less than 40 percent of the sperm are swimming.) The smartphone-based test correctly classified 303 of those abnormal samples.

One big limitation to the fertility test is that it can’t detect deformed sperm, which can be critical to fertility. It also may miscount sperm if there’s cellular debris roughly the same size as sperm in the semen. The researchers say that better processing algorithms and upgraded optical hardware could overcome these shortfalls later.

But for now, the researchers are happy with the progress they’ve made with the device. “Its ability to accurately identify abnormal semen samples based on sperm concentration and motility can potentially shift the paradigm in male infertility management in both developed and developing countries,” the authors conclude.

Science Translational Medicine, 2017. DOI: 10.1126/scitranslmed.aai7863 (About DOIs).