The science behind the lie detector test has been disputed since its creation 90 years ago, so is there any reliable way to tell if someone is lying, asks Dr Geoff Bunn, author of The Truth Machine: A Social History of the Lie Detector.

"If I was guilty and wanted to beat that machine, it wouldn't be hard," says Sharon Stone's psychopathic character in Basic Instinct.

And the history of the polygraph - better known as the lie detector test - is littered with people who have been able to trick it.

The polygraph machine was invented in 1921 in Berkeley, California.

"Berkeley was a town with a very famous police chief, August Vollmer, and he was in charge of police reform and a leader of police professionalisation in the United States," says Ken Alder, professor of history at Northwestern University in Chicago.

"He actually wanted to use the science to make the cops more law-abiding themselves, to substitute this new scientific interrogation for what was formerly known as the third degree, which was a way of getting information from people by beating them up."

Find out more The Truth And Nothing But The Truth is on Tuesday 21 May on 11:00 BST on BBC Radio 4 or catch it later on the BBC iPlayer. The Truth And Nothing But The Truth

Berkeley police officer John Larson created the first machine, basing it on the systolic blood pressure test pioneered by psychologist William Moulton Marston, who would later become a comic book writer and create Wonder Woman.

Marston believed blood pressure changes could show whether someone was lying.

The modern polygraph measures a range of physical changes such as pulse and breathing as well as blood-pressure.

But the credibility of the polygraph was challenged almost as soon as it was invented.

In 1923, in what became a historic Supreme Court judgement, Frye v United States, it was ruled that scientific evidence, like that obtained through the polygraph, should only be admissible if it was "sufficiently established to have gained general acceptance" in the scientific community.

Media playback is unsupported on your device Media caption Listen to a "temptation resistance experiment" that shows how children tell lies.

The polygraph was backed by Leonarde Keeler, who in 1930 helped set up the scientific crime detection laboratory at Northwestern, the first forensic lab in the US, a year before the FBI.

In 1948 Keeler played himself in the movie Call Northside 777 opposite James Stewart as a reporter who exonerated a man wrongly convicted of murder.

"One of the things Keeler was great at doing was bluffing people into confessing," Alder says. "He was able to get 60% confession rates by bluffing people [with the threat of the lie detector]."

His classes at Northwestern were attended by cartoonist Chester Gould, who is said to have based the incorruptible, square-jawed Dick Tracy character on Keeler and his colleagues.

Ninety years after its invention, the polygraph still has not been accepted by the scientific, legal or political communities.

"The whole process smacks of 20th Century witchcraft," said Senator Sam Ervin, who died in 1985.

It does not help that every now and again serious criminals trick the polygraph.

In 2003, Gary Ridgway admitted he was the Green River Killer, having murdered 49 women in the Seattle area. Ridgway had passed a lie detector test in 1987, while another man - who turned out to be innocent - failed.

It has been argued that psychopaths like Ridgway or serial killer Ted Bundy are able to trick the polygraph because they have lower anxiety levels than normal people but the research into this has had mixed results.

Image caption Serial killer Gary Ridgway, who is serving life without parole, passed a lie detector test in 1987

There are also examples of others - like Aldrich Ames, a CIA agent who spied for Russia - cheating it.

Polygraphy has no grounding in science because polygraph techniques in use today were developed by interrogators, not scientists, says George Maschke, a former US Army intelligence officer and co-founder of AntiPolygraph.org.

"It's dangerous and irresponsible to place any reliance on polygraph outcomes. Polygraphy has not advanced in the way a scientific field would, and that is because it's not a science, it's an interrogation technique. It can be useful in getting confessions, but it is not reliable in and of itself.

"Polygraph tests can be easily beaten. You don't have to be a trained spy or a sociopath. You just have to understand how to recognise the control questions and augment reactions to them with techniques such as biting the side of your tongue or solving a maths equation in your head," he says.

In recent years other lie detector tests have come on the market, such as voice stress analysis software, which has been used by some local authorities and government departments to check if benefit claimants are lying.

Find out more The Why Factor was broadcast on the BBC World Service at 18:30 BST on May 17 but you can catch it on the BBC iPlayer. The Why Factor

But will new techniques find foolproof ways of telling if someone is lying?

"It is possible under very controlled laboratory conditions to use a brain imaging technique called functional magnetic resonance imaging," says Steven Rose, emeritus professor of neuroscience at the Open University. "

Subjects are asked to deliberately tell a lie. The claim is that you can actually detect when someone is telling an untruth. But in the real world that ain't so."

Geraint Rees, director of the UCL Institute of Cognitive Neuroscience, says: "I don't want to be over-optimistic here that we are going to come up with some all-singing, all-dancing brain-reading, lie-detecting device. This is extremely unlikely, now or in the foreseeable future.

"What we can't do is say that because a particular area of the brain is active someone was doing something like lying. Any brain area does multiple things."

You can follow the Magazine on Twitter and on Facebook