The following correction was printed in the Guardian's Corrections and clarifications column, Tuesday January 25 2005

In the article below, we may have given the impression that among rival contenders for the title of inventor of the cash machine, the ATM, the name of Jim Goodfellow was missing from discussion of the matter on atmmachine.com. In fact it is not. The relevant section says: "Who invented the idea of an ATM? We believe it was Luther George Simjian. Who invented the ATM as we know it? We have to think it was James Goodfellow in Scotland for holding a patent date of 1966. Who invented the free-standing ATM design we recognise today? We think it was John D White for Docutel in the US."

When Jim Goodfellow read earlier this month that John Shepherd-Barron had been awarded an OBE in the New Year's Honours list, his hackles rose. "I don't want to run him down," says Goodfellow. "I have no problem with him receiving an OBE."

What he does have a problem with, though, is the claim, made repeatedly in newspaper reports, that Shepherd-Barron invented the cash dispenser. The stories reignited a rivalry between the two men that had been dormant for four decades. "For him to go down in history as the inventor of the ATM really stuck in my throat," says Goodfellow. "It is one thing for him to be awarded an OBE for services to the banking industry, but not for him to be portrayed as the inventor of the ATM. I have never bothered with this thing for 40 years, so it was a shock when it said he invented it. It's not sour grapes. He invented a radioactive device to withdraw money. I invented an automated system with an encrypted card and a pin number, and that's the one that is used around the world today."

Shepherd-Baron, though, retorts: "I don't know him, so good luck to the fellow, but it's clear that the difference between Goodfellow and us was that we thought through the whole system concept, and that was important to the banks who bought it. His invention reminds me of the hovercraft, an elegant failure. They didn't think through the performance specification for the hovercraft - it could work in three-feet waves, but not five feet, which is why it didn't become the global success it could have been."

The men have much in common. Both are Scottish (Goodfellow lives in Paisley, Renfrewshire; Shepherd-Barron in Tain, Ross-shire). Both were engineers (Goodfellow for Kelvin Hughes, part of Smith's Industries; Shepherd-Barron for De La Rue, the banknote manufacturer). Both are icons of British ingenuity of the kind that, as James Dyson recently lamented, no longer exist in sufficient numbers. Both, in the mid-1960s, were called on to devise a way of enabling customers to withdraw cash from banks when Saturday opening ended. Both came up with ingenious solutions.

Only one, though, has been feted by the establishment. "The Queen invited me to a British pioneer lunch once," recalls Shepherd-Barron. "And in 2003 I went to a palace reception for pioneers and inventors. I'm not sure which one they thought I was, but I was sitting next to Nobel prizewinners so it was very grand.

"I don't even know who put me up for the award," giggles Shepherd-Barron. "The bumf I got said I was put forward by the 'financial services industry'. Perhaps you could find out who they are." He also says that the Discovery Channel has made a film hailing him as the inventor of the ATM.

For his part, Goodfellow points out that if you do a Google search for "ATM inventor", the third item in the results list indicates that it was he who invented the ATM. "Among my friends and family, it's known as Jim's money machine," he adds. Goodfellow recalls that when he was a 28-year-old engineer, the Midland Bank asked Kelvin Hughes to dream up something clever to overcome customers' weekend liquidity problems. "We considered lots of different ideas - systems based on retinal scans and fingerprints, as well as voice-recognition machines, but they weren't technically feasible at the time."

Instead, he devised an automatic teller machine inspired by chocolate bar dispensers, and patented it. But, Goodfellow says, his big idea was the personal identification number, or pin, which was punched into a keypad outside the bank. "There was an arithmetical relationship between that number and the number encoded on the card by means of a series of binary codes. If the two numbers matched up you got your money. The idea was that if you alone knew the pin, there could be no fraud."

Initially, banks insisted that the card should be retained by the machine each time it issued money as they were sceptical about such electronic transactions. Later, Goodfellow and his team programmed cash-dispensing machines to give customers three shots at their pin number before the bank retained the card. Of course, this was in the innocent days before gangs of so-called shoulder surfers would serve to make pin numbers less than foolproof.

At the same time, Shepherd-Barron was developing a rival device, which used what are known as soft beta emitters, for De La Rue, in response to a request from Barclays. In fine Archimedean style, the idea for the radioactive card came to him in the bath. Did he yell "Eureka" and reach for a towel? "It wasn't quite like that." Rather, Shepherd-Barron thought about the tokens used by lorry drivers to buy petrol from dispensers at Shell garages and decided that if a cheque could be encoded with the aid of a radioactive chemical called carbon-14, it could be inserted into a hole-in-the-wall machine in a similar manner, enabling customers to withdraw cash. "Bank customers who wanted them would be issued with these special cheques, and the money would be debited from their account through the cheque clearing system," he says.

The fruits of of Shepherd-Barron's labours were unveiled at Barclays Bank in Enfield, north London, in all the impressive ceremony that Reg Varney, star of the sitcom On the Buses, was able to bring to such an occasion. His machines dispensed - imagine! - batches of 10 £1 notes. It was, after all, 1967. Shepherd-Barron says that his system also had a keypad and a pin number.

Goodfellow, though, says that he applied for a patent for his ATM machine in May 1966, a year before the Enfield Barclays ATM machine came into service. By contrast, De La Rue decided not to patent Shepherd-Barron's device. "We wanted to keep carbon-14 secret from potential forgers," recalls Shepherd-Barron, who also argues that had Kelvin Hughes thought it worthwhile to sue De La Rue for appropriating their patent, it could have done. "They were a bright bunch of cookies, so if they thought they could have won the case they would have tried."

At the time, neither system was linked to computers. "Mine was the first," claims Shepherd-Barron, "even though it was overtaken by online versions later."

So who invented the ATM machine? Dispiriting news for the two Scottish contenders comes from atmmachine.com, which surveys the pretenders thus: "Many people have claimed to be the inventor of the ATM. Some believe that Luther George Simjian did it. Some believe it was Don Wetzel." Who the hell, you might well ask, are they? Simjian registered 20 patents related to his proto-ATM device in 1939 and persuaded what is now Citicorp to give it a trial. They reported back that there was no demand for the device. Don Wetzel, vice-president of product planning at Docutel, the company that developed automated baggage-handling equipment, applied for a patent on an ATM machine in 1968 which, as mathematicians will notice, is one year after Reg did his stuff in Enfield and two years after Goodfellow applied for his patent.

All these disputes may well turn out to be only of historical interest. Today, there are 1.25m ATMs worldwide, and by 2007 it is predicted there there will be 1.5m. But, Shepherd-Baron contends, the days of the ATM are probably numbered. "The proposed national identity card will be based on retinal scans which look as though they will be 99.5% effective. If, as I suspect, banks get interested in this technology, we will be able to do away with ATMs and become a truly cashless society."