Tracey Burt, 34, of Arden Street, New Mills, was given a conditional discharge on Monday after pleading guilty to possession of a Class A drug.
High Peak Magistrate’s Court heard Burt was stopped by police as she left a property in New Mills at 12.20pm on October 28 last year.
When officers searched Burt, they discovered half a gram of heroin in three separate wraps, the court heard.
John Cooper, prosecuting, said: “As a result of information received, the defendant was searched by police... She had been seen leaving a flat and was searched under the misuse of drugs act.”
He added: “Ten minutes later, the property she had been seen leaving was visited and searched by police. That [search] has resulted in two defendants being arrested for supplying offences.”
Burt made full and frank admissions when she was interviewed by police.
The court heard Burt told officers she planned to smoke the heroin at her own home, and said that the supply would last for a few days.
Rebecca Wrack, defending, told the court that Burt began using heroin in her teens after a “difficult life”, in which she was abused.
The court heard Burt managed to overcome her addiction to heroin and remained drug-free for “several years”, but lapsed back into drugs last year.
Ms Wrack said: “Her mother passed away, her partner [and father] of her youngest child left her and she was using again.”
But the court heard that Burt obtained independent support to come off drugs in January, and has remained clean since then.
The court heard that Burt is a single mum and has three children, aged 16, 14, and three.
Ms Wrack said that Burt is a registered carer for her 16-year-old son, who has type one diabetes.
The court heard that Burt has a previous shoplifting conviction from 2010 and a drugs conviction from 2007.
Sentencing Burt, Magistrate Hilary Batterbee said: “We are very pleased that you have taken matters into your own hands.”
She added: “[A conditional discharge] is most unusual in a case like this, but we trust you will carry on as you are now.”
Burt was also ordered to pay £85 in costs and a £15 victim surcharge.