Sally Dent is on trial in England with her partner Shaun Binfield (45), charged with the manslaughter of their two-year-old son Riley Pettipierre last March.
The toddler died in hospital after he consumed methadone at the couple's flat in Belper, Derbyshire.
Today Dent (33) told a jury that she had come home from her local chemists on March 12 with three bottles of methadone, which she had been prescribed.
The court heard earlier that Dent had been addicted to heroin since she was 16 and was struggling to kick the habit.
She told the court today that she regularly sold some of her methadone to other addicts to make extra cash.
When she arrived home, she went into the kitchen of the family's two-bedroom flat and poured some of two of the bottles into a green and yellow child's beaker.
She then topped the two bottles up with water.
Dent told the court: "I looked around to see what I could put it [the methadone] in and that's when I put it in my baby's beaker."
"I was just thinking of somewhere safe to put it because the lid was so tight on it that I knew it wouldn't spill," she said.
Dent, who denies manslaughter, said she would usually have put the methadone into an empty bottle of the drug but didn't have any at hand.
She said she then put the beaker on the window sill where Riley couldn't get to it before returning to her family in the living room.
The trial was adjourned until Monday.