File photo: The device could also be used by men who have had a vasectomy to test that the operation was successful. Picture: AP

Men trying for a baby will soon be able to check their fertility with a smartphone app.

Instead of the "stress and embarrassment" of attending a clinic, they can test the chances of fatherhood in their own home.

The "analyser", which is not yet commercially available, costs around £3.50 (about R50) to make out of plastic on a 3D printer. Such a test would cost around £150 to £200 in a private clinic.

Researchers claim the device, which analyses sperm in less than five seconds, makes a male fertility test as simple as a home pregnancy test. They hope it will lead more men to find out whether they may have a problem.

The analyser – which was found to be 98 percent accurate – has an optical attachment that connects to a smartphone and uses the device’s camera to video the swimming sperm, which are held in a disposable container. It can give an accurate assessment of a man’s sperm count, as well as levels of concentration and mobility, according to a study published in the journal Science Translational Medicine.

The device could also be used by men who have had a vasectomy to test that the operation was successful.

Dr Hadi Shafiee, of Brigham Women’s Hospital in Massachusetts, said: "We wanted to come up with a solution to make male infertility testing as simple and affordable as home pregnancy tests."