And getting the sperm count? Of course, there’s an app for that. The software is designed with a simple interface that guides the user through the test with onscreen prompts. After the sample is inserted, the app can photograph it, create a video and report the results in less than five seconds. The test results are stored on the phone so that semen quality can be monitored over time.

The inventors hope to have the device approved by the Food and Drug Administration within the next two years.

“We recruited untrained users with no science background and had them test the device using semen samples, and then measured the accuracy,” said the senior author, Hadi Shafiee, an assistant professor of medicine at Harvard. “It’s just as easy as a home pregnancy test.”

“Couples try to conceive,” Dr. Shafiee added. “They get stressed out. They talk to friends. There are ovulation test kits for women, but so far nothing for men. With this device at home, a man can avoid the embarrassment and stress of providing a sample in a doctor’s office. This can be the next step.”

Dr. Shafiee said the device could also be useful for men who get vasectomies, who are supposed to return to the urologist for semen analysis twice in the six months after the procedure. Compliance is typically poor, but with this device, a man could perform his own semen analysis at home and email the result to the urologist.