Brian Outhwaite, prosecuting, told the court how Darren Curtis' offending came to light when the emergency services were called out to reports of a fire at his address on October 19 last year.
He said: "They spoke to the defendant, and could smell cannabis and from a room upstairs they found 117 plants at various states of growth.
"The found in an attic room they found seven plants, and in a second room they found 10 plants and cuttings."
Mr Outhwaite told the court that the plants were being grown 'too close together' and that they were 'only under three lights' - and suggested it was an unsophisticated set-up.
Based on the combined weight of the 117 plants, Mr Outhwaite said police concluded that the estimated value of Curtis' crop was approximately £7,350.
Curtis, aged 40, pleaded guilty to one count of producing cannabis at an earlier hearing.
The court was told that Curtis does not have any previous convictions relating to drugs.
Defending, Richard Sheldon, told the court that as an alternative to an immediate custodial sentence, Curtis, of Jenkin Road, Wincobank could be made the subject of an unpaid work order and a curfew.
The Judge, Mr Recorder Anthony Hawks, sentenced Curtis to six months in prison, suspended for 18 months, and ordered him to complete 100 hours of unpaid work.
He told Curtis: "I don't know what your attitude to cannabis is, and whether you think you need to smoke it or think it shouldn't be illegal, but it is. But if you grow it or do anything like this again you will go to prison.
"Your attempts to grow this were fairly ineffective, but don't treat this as a lesson for how you can do it better in the future."