Darren Brassington, 49, of Briar Close, Stanton Hill, admitted being concerned in the production of the class B drug when he appeared at Mansfield Magistrates Court on Thursday.
The court heard officers went to his address on June 9 following a tip off and found eight plants and growing equipment.
Brassington told police he grew the cannabis for his personal use and his partner knew nothing about it.
Sara Phillips, of the probation service, said: “He says he used the cannabis for pain relief and began making it as a juice. He said previous medication had significant side effects.”
He was given a 12 week community order with an electronically monitored curfew from 9pm to 7am and was ordered to pay costs of £85 and a victim surcharge of £85.