A man who made explosives from ingredients he bought on the internet to deter burglars was today jailed for two and a half years.

Martin Counsell, 52, manufactured a substance - also used by the July 7 London bombers - to scare off intruders.

The loner used his skills as an electrical engineer to manufacture the devices in the shed of his home in Cheltenham after spending £20 on ingredients.

Counsell downloaded instructions from the internet to manufacture his devices and stored them in two garages in the middle of a residential area.

Gloucester Crown Court heard that when police raided the garages in Up Hatherley and discovered Counsell’s haul, 600 residents were evacuated from their homes.

Local people were so concerned about what could be in their midst that a public meeting was attended by more than 200 people.

The court was told that Counsell was grilled by anti-terrorist officers for six days and they were satisfied he had no links to any terrorist group or held any extreme political views.

Prosecutor Lisa Hennessy told the court: “When Gloucestershire Constabulary received a tip-off from the Metropolitan Police that a man in Gloucestershire was seeking to create a fake identity card for MI6 they had little idea what they were to find.

”The man in question, Mr Counsell, had been buying various items on eBay that indicated he might be making explosive devices.

”On May 11 this year the police executed a search warrant at an address in Brooklyn Road.

”This is a house he shared with other members of his family, including his two young grandchildren.

”In the house were various items including a quantity of detonators. On Counsell’s computer were four documents downloaded from the internet giving clear and explicit instructions on how to make explosives.

”His internet browsing history showed numerous searches dating from August 2011 on how to make small bombs and where to buy the ingredients.”

Mrs Hennessy said police discovered that Counsell also rented two garages in Buttermere Close, in the Up Hatherley area of the town.

”In the first to be searched were four fully functional improvised explosive devices which were tested in controlled explosions and which exploded with no difficulty,” she said.

”The debris contained a substance ... which Counsell had managed to manufacture. This is a very sensitive high explosive which can be detonated by static, spark, flame, impact or friction. It is not used commercially because its storage qualities are poor and it is too sensitive for safe use.

”It is worth noting that this compound was used in the London Tube bombings on 7 July 2005.”

The prosecutor said that various chemicals and detonators were also found at the garages.

”There was also what appeared to be a homemade rocket launcher but which Mr Counsell described as a potato gun,” said Mrs Hennessy.

”He said he had made about 10 improvised devices and he had tested five of them in his back garden,” Mrs Hennessy said.

”They were booby traps for burglars after being frightened that somebody had got into his house when the dogs started barking at night.

”It has to be said the police have no record of any reported burglaries.

”Counsell insisted none of the devices would have caused injury - just a loud bang - which would have been enough to frighten a burglar away.”

Mrs Hennessey explained that the devices would have caused severe lacerations and possibly loss of fingers had they exploded in someone’s hand.

If they had exploded at a distance of one to two metres there would be stinging or minor burns, the prosecutor said.

Counsell told police he had tried to obtain an MI6 identity card because he believed that if he could show he was an ex-officer he would get preferential treatment to see a psychotherapist.

The defendant, of Brooklyn Road, Cheltenham, admitted a charge of making between September 1 last year and May 12 an explosive substance “in circumstances to give rise to suspicion that he was not making it for a lawful object”.

Lloyd Jenkins, defending, said Counsell was £10,000 in debt because his business had gone bust and had shortened life expectancy because of his excessive drinking and cirrhosis of the liver.

”He is a man of previously good character. He is not a terrorist. He was not trying to blow up aeroplanes,” Mr Jenkins said.

”His world was completely turned upside down and six days later he was not charged with any terrorist offence.

”It was a reckless DIY solution to his problems. He did not realise the can of worms he was opening.

”It was never his intention to cause serious harm. His motivation was to protect his castle and it was an extremely reckless way of doing it.

”He suffers from depression, isolation, paranoia, low self esteem. He has a broken business. His wife left him because of his drinking and he has cirrhosis of the liver.

”His one release is his inquisitive mind and his flair and passion for a hobby of rocketry.

”He literally manufactured trip wires just to cause a loud bang - it was reckless and foolish.

”There were no victims but 600 people had their lives turned upside down.”

Jailing Counsell, Judge Jamie Tabor said: “Your actions caused extreme inconvenience to local residents, some of whom had to be evacuated from homes overnight.

”There was also considerable inconvenience to road users.

”Your actions, particularly in the present climate, disturbed and frightened residents.

”Your actions undermined their confidence causing them in some cases to be really frightened and anxious and some remain so even to this day, as witnessed by the fact that 200 people attended a public meeting arranged by the police.

”That gives you some idea of the scale of fear you caused.

”Further more it diverted scarce anti-terrorist resources away from other areas, particularly at this time.

”The greatest danger was to yourself. The thought of you, an alcoholic, working in your grubby garage creating this explosive, in albeit very small quantities, is extremely worrying.”

The judge said the effects of Counsell’s drinking were “visible to see”.

”At the time you committed these offences you were living a lonely and isolated life and you became dependent on alcohol,” he said.

”I have no doubt whatsoever that you knew what you were doing. As you became more isolated from society you became what the Victorians called a crank.

”You became obsessed about burglars.

”I also accept that you created those devices with the intention of scaring rather than injuring.

”You were discovered because you tried to get hold of a fake MI6 document, not because you wanted to impersonate such a person, because you thought you would get to see your psychotherapist again.

”However, you deliberately made explosive devices. You are an intelligent man and you knew it was against the law.

”I do not accept that you made it as a cheap way of deterring burglars. You chose to make explosives because you were fascinated by the process and the challenge.”

Prior to pleading guilty, Counsell wrote a letter to his local newspaper, the Gloucestershire Echo, apologising to the residents of Cheltenham.

He wrote: “In relation to the evacuation of ... the Buttermere area of Cheltenham.

”I apologise most sincerely for all the inconvenience that the residents of those areas suffered and also would like to speak to anyone personally if they so wish.

”Everything is related to property being taken away from my premises. I made some trip wires that just go bang to deter people.

”I found all this stuff on YouTube. These items were never made to harm anyone.

”My daughter, son-in-law & grandchildren were moving in and out of the house for having a tidy out and there were about four to five of these devices which each contained a pea-size bit of bang material.

”My son-in-law became implicated because he had access to the garage and ... totally innocent of anything.

”My family are now scared to move back into the house due to the stigma of all this, also the house has been broken into due to the press coverage.

”I was only trying to keep the family safe but now destroyed their lives. I am devastated about all this and am so sorry for what has happened.

”My most humble apologies to all concerned. Mr Martin Counsell.”

Speaking after the sentencing, Detective Chief Superintendent George Turner, head of the South East Counter Terrorism Unit, said: “I would like to give my sincere thanks to the local residents who were evacuated for their patience and understanding.

”I do not underestimate the disruption that this caused. Your co-operation meant that we could bring the searching of the garage to a safe conclusion.

”I believe that it is only a matter of good fortune that Counsell did not injure himself or others and for this reason I want to make it clear that we will take any such activity extremely seriously and pursue anyone who tries to do something similar.

”In this case, his purpose was misguided, but extremely dangerous, and the severity of the materials he had in his possession made it necessary for our unit to become involved.

”I would also like to thank Gloucestershire Constabulary for their handling of the incident and particularly the evacuation, and the other partner agencies involved who worked together to ensure the safety of all involved.”

Superintendent Neil Mantle, the area commander for Cheltenham, said Counsell’s actions caused disruption to hundreds of people.

”The irresponsible actions of this one man led to around 600 people being evacuated from their homes, but at a time of fear and concern for Up Hatherley residents it was the overwhelming sense of community spirit that shone through,” he said.

”By supporting the investigation the community enabled us to take fast and determined action to ensure their safety and the feedback we have received from more than 200 members of the public at a community meeting just days after the incident was hugely positive.

”The Local Resilience Forum, which includes the blue light services and local authorities, regularly train together to ensure communities are supported during emergencies and the importance and effectiveness of this was evident during those few days in May.

”We hope that the town’s residents are today reassured that we will and do take every possible measure to keep them safe and to put those intent on risking the safety of others before the courts.”