Williams has been in the league's substance-abuse program since 2002 and has tested positive for marijuana.
Williams told The Miami Herald for Tuesday's editions that when players were given Friday off, "Automatically your mind, which is so constrained since training camp began ... says, 'I'm free, what can I do?' "
"So there was definitely an urge," he said. "But I just thought about what I have to lose, and it was easy. The urge didn't last very long."
Since 2004, the Dolphins running back has played only 16 NFL games, including three this year. If Williams were to smoke marijuana again, he would likely be out of the NFL for good because he already has violated the league drug policy four times.
"There's no space, no wiggle room for me," Williams said.
He said that doesn't scare him, because he feels he's in control and on the right path. He said he successfully fought off the latest urge to smoke by meditating instead, which gives him the same "feeling of being free" as marijuana.
"A lot of times when people have some kind of addiction, what happens is they make a mistake and trip up and afterward say, 'I don't know what I was thinking,' " he said. "If you always try to be aware of what is going on in your mind, you won't ever get to that point where it's too late."
The 1998 Heisman Trophy winner and 2002 NFL rushing champion said it's normal to have an urge to smoke. Williams is tested nine times per month on a random basis. The man who administers the urinalysis for the NFL sometimes shows up at Williams' home before dawn.
Williams said he will not smoke marijuana again while he's in the NFL, but he's uncertain whether he'll abstain when his career ends.
"I'd be lying if I said I'm never going to do it again after I'm done," he said. "I don't know. I don't spend much time thinking about it."