Police found £7,000 worth of cannabis growing in a tent when they searched a house in Leeds.
Paul Hendry, 32, was given a suspended sentence yesterday after he admitted responsibility for growing the class B drug at his home on Bodmin Crescent, Middleton.
Leeds Crown Court heard officers executed a search warrant at the property on February 27 this year.
Peter Byrne, prosecuting, said officers could immediately smell the drug when the door was opened to them.
Hendry, who was at home with his wife and another man at the time, immediately handed a plastic bag to the officers which contained the drug.
The rest of the house was searched and 12 plants were found growing inside a tent in an upstairs room.
Lights and other growing equipment were also inside the tent and it was fitted with an air vent which went up into the loft.
The electricity supply had also been bypassed.
Pruning scissors, compost and more plastic bags were also found in the bathroom.
Cannabis worth £2,000 was seized from the house.
Mr Byrne said experts who examined the plants estimated that they were capable of producing cannabis with a street value of £7,627. After he was arrested Hendry told officers he was growing the plants for his own use and claimed to smoke £50 worth of the drug every day.
He pleaded guilty to producing cannabis and abstracting electricity.
Richard Reed, mitigating, said Hendry had pleaded guilty to the offence at the earliest opportunity and had co-operated with the police investigation.
Mr Reed said Hendry had no similar previous convictions and was sorry for what he had done.
Hendry was given a 12-month prison sentence, suspended for two years and ordered to attend a programme designed to address his offending.
Recorder Christopher Attwooll said: “Production of cannabis is always a very serious offence.
“You put yourself well in line for a custodial sentence.”