It was little wonder that he had shivers down his spine as he held the tiny, postage stamp-sized device in his hand for the first time. He had created it and it had the potential to save thousands of lives. His one regret, he says now, is that he forgot to shout “eureka”.

If he was dumbfounded at his eureka moment Richard Middlemiss of Glasgow University makes up for it in his eloquence and humour in describing what this small and cheap gadget - so small it can fit inside a golf ball - which enables scientists to look deep underground.

“It lets you see landmines before they kill people, volcanoes before they go off,” he says. And he cites the death toll. Fifteen to twenty thousand people a year killed by landmines. In 2008, 90,000 killed in China in a volcano eruption, 23,000 dead in Columbia in the same way three years before.

It also has more mundane and commercial applications. In oil exploration it can map potential fields, it can also detect sink holes, heat sources and water sources. It will also revolutionise how road repairs are done - as Middlemiss says “one-in-five holes are dug in the wrong place” – making pointless disruption a thing of the past. Another use is archaeology, detecting tombs, old crypts, “anything that involves a change of mass”, as Middlemiss puts it.

At its heart, the tiny gizmo (its sensor is carved from a sheet of silicon 0.2mm thick) is an extremely accurate tool to log gravity changes. It measures the tiniest of fluctuations - so that, for instance, it can locate a buried pipe by comparing the absence of gravity inside with that of the surrounding earth. Helpful for civil engineers to prevent them wrongly digging up your street.

They could also be scattered around volcanoes to check activity and predict their eruptions, saving thousands of lives, or over suspected minefields where the different densities of the mines to the earth and material around them could be be picked up and the mines removed. This is what Middlemiss was aiming for when he started on the project.

Technically it is a minituarised gravimeter. The conventional version costs upwards of £70,000, is extremely cumbersome and, at its lightest, is the weight of a car battery. Which means that today it has to be dragged around a volcano, taking thousands of snapshots.

Middlemiss has already reduced the machine's size to the dimensions of a grapefruit and he is sure that it can be brought in at golf ball size - or that of your iPhone. “There's no reason it can't be minituarised to the size of a mobile phone,” he maintains. And it will cost about the same as well.

At the heart of its workings are smart little electromechanical gubbins called accelerometers, found in smartphones, which, using tiny springs, detect gravitational change when you turn your phone upside down and then quickly adjust the screen to bring you back to earth.

"The difference between the mobile phone accelerometers and our device is that our springs are very, very thin – about 10 times thinner than a human hair.”

And whereas your phone accelerometer is only activated by something as big as the gravitational pull of the earth, the Middlemiss device is “almost at the point of being able to detect the gravitational pull of a human standing beside you”.

It's the result of Middlemiss's commitment and talent and the pooling of expertise in physics and engineering at Glasgow University, involving Professor Doug Paul of the James Watt Nanofabrication Centre, and Giles Hammond from the Institute for Gravitational Research. “They have decades of experience of making very small devices made out of silicon,” says Middlemiss paying tribute, adding that it would have been impossible without them.

To begin with Middlemiss and the team tested the contraption by measuring the earth's tides over a period of several days. He explains: “What you think of as the whole solid earth is actually elastic and changes its shape slightly every 12 hours 25 mins, the crust goes up and down.” Tidal forces, caused by the interacting pull of the sun and moon, not only drag the oceans up and down but slightly squash the Earth's diameter.

"It's not a very big squeeze, but it means that essentially Glasgow – or anywhere else on the earth's surface – goes up and down by about 40cm.”

The colleagues were able to measure these changes over a week and more, a first, which proved that the device was stable. This month it will begin its first field tests.

Middlemiss has something else to celebrate. Last month the post-graduate student passed the oral examination, the viva, for his doctorate. He's eloquent, passionate, able to convey complex ideas simply, and has the perfect skills and appearance for popular TV science programmes. Brian Cox should be looking over his shoulder.