Tyler Webster was “drowsy and under the influence of some sort of drug”, when police found him in a car, parked on Indigo Court, on July 26.
Officers searched the car and found a small quantity of the synthetic cannabanoid.
Webster, 18, of Sycamore Road, admitted possession of the Class B drug when he appeared before magistrates in Mansfield, on Thursday.
He was last before the courts in July last year for possession of a bladed article, when he was given a youth rehabilitation order, which he breached in October.
Morgan Hogarth, mitigating, said Webster had been homeless at the time, after living with a relative described as “a bad influence”.
“He has been clean from drugs for a significant period,” Mr Hogarth said.
Webster was now living back with his mother and had found work as a window fabricator, and was doing “really well” on the youth rehabilitation order, he said.
District judge Andrew Meachin said: “It appears you are in the process of turning your life around from a very difficult period.”
Webster was fined £143, and ordered to pay costs of £85 and a £30 government surcharge.