Image copyright Ian Shanks Image caption Prof Shanks said he was relieved his 13-year legal battle to get compensation was over

A scientist has been awarded £2m compensation by the UK's highest court for his invention of pioneering technology to test blood sugar levels nearly 40 years ago.

Professor Ian Shanks developed the system, used by many diabetics, while working for Unilever in the 1980s.

The rights to his invention belonged to the company and until now he was not entitled to a share of the benefits.

Prof Shanks said he was relieved by the result, after a 13-year legal battle.

While working for a subsidiary of multinational giant Unilever in Bedfordshire in 1982, Prof Shanks developed new technology to measure the concentration of glucose in blood and other liquids.

Using plastic film and glass slides from his daughter's toy microscope kit and bulldog clips to hold it together, he built the first prototype of what is now known as the electrochemical capillary fill device (ECFD).

His ECFD technology eventually appeared in most glucose testing products, which are used by diabetics to monitor their condition.

'Thirteen-year slog'

Prof Shanks first applied for compensation in 2006 but lost every step in his legal battle until it reached the Supreme Court.

On Wednesday, the court unanimously ruled that Prof Shanks's invention had provided his former employer with an "outstanding benefit" for which he should receive compensation.

Judge Lord Kitchin said the rewards Unilever enjoyed "were substantial and significant" and Prof Shanks was entitled to a "fair share" of the company's net benefit of around £24m from the patents.

Speaking after the ruling, Prof Shanks, who lives near Dundee, said he was pleased his "13-year slog" to get compensation was over.

However, the 72-year-old told the BBC the legal battle was not "without its costs" and had caused him a great deal of stress.

"In 2007 I had a heart attack - which wasn't at all helped by the strain I was under," he added.

Image copyright Getty Images Image caption A finger-prick blood test is one way someone with diabetes can check their blood sugar levels

However, he said his persistence was driven by a desire to help future inventors, rather than for his own financial reward, adding that most of the compensation would go towards his legal costs.

"I would much prefer that employee inventors believe that if they do something that turns out to be really profitable and significant, they may actually stand a chance of getting an award," he said.

When he first applied for compensation, he said not one employee inventor had benefitted from the provisions of the Patents Act, introduced 30 years earlier.

The Act entitles workers who invent something from which their employer gains an "outstanding benefit" to a "fair share" of these benefits.

Prof Shanks added that he felt great pride for his invention which he said had probably helped several hundred million people living with diabetes.

Outlining the background to the case, Lord Kitchin said Prof Shanks accepted that the rights to his inventions belonged to Unilever, but argued that he was still entitled to compensation.

The judge said Prof Shanks' ECFD technology became something most significant companies in the field were willing to pay millions of pounds to use.

Prof Shanks had argued at an earlier hearing that, while Unilever ultimately received around £24m from the patents, the company could have earned royalties for "as much as one billion US dollars" had his invention been "fully exploited".

A spokesperson for Unilever said the company was "disappointed" with the decision to award Dr Shanks "a share of the licence revenue obtained by Unilever in addition to the salary, bonuses and benefits he was compensated with while employed to develop new products for the business."