Police uncovered a cannabis growing operation when they raided a terraced house, Lincoln Crown Court was told.
Officers forced their way into the property in Milton Street, Lincoln, and found that two of the rooms were being used to grow cannabis plants.
Phil Howes, prosecuting, said: “They saw a ground floor room with a bed and clothing where someone was living and sleeping.
“The two bedrooms upstairs had been set aside for growing cannabis. The officers heard movement upstairs and a man emerged and was arrested.
“A total of 14 plants were found growing in one bedroom and 20 in another. On the streets the drugs could have made between £9,500 and £28,500.”
Mr Howes said that the man arrested at the house was Eimantas Ramonas who went on to admit he had been watering the plants in return for being given somewhere to stay.
The prosecutor added: “The defendant’s role was limited and we accept that he was placed there. He was given the task of looking after these plants.
Ramonas,38, who gave his address as Milton Street, Lincoln, admitted a charge of producing a controlled drug as a result of the police raid carried out on February 12, 2019.
He was given a 12 month jail sentence suspended for two years and 60 hours of unpaid work.
George Wills, for Ramonas, said that the basis of his guilty plea was that he had no involvement in the onward supply of drugs and received no other benefit than his accommodation.