– On the second floor of an infectious-disease research facility in this African capital, Dr. Joseph Kamgno, the country’s leading expert on parasitic roundworms, stood at his desk staring down at the black, hard-shelled case that had just arrived from a bioengineering lab at the University of California, Berkeley.

The case contained what appeared to be three ordinary iPhones. But the California researchers believed these phones could do something extraordinary — help quell river blindness, the second-leading cause of preventable blindness in the world.

There is already an effective treatment, a medication that can kill the baby worms that cause the blindness. And when nearly everyone in a community takes the drug every year for a decade or so, it can eliminate the disease from the area.

But treating communities widely for river blindness is a risky proposition: The treatment can cause coma or death in a small segment of the population that harbors a different parasite — another worm known as Loa loa. That’s why large swaths of sub-Saharan Africa have been denied treatment for nearly two decades — because the cure for river blindness for certain people can prove far worse than the disease.

And that’s where Silicon Valley technology comes in. The Berkeley researchers figured out that they could quickly determine who has the Loa loa worm using a smartphone, customized to work like a microscope. They could then skip the medication for those people and give it to everyone else. Kamgno, who received the latest version of the phones in 2016, dubbed the mobile microscopes “revolutionary.”

The gadgets, called LoaScopes, are part of a broader effort to harness technology and innovation in the U.S., including California’s Silicon Valley, to fight age-old diseases in the developing world.

Over the years, major California universities — UC Berkeley, UC Davis, UCLA — have built cellphone microscopes geared to look at other blood borne diseases in Africa and Asia, such as malaria and tuberculosis. UC San Francisco researchers are using satellite images on Google Earth Engine to construct real-time maps of breeding conditions for malaria that can help predict infection rates in rural villages.

Drones are being used to deliver medical supplies to remote villages in Rwanda, and digital “ledgers” built with blockchain software could be used to track vaccinations in newborns, said Zvika Krieger, technology and policy expert at the World Economic Forum Center for the Fourth Industrial Revolution.

To accomplish their missions, nongovernmental and civil society organizations “are flocking to Silicon Valley,” he said.

The LoaScope was created in UC Berkeley’s Fletcher Lab. Basically, the camera on the phone is positioned over a magnifying lens to capture a sample on a slide. Software can then analyze whatever is on the slide and transmit it to the cloud.

Standard light microscopes aren’t really mobile, and require electricity and a trained lab tech to operate. The mobile microscope is cheap, compact and can be used by anyone familiar with mobile phones, which are increasingly common around the world, even in remote villages.

“We were surprised and happy to see that after only two days of training, the local people were able to do the treatment in their own community,” said Kamgno. “Almost all the young people have cellphones, and they can understand the LoaScope so quickly.”